前端更新: 匹配新的报警规则设置页面

This commit is contained in:
Akkia 2022-09-13 04:02:34 +08:00
parent 32d15e116e
commit 4f26f36c8e
No known key found for this signature in database
GPG Key ID: DABE9A4AB2DD7EF3
4 changed files with 20 additions and 0 deletions

View File

@ -148,6 +148,15 @@ other = "添加报警规则"
[Rules]
other = "规则"
[NotificationTriggerMode]
other = "通知触发模式"
[ModeAlwaysTrigger]
other = "始终触发"
[ModeOnetimeTrigger]
other = "单次触发"
[Enable]
other = "启用"

View File

@ -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");

View File

@ -16,6 +16,13 @@
<label>{{tr "NotificationMethodGroup"}}</label>
<input type="text" name="NotificationTag" placeholder="default">
</div>
<div class="field">
<label>{{tr "NotificationTriggerMode"}}</label>
<select name="TriggerMode" class="ui fluid dropdown">
<option value="0">{{tr "ModeAlwaysTrigger"}}</option>
<option value="1">{{tr "ModeOnetimeTrigger"}}</option>
</select>
</div>
<div class="field">
<div class="ui rule-enable checkbox">
<input name="Enable" type="checkbox" tabindex="0" class="hidden">

View File

@ -58,6 +58,7 @@
<th>ID</th>
<th>{{tr "Name"}}</th>
<th>{{tr "NotificationMethodGroup"}}</th>
<th>{{tr "NotificationTriggerMode"}}</th>
<th>{{tr "Rules"}}</th>
<th>{{tr "Enable"}}</th>
<th>{{tr "Administration"}}</th>
@ -69,6 +70,7 @@
<td>{{$rule.ID}}</td>
<td>{{$rule.Name}}</td>
<td>{{$rule.NotificationTag}}</td>
<td>{{if eq $rule.TriggerMode 0}}{{tr "ModeAlwaysTrigger"}}{{else}}{{tr "ModeOnetimeTrigger"}}{{end}}
<td>{{$rule.RulesRaw}}</td>
<td>{{$rule.Enable}}</td>
<td>