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