Commit bafa334b by Torkel Ödegaard

moved timezone correction setting from graph style to dashboard

parent 80c5f99f
......@@ -10,7 +10,7 @@ function (angular, $, kbn, moment, _) {
var module = angular.module('kibana.directives');
module.directive('grafanaGraph', function(filterSrv, $rootScope) {
module.directive('grafanaGraph', function(filterSrv, $rootScope, dashboard) {
return {
restrict: 'A',
template: '<div> </div>',
......@@ -116,7 +116,7 @@ function (angular, $, kbn, moment, _) {
},
yaxes: [],
xaxis: {
timezone: scope.panel.timezone,
timezone: dashboard.current.timezone,
show: scope.panel['x-axis'],
mode: "time",
min: _.isUndefined(scope.range.from) ? null : scope.range.from.getTime(),
......@@ -299,7 +299,7 @@ function (angular, $, kbn, moment, _) {
if(item.series.info.y_format === 'ms') {
value = kbn.msFormat(value);
}
timestamp = scope.panel.timezone === 'browser' ?
timestamp = dashboard.current.timezone === 'browser' ?
moment(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') :
moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss');
$tooltip
......
......@@ -12,7 +12,7 @@
<center><img ng-show='panel.loading && _.isUndefined(data)' src="img/load_big.gif"></center>
<div grafana-graph class="pointer histogram-chart" params="{{panel}}">
<div grafana-graph class="pointer histogram-chart">
</div>
<div ng-if="panel.legend" class="grafana-legend-container">
......
......@@ -181,9 +181,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
legend : true,
/** @scratch /panels/histogram/3
* ==== Transformations
* timezone:: Correct for browser timezone?. Valid values: browser, utc
*/
timezone : 'browser', // browser or utc
/** @scratch /panels/histogram/3
* percentage:: Show the y-axis as a percentage of the axis total. Only makes sense for multiple
* queries
......@@ -216,7 +213,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope.init = function() {
// Hide view options by default
$scope.fullscreen = false;
$scope.options = false;
......
......@@ -7,10 +7,6 @@
<label class="small">Renderer</label><select class="input-mini" ng-model="panel.renderer" ng-options="f for f in ['flot', 'png']" ng-change="get_data()"></select>
</div>
<div class="editor-option">
<label class="small">Time correction</label>
<select ng-model="panel.timezone" class='input-small' ng-options="f for f in ['browser','utc']"></select>
</div>
<div class="editor-option">
<label class="small">Bars</label><input type="checkbox" ng-model="panel.bars" ng-checked="panel.bars" ng-change="render()">
</div>
<div class="editor-option">
......
......@@ -18,7 +18,8 @@
<label class="small">Style</label><select class="input-small" ng-model="dashboard.current.style" ng-options="f for f in ['dark','light']"></select>
</div>
<div class="editor-option">
<label class="small"> Editable </label><input type="checkbox" ng-model="dashboard.current.editable" ng-checked="dashboard.current.editable" />
<label class="small">Time correction</label>
<select ng-model="dashboard.current.timezone" class='input-small' ng-options="f for f in ['browser','utc']"></select>
</div>
<div class="editor-option">
<label class="small"> Hints <tip>Show 'Add panel' hints in empty spaces</tip></label><input type="checkbox" ng-model="dashboard.current.panel_hints" ng-checked="dashboard.current.panel_hints" />
......
......@@ -22,6 +22,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
var _dash = {
title: "",
style: "dark",
timezone: 'browser',
editable: true,
failover: false,
panel_hints: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment