From bafa334b9418e00c1765990dc86631a878f13a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 5 Feb 2014 09:42:49 +0100 Subject: [PATCH] moved timezone correction setting from graph style to dashboard --- src/app/directives/grafanaGraph.js | 6 +++--- src/app/panels/graphite/module.html | 2 +- src/app/panels/graphite/module.js | 4 ---- src/app/panels/graphite/styleEditor.html | 4 ---- src/app/partials/dasheditor.html | 3 ++- src/app/services/dashboard.js | 1 + 6 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/app/directives/grafanaGraph.js b/src/app/directives/grafanaGraph.js index f04e23aab26..ddb9e9492c8 100644 --- a/src/app/directives/grafanaGraph.js +++ b/src/app/directives/grafanaGraph.js @@ -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: '
', @@ -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 diff --git a/src/app/panels/graphite/module.html b/src/app/panels/graphite/module.html index 5d0c4d2699c..834ec62f542 100644 --- a/src/app/panels/graphite/module.html +++ b/src/app/panels/graphite/module.html @@ -12,7 +12,7 @@
-
+
diff --git a/src/app/panels/graphite/module.js b/src/app/panels/graphite/module.js index c315e2eb412..49e24c401b0 100644 --- a/src/app/panels/graphite/module.js +++ b/src/app/panels/graphite/module.js @@ -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; diff --git a/src/app/panels/graphite/styleEditor.html b/src/app/panels/graphite/styleEditor.html index 9e73e395ded..c9fb0519f2a 100644 --- a/src/app/panels/graphite/styleEditor.html +++ b/src/app/panels/graphite/styleEditor.html @@ -6,10 +6,6 @@
-
- - -
diff --git a/src/app/partials/dasheditor.html b/src/app/partials/dasheditor.html index 4bccbc2e41c..65fbb21e9b2 100644 --- a/src/app/partials/dasheditor.html +++ b/src/app/partials/dasheditor.html @@ -18,7 +18,8 @@
- + +
diff --git a/src/app/services/dashboard.js b/src/app/services/dashboard.js index 942c1a64f0a..74f6d1f36c2 100644 --- a/src/app/services/dashboard.js +++ b/src/app/services/dashboard.js @@ -22,6 +22,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) { var _dash = { title: "", style: "dark", + timezone: 'browser', editable: true, failover: false, panel_hints: true,