mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SingleStatPanel: various fixes
This commit is contained in:
parent
37176fa42d
commit
fa813024ca
@ -169,7 +169,9 @@ function (angular, app, _, TimeSeries, kbn) {
|
||||
var data = {};
|
||||
|
||||
if (!$scope.series || $scope.series.length === 0) {
|
||||
data.series = { mainValue: null, datapoints: [] };
|
||||
data.flotpairs = [];
|
||||
data.mainValue = Number.NaN;
|
||||
data.mainValueFormated = 'NaN';
|
||||
}
|
||||
else {
|
||||
var series = $scope.series[0];
|
||||
|
@ -21,14 +21,6 @@ function (angular, app, _, kbn, $) {
|
||||
var $panelContainer = elem.parents('.panel-container');
|
||||
|
||||
scope.$on('render', function() {
|
||||
data = scope.data;
|
||||
panel = scope.panel;
|
||||
|
||||
if (!data || data.flotpairs.length === 0) {
|
||||
elem.html('no data');
|
||||
return;
|
||||
}
|
||||
|
||||
render();
|
||||
});
|
||||
|
||||
@ -148,9 +140,11 @@ function (angular, app, _, kbn, $) {
|
||||
}
|
||||
|
||||
function render() {
|
||||
data = scope.data;
|
||||
panel = scope.panel;
|
||||
|
||||
setElementHeight();
|
||||
|
||||
var panel = scope.panel;
|
||||
var body = getBigValueHtml();
|
||||
|
||||
if (panel.colorBackground && data.mainValue) {
|
||||
|
@ -99,10 +99,15 @@ function (angular, $, kbn, _, moment) {
|
||||
result.panel = panel;
|
||||
result.row = row;
|
||||
result.index = index;
|
||||
return;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (!result.panel) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,9 @@ function (angular, _, $) {
|
||||
if (!this.state.panelId) { return; }
|
||||
|
||||
var panelInfo = this.$scope.dashboard.getPanelInfoById(this.state.panelId);
|
||||
panelInfo.row.collapse = false;
|
||||
if (panelInfo) {
|
||||
panelInfo.row.collapse = false;
|
||||
}
|
||||
};
|
||||
|
||||
DashboardViewState.prototype.needsSync = function(urlState) {
|
||||
|
Loading…
Reference in New Issue
Block a user