Filter problems by time range, fix #1094

This commit is contained in:
Alexander Zobnin
2020-12-23 12:48:46 +03:00
parent 3f10be6a9d
commit 98025026f7
4 changed files with 15 additions and 6 deletions

View File

@@ -453,7 +453,7 @@ export class ZabbixDatasource extends DataSourceApi<ZabbixMetricsQuery, ZabbixDS
});
}
queryProblems(target, timeRange, options) {
queryProblems(target: ZabbixMetricsQuery, timeRange, options) {
const [timeFrom, timeTo] = timeRange;
const userIsEditor = contextSrv.isEditor || contextSrv.isGrafanaAdmin;
@@ -512,7 +512,7 @@ export class ZabbixDatasource extends DataSourceApi<ZabbixMetricsQuery, ZabbixDS
}
let getProblemsPromise: Promise<ProblemDTO[]>;
if (showProblems === ShowProblemTypes.History) {
if (showProblems === ShowProblemTypes.History || target.options?.useTimeRange) {
problemsOptions.timeFrom = timeFrom;
problemsOptions.timeTo = timeTo;
getProblemsPromise = this.zabbix.getProblemsHistory(groupFilter, hostFilter, appFilter, proxyFilter, problemsOptions);