🚸 可以使指定服务器不参与服务监控

This commit is contained in:
naiba
2021-04-22 21:53:31 +08:00
parent 6f565ba022
commit 585cf538d0
10 changed files with 419 additions and 292 deletions

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?v202104172324"></script>
<script src="/static/main.js?v202104222126"></script>
</body>
</html>

View File

@@ -24,6 +24,15 @@
<option value="3">TCP-Ping</option>
</select>
</div>
<div class="field">
<label>不通过下列服务器请求</label>
<div class="ui fluid multiple servers search selection dropdown">
<input type="hidden" name="SkipServersRaw" />
<i class="dropdown icon"></i>
<div class="default text">输入ID/名称以搜索</div>
<div class="menu"></div>
</div>
</div>
<div class="field">
<div class="ui nb-notify checkbox">
<input name="Notify" type="checkbox" tabindex="0" class="hidden" />

View File

@@ -2,60 +2,66 @@
{{template "common/header" .}}
{{template "common/menu" .}}
<div class="nb-container">
<div class="ui container">
<div class="ui grid">
<div class="right floated right aligned twelve wide column">
<button class="ui right labeled positive icon button" onclick="addOrEditMonitor()"><i
class="add icon"></i> 添加监控
</button>
</div>
</div>
<table class="ui very basic table">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>通知</th>
<th>目标</th>
<th>类型</th>
<th>管理</th>
</tr>
</thead>
<tbody>
{{range $monitor := .Monitors}}
<tr>
<td>{{$monitor.ID}}</td>
<td>{{$monitor.Name}}</td>
<td>{{$monitor.Notify}}</td>
<td>{{$monitor.Target}}</td>
<td>
{{if eq $monitor.Type 1}}HTTP(S)/SSL证书
{{else if eq $monitor.Type 2}}
ICMP Ping
{{else}}
TCP 端口
{{end}}
</td>
<td>
<div class="ui mini icon buttons">
<button class="ui button" onclick="addOrEditMonitor({{$monitor}})">
<i class="edit icon"></i>
</button>
<button class="ui button"
onclick="showConfirm('删除监控','确认删除此监控?',deleteRequest,'/api/monitor/'+{{$monitor.ID}})">
<i class="trash alternate outline icon"></i>
</button>
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
<div class="ui container">
<div class="ui grid">
<div class="right floated right aligned twelve wide column">
<button
class="ui right labeled positive icon button"
onclick="addOrEditMonitor()"
>
<i class="add icon"></i> 添加监控
</button>
</div>
</div>
<table class="ui very basic table">
<thead>
<tr>
<th>ID</th>
<th>名称</th>
<th>通知</th>
<th>目标</th>
<th>类型</th>
<th>跳过的服务器</th>
<th>管理</th>
</tr>
</thead>
<tbody>
{{range $monitor := .Monitors}}
<tr>
<td>{{$monitor.ID}}</td>
<td>{{$monitor.Name}}</td>
<td>{{$monitor.Notify}}</td>
<td>{{$monitor.Target}}</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>
<div class="ui mini icon buttons">
<button
class="ui button"
onclick="addOrEditMonitor({{$monitor}})"
>
<i class="edit icon"></i>
</button>
<button
class="ui button"
onclick="showConfirm('删除监控','确认删除此监控?',deleteRequest,'/api/monitor/'+{{$monitor.ID}})"
>
<i class="trash alternate outline icon"></i>
</button>
</div>
</td>
</tr>
{{end}}
</tbody>
</table>
</div>
</div>
{{template "component/monitor"}}
{{template "common/footer" .}}
<script>
$('.checkbox').checkbox()
$(".checkbox").checkbox();
</script>
{{end}}
{{end}}