🐛 修复无法编辑已创建服务监控

This commit is contained in:
naiba
2021-04-22 22:18:55 +08:00
parent 585cf538d0
commit b69b069f27
6 changed files with 15 additions and 15 deletions

View File

@@ -201,8 +201,8 @@ function addOrEditMonitor(monitor) {
}
var servers;
if (monitor) {
servers = monitor.SkipServersRaw || "[]";
const serverList = JSON.parse(servers);
servers = monitor.SkipServersRaw;
const serverList = JSON.parse(servers || "[]");
const node = modal.find("i.dropdown.icon");
for (let i = 0; i < serverList.length; i++) {
node.after(
@@ -237,7 +237,7 @@ function addOrEditCron(cron) {
var servers;
if (cron) {
servers = cron.ServersRaw;
const serverList = JSON.parse(servers);
const serverList = JSON.parse(servers || "[]");
const node = modal.find("i.dropdown.icon");
for (let i = 0; i < serverList.length; i++) {
node.after(

View File

@@ -9,7 +9,7 @@
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.min.js"></script>
<script src="/static/main.js?v202104222126"></script>
<script src="/static/main.js?v202104222216"></script>
</body>
</html>

View File

@@ -1,6 +1,5 @@
{{define "dashboard/monitor"}}
{{template "common/header" .}}
{{template "common/menu" .}}
{{define "dashboard/monitor"}} {{template "common/header" .}} {{template
"common/menu" .}}
<div class="nb-container">
<div class="ui container">
<div class="ui grid">
@@ -18,10 +17,10 @@
<tr>
<th>ID</th>
<th>名称</th>
<th>通知</th>
<th>目标</th>
<th>类型</th>
<th>跳过的服务器</th>
<th>类型</th>
<th>通知</th>
<th>管理</th>
</tr>
</thead>
@@ -30,13 +29,13 @@
<tr>
<td>{{$monitor.ID}}</td>
<td>{{$monitor.Name}}</td>
<td>{{$monitor.Notify}}</td>
<td>{{$monitor.Target}}</td>
<td>{{$monitor.SkipServersRaw}}</td>
<td>
{{if eq $monitor.Type 1}}HTTP(S)/SSL证书 {{else if eq $monitor.Type
2}} ICMP Ping {{else}} TCP 端口 {{end}}
</td>
<td>{{$monitor.SkipServersRaw}}</td>
<td>{{$monitor.Notify}}</td>
<td>
<div class="ui mini icon buttons">
<button
@@ -59,8 +58,7 @@
</table>
</div>
</div>
{{template "component/monitor"}}
{{template "common/footer" .}}
{{template "component/monitor"}} {{template "common/footer" .}}
<script>
$(".checkbox").checkbox();
</script>