Commit 767c672a by Torkel Ödegaard Committed by GitHub

PanelData: Support showing data and errors in angular panels (#20286)

parent 7e96a57c
......@@ -106,7 +106,6 @@ class MetricsPanelCtrl extends PanelCtrl {
return;
}
this.loading = false;
this.error = err.message || 'Request Error';
if (err.data) {
......@@ -116,10 +115,6 @@ class MetricsPanelCtrl extends PanelCtrl {
this.error = err.data.error;
}
}
return this.$timeout(() => {
this.events.emit(PanelEvents.dataError, err);
});
}
// Updates the response with information from the stream
......@@ -128,10 +123,6 @@ class MetricsPanelCtrl extends PanelCtrl {
if (data.state === LoadingState.Error) {
this.loading = false;
this.processDataError(data.error);
if (!data.series) {
// keep current data if the response is empty
return;
}
}
// Ignore data in loading state
......
......@@ -153,7 +153,6 @@ class GraphCtrl extends MetricsPanelCtrl {
this.events.on(PanelEvents.render, this.onRender.bind(this));
this.events.on(CoreEvents.dataFramesReceived, this.onDataFramesReceived.bind(this));
this.events.on(PanelEvents.dataError, this.onDataError.bind(this));
this.events.on(PanelEvents.dataSnapshotLoad, this.onDataSnapshotLoad.bind(this));
this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));
this.events.on(PanelEvents.initPanelActions, this.onInitPanelActions.bind(this));
......@@ -209,12 +208,6 @@ class GraphCtrl extends MetricsPanelCtrl {
this.onDataFramesReceived(frames);
}
onDataError(err: any) {
this.seriesList = [];
this.annotations = [];
this.render([]);
}
onDataFramesReceived(data: DataFrame[]) {
this.dataList = data;
this.seriesList = this.processor.getSeriesList({
......
......@@ -144,7 +144,6 @@ export class HeatmapCtrl extends MetricsPanelCtrl {
// Bind grafana panel events
this.events.on(PanelEvents.render, this.onRender.bind(this));
this.events.on(CoreEvents.dataFramesReceived, this.onDataFramesReceived.bind(this));
this.events.on(PanelEvents.dataError, this.onDataError.bind(this));
this.events.on(PanelEvents.dataSnapshotLoad, this.onSnapshotLoad.bind(this));
this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));
......
......@@ -121,7 +121,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
_.defaults(this.panel, this.panelDefaults);
this.events.on(CoreEvents.dataFramesReceived, this.onFramesReceived.bind(this));
this.events.on(PanelEvents.dataError, this.onDataError.bind(this));
this.events.on(PanelEvents.dataSnapshotLoad, this.onSnapshotLoad.bind(this));
this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));
......@@ -152,10 +151,6 @@ class SingleStatCtrl extends MetricsPanelCtrl {
this.refresh();
}
onDataError(err: any) {
this.handleDataFrames([]);
}
onSnapshotLoad(dataList: LegacyResponseData[]) {
this.onFramesReceived(getProcessedDataFrames(dataList));
}
......
......@@ -71,7 +71,6 @@ class TablePanelCtrl extends MetricsPanelCtrl {
_.defaults(this.panel, this.panelDefaults);
this.events.on(PanelEvents.dataReceived, this.onDataReceived.bind(this));
this.events.on(PanelEvents.dataError, this.onDataError.bind(this));
this.events.on(PanelEvents.dataSnapshotLoad, this.onDataReceived.bind(this));
this.events.on(PanelEvents.editModeInitialized, this.onInitEditMode.bind(this));
this.events.on(PanelEvents.initPanelActions, this.onInitPanelActions.bind(this));
......@@ -108,11 +107,6 @@ class TablePanelCtrl extends MetricsPanelCtrl {
return super.issueQueries(datasource);
}
onDataError(err: any) {
this.dataRaw = [];
this.render();
}
onDataReceived(dataList: any) {
this.dataRaw = dataList;
this.pageIndex = 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