Datasource/CloudWatch: Makes CloudWatch Logs query history more readable (#24795)

Now just displays query expression rather than stringified JSON
This commit is contained in:
kay delaney 2020-05-19 11:43:43 +01:00 committed by GitHub
parent cbf68c8ecc
commit 2f01f1320f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -900,6 +900,14 @@ export class CloudWatchDatasource extends DataSourceApi<CloudWatchQuery, CloudWa
return this.templateSrv.replace(target, scopedVars); return this.templateSrv.replace(target, scopedVars);
} }
getQueryDisplayText(query: CloudWatchQuery) {
if (query.queryMode === 'Logs') {
return query.expression;
} else {
return JSON.stringify(query);
}
}
} }
function withTeardown<T = any>(observable: Observable<T>, onUnsubscribe: () => void): Observable<T> { function withTeardown<T = any>(observable: Observable<T>, onUnsubscribe: () => void): Observable<T> {