Commit bafa334b by Torkel Ödegaard

moved timezone correction setting from graph style to dashboard

parent 80c5f99f
...@@ -10,7 +10,7 @@ function (angular, $, kbn, moment, _) { ...@@ -10,7 +10,7 @@ function (angular, $, kbn, moment, _) {
var module = angular.module('kibana.directives'); var module = angular.module('kibana.directives');
module.directive('grafanaGraph', function(filterSrv, $rootScope) { module.directive('grafanaGraph', function(filterSrv, $rootScope, dashboard) {
return { return {
restrict: 'A', restrict: 'A',
template: '<div> </div>', template: '<div> </div>',
...@@ -116,7 +116,7 @@ function (angular, $, kbn, moment, _) { ...@@ -116,7 +116,7 @@ function (angular, $, kbn, moment, _) {
}, },
yaxes: [], yaxes: [],
xaxis: { xaxis: {
timezone: scope.panel.timezone, timezone: dashboard.current.timezone,
show: scope.panel['x-axis'], show: scope.panel['x-axis'],
mode: "time", mode: "time",
min: _.isUndefined(scope.range.from) ? null : scope.range.from.getTime(), min: _.isUndefined(scope.range.from) ? null : scope.range.from.getTime(),
...@@ -299,7 +299,7 @@ function (angular, $, kbn, moment, _) { ...@@ -299,7 +299,7 @@ function (angular, $, kbn, moment, _) {
if(item.series.info.y_format === 'ms') { if(item.series.info.y_format === 'ms') {
value = kbn.msFormat(value); 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(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss') :
moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss'); moment.utc(item.datapoint[0]).format('YYYY-MM-DD HH:mm:ss');
$tooltip $tooltip
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<center><img ng-show='panel.loading && _.isUndefined(data)' src="img/load_big.gif"></center> <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>
<div ng-if="panel.legend" class="grafana-legend-container"> <div ng-if="panel.legend" class="grafana-legend-container">
......
...@@ -181,9 +181,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -181,9 +181,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
legend : true, legend : true,
/** @scratch /panels/histogram/3 /** @scratch /panels/histogram/3
* ==== Transformations * ==== Transformations
* timezone:: Correct for browser timezone?. Valid values: browser, utc
*/
timezone : 'browser', // browser or utc
/** @scratch /panels/histogram/3 /** @scratch /panels/histogram/3
* percentage:: Show the y-axis as a percentage of the axis total. Only makes sense for multiple * percentage:: Show the y-axis as a percentage of the axis total. Only makes sense for multiple
* queries * queries
...@@ -216,7 +213,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -216,7 +213,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
$scope.init = function() { $scope.init = function() {
// Hide view options by default // Hide view options by default
$scope.fullscreen = false; $scope.fullscreen = false;
$scope.options = false; $scope.options = false;
......
...@@ -7,10 +7,6 @@ ...@@ -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> <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>
<div class="editor-option"> <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()"> <label class="small">Bars</label><input type="checkbox" ng-model="panel.bars" ng-checked="panel.bars" ng-change="render()">
</div> </div>
<div class="editor-option"> <div class="editor-option">
......
...@@ -18,7 +18,8 @@ ...@@ -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> <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>
<div class="editor-option"> <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>
<div class="editor-option"> <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" /> <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) { ...@@ -22,6 +22,7 @@ function (angular, $, kbn, _, config, moment, Modernizr) {
var _dash = { var _dash = {
title: "", title: "",
style: "dark", style: "dark",
timezone: 'browser',
editable: true, editable: true,
failover: false, failover: false,
panel_hints: true, 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