mirror of
https://github.com/grafana/grafana.git
synced 2025-01-27 16:57:14 -06:00
fix(snapshots): Fixed issue with empty snapshots, fixes #4706
This commit is contained in:
parent
6216ce455f
commit
6355896584
@ -2,6 +2,7 @@
|
||||
|
||||
### Bug fixes
|
||||
* **Graph**: Fixed issue with light theme text color issue in tooltip, fixes [#4702](https://github.com/grafana/grafana/issues/4702)
|
||||
* **Snapshot**: Fixed issue with empty snapshots, fixes [#4706](https://github.com/grafana/grafana/issues/4706)
|
||||
|
||||
# 3.0.0-beta4 (2016-04-13)
|
||||
|
||||
|
@ -65,7 +65,7 @@ class MetricsPanelCtrl extends PanelCtrl {
|
||||
var data = this.panel.snapshotData;
|
||||
// backward compatability
|
||||
if (!_.isArray(data)) {
|
||||
data = data;
|
||||
data = data.data;
|
||||
}
|
||||
|
||||
this.events.emit('data-snapshot-load', data);
|
||||
|
@ -161,7 +161,7 @@ class GraphCtrl extends MetricsPanelCtrl {
|
||||
|
||||
onDataSnapshotLoad(snapshotData) {
|
||||
this.annotationsPromise = this.annotationsSrv.getAnnotations(this.dashboard);
|
||||
this.onDataReceived(snapshotData.data);
|
||||
this.onDataReceived(snapshotData);
|
||||
}
|
||||
|
||||
onDataError(err) {
|
||||
|
@ -56,7 +56,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
||||
|
||||
this.events.on('data-received', this.onDataReceived.bind(this));
|
||||
this.events.on('data-error', this.onDataError.bind(this));
|
||||
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
|
||||
this.events.on('data-snapshot-load', this.onDataReceived.bind(this));
|
||||
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
|
||||
}
|
||||
|
||||
@ -71,10 +71,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
||||
this.render();
|
||||
}
|
||||
|
||||
onDataSnapshotLoad(snapshotData) {
|
||||
this.onDataReceived(snapshotData.data);
|
||||
}
|
||||
|
||||
onDataError(err) {
|
||||
this.onDataReceived({data: []});
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class TablePanelCtrl extends MetricsPanelCtrl {
|
||||
|
||||
this.events.on('data-received', this.onDataReceived.bind(this));
|
||||
this.events.on('data-error', this.onDataError.bind(this));
|
||||
this.events.on('data-snapshot-load', this.onDataSnapshotLoad.bind(this));
|
||||
this.events.on('data-snapshot-load', this.onDataReceived.bind(this));
|
||||
this.events.on('init-edit-mode', this.onInitEditMode.bind(this));
|
||||
this.events.on('init-panel-actions', this.onInitPanelActions.bind(this));
|
||||
}
|
||||
@ -86,10 +86,6 @@ class TablePanelCtrl extends MetricsPanelCtrl {
|
||||
return super.issueQueries(datasource);
|
||||
}
|
||||
|
||||
onDataSnapshotLoad(data) {
|
||||
this.onDataReceived(data.data);
|
||||
}
|
||||
|
||||
onDataError(err) {
|
||||
this.dataRaw = [];
|
||||
this.render();
|
||||
|
Loading…
Reference in New Issue
Block a user