Quellcode durchsuchen

moved timezone correction setting from graph style to dashboard

Torkel Ödegaard vor 12 Jahren
Ursprung
Commit
bafa334b94

+ 3 - 3
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: '<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

+ 1 - 1
src/app/panels/graphite/module.html

@@ -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">

+ 0 - 4
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;

+ 0 - 4
src/app/panels/graphite/styleEditor.html

@@ -6,10 +6,6 @@
     <div class="editor-option">
       <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>

+ 2 - 1
src/app/partials/dasheditor.html

@@ -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" />

+ 1 - 0
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,