Commit bee501da by Torkel Ödegaard

Added different time period override to singlestat panel, added option to hide…

Added different time period override to singlestat panel, added option to hide panel time override info, Closes #171
parent 57b5b4c3
...@@ -54,6 +54,10 @@ function (angular, _, kbn, $) { ...@@ -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) {
......
...@@ -13,6 +13,7 @@ function (angular, $, _) { ...@@ -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) {
......
...@@ -5,7 +5,7 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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,9 +3,9 @@ ...@@ -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">
......
...@@ -141,7 +141,6 @@ ...@@ -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 @@ ...@@ -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;
}
...@@ -169,4 +169,14 @@ ...@@ -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;
}
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