DataSourceApi: add getCollapsedText(query) to DataSourceApi (#16482)

Add getQueryDisplayText() to DataSourceApi
This commit is contained in:
Ryan McKinley
2019-04-10 09:31:32 -07:00
committed by GitHub
parent 23d461af13
commit 5bc936d2da
6 changed files with 22 additions and 5 deletions

View File

@@ -55,6 +55,10 @@ export class PrometheusDatasource implements DataSourceApi<PromQuery> {
this.loadRules();
}
getQueryDisplayText(query: PromQuery) {
return query.expr;
}
_request(url, data?, options?: any) {
options = _.defaults(options || {}, {
url: this.url + url,

View File

@@ -89,10 +89,6 @@ class PrometheusQueryCtrl extends QueryCtrl {
}).join('&');
this.linkToPrometheus = this.datasource.directUrl + '/graph?' + args;
}
getCollapsedText() {
return this.target.expr;
}
}
export { PrometheusQueryCtrl };