From c385bce15727381eff5e2aca3636793150f2d7bc Mon Sep 17 00:00:00 2001 From: tomsun28 Date: Fri, 13 Oct 2023 14:53:37 +0800 Subject: [PATCH] bugfix threshold availability automatically carries threshold parameters (#1285) --- .../src/main/resources/define/app-windows.yml | 21 ------------------- .../alert-setting/alert-setting.component.ts | 13 ++++++------ 2 files changed, 7 insertions(+), 27 deletions(-) diff --git a/manager/src/main/resources/define/app-windows.yml b/manager/src/main/resources/define/app-windows.yml index 53b03631a5d..39df21113db 100644 --- a/manager/src/main/resources/define/app-windows.yml +++ b/manager/src/main/resources/define/app-windows.yml @@ -277,27 +277,6 @@ metrics: hrStorageUsed: 1.3.6.1.2.1.25.2.3.1.6 hrStorageAllocationUnits: 1.3.6.1.2.1.25.2.3.1.4 - - name: disk - priority: 2 - fields: - - field: dskPath - type: 1 - - field: dskDevice - type: 1 - - field: dskTotal - type: 1 - protocol: snmp - snmp: - host: ^_^host^_^ - port: ^_^port^_^ - timeout: ^_^timeout^_^ - community: ^_^community^_^ - version: ^_^version^_^ - oids: - dskPath: 1.3.6.1.4.1.2021.9.1.2 - dskDevice: 1.3.6.1.4.1.2021.9.1.3 - dskTotal: 1.3.6.1.4.1.2021.9.1.6 - - name: network priority: 3 fields: diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts index 5c95ac83368..30507ebebef 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.ts @@ -429,14 +429,15 @@ export class AlertSettingComponent implements OnInit { this.define.metric = this.cascadeValues[1]; if (this.cascadeValues.length == 3) { this.define.field = this.cascadeValues[2]; + if (!this.isExpr) { + let expr = this.calculateAlertRuleExpr(); + if (expr != '') { + this.define.expr = expr; + } + } } else { this.define.expr = ''; - } - if (!this.isExpr) { - let expr = this.calculateAlertRuleExpr(); - if (expr != '') { - this.define.expr = expr; - } + this.define.field = ''; } if (this.isManageModalAdd) { const modalOk$ = this.alertDefineSvc