Problems: fix acknowledged filter
This commit is contained in:
@@ -425,6 +425,10 @@ export class ZabbixDatasource {
|
||||
limit: target.options?.limit,
|
||||
};
|
||||
|
||||
if (target.options?.acknowledged === 0 || target.options?.acknowledged === 1) {
|
||||
problemsOptions.acknowledged = target.options?.acknowledged ? true : false;
|
||||
}
|
||||
|
||||
if (target.options?.minSeverity) {
|
||||
const severities = [0, 1, 2, 3, 4, 5].filter(v => v >= target.options?.minSeverity);
|
||||
problemsOptions.severities = severities;
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
<label class="gf-form-label width-9">Acknowledged</label>
|
||||
<div class="gf-form-select-wrapper width-12">
|
||||
<select class="gf-form-input"
|
||||
ng-change="ctrl.onTargetBlur()"
|
||||
ng-change="ctrl.onQueryOptionChange()"
|
||||
ng-model="ctrl.target.options.acknowledged"
|
||||
ng-options="a.value as a.text for a in ctrl.ackFilters">
|
||||
</select>
|
||||
|
||||
@@ -389,7 +389,7 @@ export class ZabbixAPIConnector {
|
||||
}
|
||||
|
||||
getProblems(groupids, hostids, applicationids, options): Promise<ZBXProblem[]> {
|
||||
const { timeFrom, timeTo, recent, severities, limit } = options;
|
||||
const { timeFrom, timeTo, recent, severities, limit, acknowledged } = options;
|
||||
|
||||
const params: any = {
|
||||
output: 'extend',
|
||||
@@ -412,6 +412,10 @@ export class ZabbixAPIConnector {
|
||||
params.severities = severities;
|
||||
}
|
||||
|
||||
if (acknowledged !== undefined) {
|
||||
params.acknowledged = acknowledged;
|
||||
}
|
||||
|
||||
if (limit) {
|
||||
params.limit = limit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user