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