From 4f26f36c8ebcb73e06caae7d1b9bb62c89f6321a Mon Sep 17 00:00:00 2001 From: Akkia Date: Tue, 13 Sep 2022 04:02:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=E6=9B=B4=E6=96=B0:=20?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E6=96=B0=E7=9A=84=E6=8A=A5=E8=AD=A6=E8=A7=84?= =?UTF-8?q?=E5=88=99=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resource/l10n/zh-CN.toml | 9 +++++++++ resource/static/main.js | 2 ++ resource/template/component/rule.html | 7 +++++++ resource/template/dashboard-default/notification.html | 2 ++ 4 files changed, 20 insertions(+) diff --git a/resource/l10n/zh-CN.toml b/resource/l10n/zh-CN.toml index d6d434f..ce842f0 100644 --- a/resource/l10n/zh-CN.toml +++ b/resource/l10n/zh-CN.toml @@ -148,6 +148,15 @@ other = "添加报警规则" [Rules] other = "规则" +[NotificationTriggerMode] +other = "通知触发模式" + +[ModeAlwaysTrigger] +other = "始终触发" + +[ModeOnetimeTrigger] +other = "单次触发" + [Enable] other = "启用" diff --git a/resource/static/main.js b/resource/static/main.js index d7da66e..581ae5d 100644 --- a/resource/static/main.js +++ b/resource/static/main.js @@ -69,6 +69,7 @@ function showFormModal(modelSelector, formID, URL, getData) { item.name === "ID" || item.name === "RequestType" || item.name === "RequestMethod" || + item.name === "TriggerMode" || item.name === "DisplayIndex" || item.name === "Type" || item.name === "Cover" || @@ -130,6 +131,7 @@ function addOrEditAlertRule(rule) { modal.find("input[name=ID]").val(rule ? rule.ID : null); modal.find("input[name=Name]").val(rule ? rule.Name : null); modal.find("textarea[name=RulesRaw]").val(rule ? rule.RulesRaw : null); + modal.find("select[name=TriggerMode]").val(rule ? rule.TriggerMode : 0); modal.find("input[name=NotificationTag]").val(rule ? rule.NotificationTag : null); if (rule && rule.Enable) { modal.find(".ui.rule-enable.checkbox").checkbox("set checked"); diff --git a/resource/template/component/rule.html b/resource/template/component/rule.html index ca49976..c0f79d8 100644 --- a/resource/template/component/rule.html +++ b/resource/template/component/rule.html @@ -16,6 +16,13 @@ +
+ + +
diff --git a/resource/template/dashboard-default/notification.html b/resource/template/dashboard-default/notification.html index 17cdc97..9c331a2 100644 --- a/resource/template/dashboard-default/notification.html +++ b/resource/template/dashboard-default/notification.html @@ -58,6 +58,7 @@ ID {{tr "Name"}} {{tr "NotificationMethodGroup"}} + {{tr "NotificationTriggerMode"}} {{tr "Rules"}} {{tr "Enable"}} {{tr "Administration"}} @@ -69,6 +70,7 @@ {{$rule.ID}} {{$rule.Name}} {{$rule.NotificationTag}} + {{if eq $rule.TriggerMode 0}}{{tr "ModeAlwaysTrigger"}}{{else}}{{tr "ModeOnetimeTrigger"}}{{end}} {{$rule.RulesRaw}} {{$rule.Enable}}