dashboard: 服务监控请求时间间隔

This commit is contained in:
naiba
2021-09-02 23:45:21 +08:00
parent 0ea21598e8
commit 446ab3b1b8
12 changed files with 119 additions and 50 deletions

View File

@@ -55,7 +55,8 @@ function showFormModal(modelSelector, formID, URL, getData) {
item.name === "RequestMethod" ||
item.name === "DisplayIndex" ||
item.name === "Type" ||
item.name === "Cover"
item.name === "Cover" ||
item.name === "Duration"
) {
obj[item.name] = parseInt(item.value);
} else {
@@ -218,6 +219,7 @@ function addOrEditMonitor(monitor) {
modal.find("input[name=ID]").val(monitor ? monitor.ID : null);
modal.find("input[name=Name]").val(monitor ? monitor.Name : null);
modal.find("input[name=Target]").val(monitor ? monitor.Target : null);
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=Cover]").val(monitor ? monitor.Cover : 0);
if (monitor && monitor.Notify) {

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

View File

@@ -24,6 +24,10 @@
<option value="3">TCP-Ping</option>
</select>
</div>
<div class="field">
<label>请求间隔</label>
<input type="number" name="Duration" placeholder="秒" />
</div>
<div class="field">
<label>覆盖范围</label>
<select name="Cover" class="ui fluid dropdown">

View File

@@ -18,6 +18,7 @@
<th>覆盖范围</th>
<th>特定服务器</th>
<th>类型</th>
<th>请求间隔</th>
<th>通知</th>
<th>管理</th>
</tr>
@@ -34,6 +35,7 @@
{{if eq $monitor.Type 1}}HTTP(S)/SSL证书 {{else if eq $monitor.Type
2}} ICMP Ping {{else}} TCP 端口 {{end}}
</td>
<td>{{$monitor.Duration}}秒</td>
<td>{{$monitor.Notify}}</td>
<td>
<div class="ui mini icon buttons">