Added different time period override to singlestat panel, added option to hide panel time override info, Closes #171

This commit is contained in:
Torkel Ödegaard
2015-03-01 12:06:05 +01:00
parent 57b5b4c376
commit bee501da4a
7 changed files with 37 additions and 16 deletions
+4
View File
@@ -54,6 +54,10 @@ function (angular, _, kbn, $) {
scope.rangeUnparsed = scope.range; scope.rangeUnparsed = scope.range;
} }
if (scope.panel.hideTimeOverride) {
scope.panelMeta.timeInfo = '';
}
}; };
this.issueMetricQuery = function(scope, datasource) { this.issueMetricQuery = function(scope, datasource) {
+1
View File
@@ -13,6 +13,7 @@ function (angular, $, _) {
'<span class="panel-title drag-handle pointer">' + '<span class="panel-title drag-handle pointer">' +
'<span class="panel-title-text drag-handle">{{panel.title | interpolateTemplateVars}}</span>' + '<span class="panel-title-text drag-handle">{{panel.title | interpolateTemplateVars}}</span>' +
'<span class="panel-links-icon"></span>' + '<span class="panel-links-icon"></span>' +
'<span class="panel-time-info" ng-show="panelMeta.timeInfo"><i class="fa fa-clock-o"></i> {{panelMeta.timeInfo}}</span>' +
'</span>'; '</span>';
function createMenuTemplate($scope) { function createMenuTemplate($scope) {
+1 -1
View File
@@ -89,7 +89,7 @@ function (angular, _, config) {
}; };
$scope.getCurrentDatasource = function() { $scope.getCurrentDatasource = function() {
if ($scope.datasource) { if ($scope.datasource) {
return $q.when($scope.datasource); return $q.when($scope.datasource);
} }
+18 -2
View File
@@ -5,7 +5,7 @@
<li class="tight-form-item tight-form-item-icon"> <li class="tight-form-item tight-form-item-icon">
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
</li> </li>
<li class="tight-form-item" style="width: 148px"> <li class="tight-form-item" style="width: 178px">
<strong>Override relative time</strong> <strong>Override relative time</strong>
</li> </li>
<li class="tight-form-item" style="width: 50px"> <li class="tight-form-item" style="width: 50px">
@@ -24,7 +24,7 @@
<li class="tight-form-item tight-form-item-icon"> <li class="tight-form-item tight-form-item-icon">
<i class="fa fa-clock-o"></i> <i class="fa fa-clock-o"></i>
</li> </li>
<li class="tight-form-item" style="width: 148px"> <li class="tight-form-item" style="width: 178px">
<strong>Add time shift</strong> <strong>Add time shift</strong>
</li> </li>
<li class="tight-form-item" style="width: 50px"> <li class="tight-form-item" style="width: 50px">
@@ -38,6 +38,22 @@
</ul> </ul>
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div class="tight-form">
<ul class="tight-form-list">
<li class="tight-form-item tight-form-item-icon">
<i class="fa fa-clock-o"></i>
</li>
<li class="tight-form-item" style="width: 178px">
<strong>Hide time override info</strong>
</li>
<li class="tight-form-item last">
<input class="cr1" id="panel.hideTimeOverride" type="checkbox"
ng-model="panel.hideTimeOverride" ng-checked="panel.hideTimeOverride" ng-change="get_data()">
<label for="panel.hideTimeOverride" class="cr1"></label>
</li>
</ul>
<div class="clearfix"></div>
</div>
</div> </div>
</div> </div>
+3 -3
View File
@@ -3,9 +3,9 @@
<div class="graph-wrapper" ng-class="{'graph-legend-rightside': panel.legend.rightSide}"> <div class="graph-wrapper" ng-class="{'graph-legend-rightside': panel.legend.rightSide}">
<div class="graph-canvas-wrapper"> <div class="graph-canvas-wrapper">
<span class="graph-time-info" ng-if="panelMeta.timeInfo"> <!-- <span class="graph&#45;time&#45;info" ng&#45;if="panelMeta.timeInfo"> -->
<i class="fa fa-clock-o"></i> {{panelMeta.timeInfo}} <!-- <i class="fa fa&#45;clock&#45;o"></i> {{panelMeta.timeInfo}} -->
</span> <!-- </span> -->
<div ng-if="datapointsWarning" class="datapoints-warning"> <div ng-if="datapointsWarning" class="datapoints-warning">
<span class="small" ng-show="!datapointsCount"> <span class="small" ng-show="!datapointsCount">
-10
View File
@@ -141,7 +141,6 @@
vertical-align: top; vertical-align: top;
position: relative; position: relative;
left: 4px; left: 4px;
top: -25px;
} }
.graph-legend { .graph-legend {
@@ -268,13 +267,4 @@
font-size: 12px; font-size: 12px;
} }
.graph-time-info {
font-weight: bold;
float: right;
margin-right: 15px;
color: @blue;
font-size: 85%;
position: relative;
top: -20px;
}
+10
View File
@@ -169,4 +169,14 @@
} }
} }
.panel-time-info {
font-weight: bold;
float: right;
margin-right: 15px;
color: @blue;
font-size: 85%;
position: absolute;
top: 0;
right: 0;
}