From 3c4a002416d2ff5edea88ab91736971802ab1d53 Mon Sep 17 00:00:00 2001 From: Mike Zhou Date: Sat, 29 Jul 2023 13:57:32 +0800 Subject: [PATCH] feat(web): alert threshold UI support matches & contains (#1138) --- .../alert-setting.component.html | 42 +++++++++++++++---- web-app/src/assets/i18n/en-US.json | 4 ++ web-app/src/assets/i18n/zh-CN.json | 4 ++ web-app/src/assets/i18n/zh-TW.json | 4 ++ 4 files changed, 45 insertions(+), 9 deletions(-) diff --git a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html index ae6ae450f66..43befa6563c 100644 --- a/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html +++ b/web-app/src/app/routes/alert/alert-setting/alert-setting.component.html @@ -151,6 +151,7 @@ required name="target" id="target" + [nzShowSearch]="true" [nzOptions]="appHierarchies" [(ngModel)]="cascadeValues" (ngModelChange)="cascadeOnChange($event)" @@ -182,7 +183,10 @@ instance : {{ 'alert.setting.target.instance' | i18n }} - {{ 'alert.setting.operator' | i18n }} : equals(str1,str2), ==, <, <=, >, >=, !=, ( ), +, -, &&, || + + {{ 'alert.setting.operator' | i18n }} : equals(str1,str2), contains(str1,str2), exists(keyName), matches(str,regex), ==, + <, <=, >, >=, !=, ( ), +, -, &&, || + @@ -259,6 +263,26 @@ [nzValue]="'!equals'" [nzLabel]="'alert.setting.rule.operator.str-no-equals' | i18n" > + + + + diff --git a/web-app/src/assets/i18n/en-US.json b/web-app/src/assets/i18n/en-US.json index bc18df67bb1..ef02e381824 100644 --- a/web-app/src/assets/i18n/en-US.json +++ b/web-app/src/assets/i18n/en-US.json @@ -117,6 +117,10 @@ "alert.setting.rule.operator": "Operator", "alert.setting.rule.operator.str-equals": "equals", "alert.setting.rule.operator.str-no-equals": "not equals", + "alert.setting.rule.operator.str-contains": "contains", + "alert.setting.rule.operator.str-no-contains": "not contains", + "alert.setting.rule.operator.str-matches": "matches", + "alert.setting.rule.operator.str-no-matches": "not matches", "alert.setting.rule.string-value.place-holder": "Please input string", "alert.setting.rule.numeric-value.place-holder": "Please input numeric", "alert.setting.times": "Trigger Times", diff --git a/web-app/src/assets/i18n/zh-CN.json b/web-app/src/assets/i18n/zh-CN.json index 0d59dce2db1..52cbc80eb84 100644 --- a/web-app/src/assets/i18n/zh-CN.json +++ b/web-app/src/assets/i18n/zh-CN.json @@ -117,6 +117,10 @@ "alert.setting.rule.operator": "运算符", "alert.setting.rule.operator.str-equals": "等于", "alert.setting.rule.operator.str-no-equals": "不等于", + "alert.setting.rule.operator.str-contains": "包含", + "alert.setting.rule.operator.str-no-contains": "不包含", + "alert.setting.rule.operator.str-matches": "匹配", + "alert.setting.rule.operator.str-no-matches": "不匹配", "alert.setting.rule.string-value.place-holder": "请输入匹配字符串", "alert.setting.rule.numeric-value.place-holder": "请输入匹配数值", "alert.setting.times": "触发次数", diff --git a/web-app/src/assets/i18n/zh-TW.json b/web-app/src/assets/i18n/zh-TW.json index ded8b0e60ac..e5d31f2f06f 100644 --- a/web-app/src/assets/i18n/zh-TW.json +++ b/web-app/src/assets/i18n/zh-TW.json @@ -117,6 +117,10 @@ "alert.setting.rule.operator": "運算符", "alert.setting.rule.operator.str-equals": "等於", "alert.setting.rule.operator.str-no-equals": "不等於", + "alert.setting.rule.operator.str-contains": "包含", + "alert.setting.rule.operator.str-no-contains": "不包含", + "alert.setting.rule.operator.str-matches": "匹配", + "alert.setting.rule.operator.str-no-matches": "不匹配", "alert.setting.rule.string-value.place-holder": "請輸入匹配字符串", "alert.setting.rule.numeric-value.place-holder": "請輸入匹配數值", "alert.setting.times": "觸發次數",