mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-22 20:58:14 -05:00
update: 前端增加通知方式组相关选项
This commit is contained in:
parent
ab033f3b2e
commit
548d25c9a6
@ -114,6 +114,7 @@ function addOrEditAlertRule(rule) {
|
|||||||
modal.find("input[name=ID]").val(rule ? rule.ID : null);
|
modal.find("input[name=ID]").val(rule ? rule.ID : null);
|
||||||
modal.find("input[name=Name]").val(rule ? rule.Name : null);
|
modal.find("input[name=Name]").val(rule ? rule.Name : null);
|
||||||
modal.find("textarea[name=RulesRaw]").val(rule ? rule.RulesRaw : null);
|
modal.find("textarea[name=RulesRaw]").val(rule ? rule.RulesRaw : null);
|
||||||
|
modal.find("input[name=NotificationTag]").val(rule ? rule.NotificationTag : null);
|
||||||
if (rule && rule.Enable) {
|
if (rule && rule.Enable) {
|
||||||
modal.find(".ui.rule-enable.checkbox").checkbox("set checked");
|
modal.find(".ui.rule-enable.checkbox").checkbox("set checked");
|
||||||
} else {
|
} else {
|
||||||
@ -134,6 +135,7 @@ function addOrEditNotification(notification) {
|
|||||||
);
|
);
|
||||||
modal.find("input[name=ID]").val(notification ? notification.ID : null);
|
modal.find("input[name=ID]").val(notification ? notification.ID : null);
|
||||||
modal.find("input[name=Name]").val(notification ? notification.Name : null);
|
modal.find("input[name=Name]").val(notification ? notification.Name : null);
|
||||||
|
modal.find("input[name=Tag]").val(notification ? notification.Tag : null);
|
||||||
modal.find("input[name=URL]").val(notification ? notification.URL : null);
|
modal.find("input[name=URL]").val(notification ? notification.URL : null);
|
||||||
modal
|
modal
|
||||||
.find("textarea[name=RequestHeader]")
|
.find("textarea[name=RequestHeader]")
|
||||||
@ -225,6 +227,7 @@ function addOrEditMonitor(monitor) {
|
|||||||
modal.find("input[name=Duration]").val(monitor && monitor.Duration ? monitor.Duration : 30);
|
modal.find("input[name=Duration]").val(monitor && monitor.Duration ? monitor.Duration : 30);
|
||||||
modal.find("select[name=Type]").val(monitor ? monitor.Type : 1);
|
modal.find("select[name=Type]").val(monitor ? monitor.Type : 1);
|
||||||
modal.find("select[name=Cover]").val(monitor ? monitor.Cover : 0);
|
modal.find("select[name=Cover]").val(monitor ? monitor.Cover : 0);
|
||||||
|
modal.find("input[name=NotificationTag]").val(monitor ? monitor.NotificationTag : null);
|
||||||
if (monitor && monitor.Notify) {
|
if (monitor && monitor.Notify) {
|
||||||
modal.find(".ui.nb-notify.checkbox").checkbox("set checked");
|
modal.find(".ui.nb-notify.checkbox").checkbox("set checked");
|
||||||
} else {
|
} else {
|
||||||
@ -261,6 +264,7 @@ function addOrEditCron(cron) {
|
|||||||
);
|
);
|
||||||
modal.find("input[name=ID]").val(cron ? cron.ID : null);
|
modal.find("input[name=ID]").val(cron ? cron.ID : null);
|
||||||
modal.find("input[name=Name]").val(cron ? cron.Name : null);
|
modal.find("input[name=Name]").val(cron ? cron.Name : null);
|
||||||
|
modal.find("input[name=NotificationTag]").val(cron ? cron.NotificationTag : null);
|
||||||
modal.find("input[name=Scheduler]").val(cron ? cron.Scheduler : null);
|
modal.find("input[name=Scheduler]").val(cron ? cron.Scheduler : null);
|
||||||
modal.find("a.ui.label.visible").each((i, el) => {
|
modal.find("a.ui.label.visible").each((i, el) => {
|
||||||
el.remove();
|
el.remove();
|
||||||
|
8
resource/template/component/cron.html
vendored
8
resource/template/component/cron.html
vendored
@ -32,16 +32,16 @@
|
|||||||
<div class="menu"></div>
|
<div class="menu"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>通知方式组</label>
|
||||||
|
<input type="text" name="NotificationTag" placeholder="default">
|
||||||
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui push-successful checkbox">
|
<div class="ui push-successful checkbox">
|
||||||
<input name="PushSuccessful" type="checkbox" tabindex="0" class="hidden">
|
<input name="PushSuccessful" type="checkbox" tabindex="0" class="hidden">
|
||||||
<label>推送成功的消息</label>
|
<label>推送成功的消息</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
|
||||||
<label>通知方式组</label>
|
|
||||||
<input type="text" name="NotificationTag" placeholder="default">
|
|
||||||
</div>
|
|
||||||
</form>
|
</form>
|
||||||
<div class="ui warning message">
|
<div class="ui warning message">
|
||||||
<p>
|
<p>
|
||||||
|
4
resource/template/component/monitor.html
vendored
4
resource/template/component/monitor.html
vendored
@ -44,6 +44,10 @@
|
|||||||
<div class="menu"></div>
|
<div class="menu"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="field">
|
||||||
|
<label>通知方式组</label>
|
||||||
|
<input type="text" name="NotificationTag" placeholder="default" />
|
||||||
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui nb-notify checkbox">
|
<div class="ui nb-notify checkbox">
|
||||||
<input name="Notify" type="checkbox" tabindex="0" class="hidden" />
|
<input name="Notify" type="checkbox" tabindex="0" class="hidden" />
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>分组</label>
|
<label>分组</label>
|
||||||
<input type="text" name="Tag">
|
<input type="text" name="Tag" placeholder="default">
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>URL</label>
|
<label>URL</label>
|
||||||
|
2
resource/template/component/rule.html
vendored
2
resource/template/component/rule.html
vendored
@ -14,7 +14,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<label>通知方式组</label>
|
<label>通知方式组</label>
|
||||||
<input type="text" name="NotificationTag">
|
<input type="text" name="NotificationTag" placeholder="default">
|
||||||
</div>
|
</div>
|
||||||
<div class="field">
|
<div class="field">
|
||||||
<div class="ui rule-enable checkbox">
|
<div class="ui rule-enable checkbox">
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
<th>名称</th>
|
<th>名称</th>
|
||||||
<th>计划</th>
|
<th>计划</th>
|
||||||
<th>命令</th>
|
<th>命令</th>
|
||||||
<th>成功推送</th>
|
|
||||||
<th>通知方式组</th>
|
<th>通知方式组</th>
|
||||||
|
<th>成功推送</th>
|
||||||
<th>覆盖范围</th>
|
<th>覆盖范围</th>
|
||||||
<th>特定服务器</th>
|
<th>特定服务器</th>
|
||||||
<th>最后执行</th>
|
<th>最后执行</th>
|
||||||
@ -33,8 +33,8 @@
|
|||||||
<td>{{$cron.Name}}</td>
|
<td>{{$cron.Name}}</td>
|
||||||
<td>{{$cron.Scheduler}}</td>
|
<td>{{$cron.Scheduler}}</td>
|
||||||
<td>{{$cron.Command}}</td>
|
<td>{{$cron.Command}}</td>
|
||||||
|
<td>{{$cron.NotificationTag}}</td>
|
||||||
<td>{{$cron.PushSuccessful}}</td>
|
<td>{{$cron.PushSuccessful}}</td>
|
||||||
<td>{$cron.NotificationTag}</td>
|
|
||||||
<td>{{if eq $cron.Cover 0}}忽略所有{{else}}覆盖所有{{end}}</td>
|
<td>{{if eq $cron.Cover 0}}忽略所有{{else}}覆盖所有{{end}}</td>
|
||||||
<td>{{$cron.ServersRaw}}</td>
|
<td>{{$cron.ServersRaw}}</td>
|
||||||
<td>{{$cron.LastExecutedAt|tf}}</td>
|
<td>{{$cron.LastExecutedAt|tf}}</td>
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
<th>特定服务器</th>
|
<th>特定服务器</th>
|
||||||
<th>类型</th>
|
<th>类型</th>
|
||||||
<th>请求间隔</th>
|
<th>请求间隔</th>
|
||||||
|
<th>通知方式组</th>
|
||||||
<th>通知</th>
|
<th>通知</th>
|
||||||
<th>管理</th>
|
<th>管理</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -36,6 +37,7 @@
|
|||||||
2}} ICMP Ping {{else}} TCP 端口 {{end}}
|
2}} ICMP Ping {{else}} TCP 端口 {{end}}
|
||||||
</td>
|
</td>
|
||||||
<td>{{$monitor.Duration}}秒</td>
|
<td>{{$monitor.Duration}}秒</td>
|
||||||
|
<td>{{$monitor.NotificationTag}}</td>
|
||||||
<td>{{$monitor.Notify}}</td>
|
<td>{{$monitor.Notify}}</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="ui mini icon buttons">
|
<div class="ui mini icon buttons">
|
||||||
|
Loading…
Reference in New Issue
Block a user