From 8660790ff989e6c6807153a37679d7d633f654fa Mon Sep 17 00:00:00 2001 From: rozetko Date: Mon, 17 Jun 2019 15:54:16 +0300 Subject: [PATCH] Show "Browser access type is not supported" message #345 (#346) --- src/panel/graph_panel/graph_ctrl.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index 26d1edd..d63401c 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -362,7 +362,7 @@ class GraphCtrl extends MetricsPanelCtrl { this.dataList = dataList; this.loading = true; - + let seriesList = this.processor.getSeriesList({ dataList: this.dataList, range: this.range, @@ -646,7 +646,7 @@ class GraphCtrl extends MetricsPanelCtrl { async onAnalyticUnitSave(analyticUnit: AnalyticUnit) { if( - this.analyticsController.labelingUnit !== null && + this.analyticsController.labelingUnit !== null && this.analyticsController.labelingUnit.id === analyticUnit.id ) { await this.onToggleLabelingMode(analyticUnit.id) @@ -758,6 +758,9 @@ class GraphCtrl extends MetricsPanelCtrl { private async _getDatasourceRequest() { if(this._datasourceRequest.type === undefined) { const datasource = await this._getDatasourceByName(this.panel.datasource); + if(datasource.access !== 'proxy') { + throw new Error(`"${datasource.name}" datasource has "Browser" access type but only "Server" is supported`); + } this._datasourceRequest.type = datasource.type; } return this._datasourceRequest;