Browse Source

Hastic datasource doesn't work with Grafana at sub-url #227 (#228)

master
rozetko 6 years ago committed by GitHub
parent
commit
4fd895710d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/panel/graph_panel/graph_ctrl.ts

8
src/panel/graph_panel/graph_ctrl.ts

@ -203,12 +203,12 @@ class GraphCtrl extends MetricsPanelCtrl {
const hasticDatasource = _.find(this._hasticDatasources, { id: hasticDatasourceId });
let url = hasticDatasource.url;
if(hasticDatasource.access === 'proxy') {
url = `/api/datasources/proxy/${hasticDatasource.id}`
url = `api/datasources/proxy/${hasticDatasource.id}`;
}
return {
url,
name: hasticDatasource.name
}
};
}
return undefined;
}
@ -699,7 +699,7 @@ class GraphCtrl extends MetricsPanelCtrl {
throw new Error('Trying to get datasource with NULL name');
}
if(this._datasources[name] === undefined) {
const datasource = await this.backendSrv.get(`/api/datasources/name/${name}`);
const datasource = await this.backendSrv.get(`api/datasources/name/${name}`);
return datasource;
} else {
return this._datasources[name];
@ -707,7 +707,7 @@ class GraphCtrl extends MetricsPanelCtrl {
}
private async _fetchHasticDatasources() {
this._hasticDatasources = await this.backendSrv.get('/api/datasources');
this._hasticDatasources = await this.backendSrv.get('api/datasources');
this._hasticDatasources = this._hasticDatasources.filter(ds => ds.type === 'corpglory-hastic-datasource');
this.$scope.$digest();
}

Loading…
Cancel
Save