mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Worked on relative time and timeshift overrides for singlestat, still an issue for how to visualize the time override
This commit is contained in:
parent
2c3d3d0fe3
commit
57b5b4c376
@ -8,7 +8,7 @@ function (angular, _, config) {
|
||||
|
||||
var module = angular.module('grafana.services');
|
||||
|
||||
module.service('panelSrv', function($rootScope, $timeout, datasourceSrv) {
|
||||
module.service('panelSrv', function($rootScope, $timeout, datasourceSrv, $q) {
|
||||
|
||||
this.init = function($scope) {
|
||||
if (!$scope.panel.span) { $scope.panel.span = 12; }
|
||||
@ -88,21 +88,27 @@ function (angular, _, config) {
|
||||
return $scope.dashboardViewState.fullscreen && !$scope.fullscreen;
|
||||
};
|
||||
|
||||
$scope.getCurrentDatasource = function() {
|
||||
if ($scope.datasource) {
|
||||
return $q.when($scope.datasource);
|
||||
}
|
||||
|
||||
return datasourceSrv.get($scope.panel.datasource);
|
||||
};
|
||||
|
||||
$scope.get_data = function() {
|
||||
if ($scope.otherPanelInFullscreenMode()) { return; }
|
||||
|
||||
delete $scope.panelMeta.error;
|
||||
$scope.panelMeta.loading = true;
|
||||
|
||||
if ($scope.datasource) {
|
||||
return $scope.refreshData($scope.datasource);
|
||||
}
|
||||
|
||||
datasourceSrv.get($scope.panel.datasource).then(function(datasource) {
|
||||
$scope.getCurrentDatasource().then(function(datasource) {
|
||||
$scope.datasource = datasource;
|
||||
|
||||
return $scope.refreshData($scope.datasource).then(function() {
|
||||
$scope.panelMeta.loading = false;
|
||||
});
|
||||
|
||||
}, function(err) {
|
||||
console.log('Panel data error:', err);
|
||||
$scope.panelMeta.loading = false;
|
||||
|
@ -37,7 +37,7 @@
|
||||
Prefix
|
||||
</li>
|
||||
<li>
|
||||
<select class="input-small tight-form-input" style="width: 99px;" ng-model="panel.prefixFontSize" ng-options="f for f in fontSizes" ng-change="render()"></select>
|
||||
<select class="input-small tight-form-input" ng-model="panel.prefixFontSize" ng-options="f for f in fontSizes" ng-change="render()"></select>
|
||||
</li>
|
||||
<li class="tight-form-item">
|
||||
Value
|
||||
@ -49,7 +49,7 @@
|
||||
Postfix
|
||||
</li>
|
||||
<li>
|
||||
<select class="input-small tight-form-input last" style="width: 99px" ng-model="panel.postfixFontSize" ng-options="f for f in fontSizes" ng-change="render()"></select>
|
||||
<select class="input-small tight-form-input last" ng-model="panel.postfixFontSize" ng-options="f for f in fontSizes" ng-change="render()"></select>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="clearfix"></div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<grafana-panel>
|
||||
<div class="singlestat-panel" singlestat-panel></div>
|
||||
<div class="clearfix"></div>
|
||||
<div class="clearfix"></div>
|
||||
</grafana-panel>
|
||||
|
@ -88,7 +88,6 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
|
||||
};
|
||||
|
||||
$scope.dataHandler = function(results) {
|
||||
$scope.panelMeta.loading = false;
|
||||
$scope.series = _.map(results.data, $scope.seriesHandler);
|
||||
$scope.render();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user