实现连通性变化发送通知功能

This commit is contained in:
刘祥超
2021-09-18 14:22:01 +08:00
parent 7e5b980600
commit dbe6435809
4 changed files with 33 additions and 1 deletions

View File

@@ -3,4 +3,5 @@
<!--<menu-item href="/clusters/monitors/logs" code="log">日志</menu-item>-->
<menu-item href="/clusters/monitors/reporters" code="reporter">终端</menu-item>
<menu-item href="/clusters/monitors/groups" code="group">分组</menu-item>
<menu-item href="/clusters/monitors/settings" code="setting">设置</menu-item>
</first-menu>

View File

@@ -31,7 +31,9 @@
</thead>
<tr v-for="result in results">
<td>{{result.typeName}}</td>
<td>{{result.targetDesc}}</td>
<td>{{result.targetDesc}}
<span v-if="result.type == 'ipAddr'"><link-icon :href="'/clusters/ip-addrs/addr?addrId=' + result.targetId"></link-icon></span>
</td>
<td>
<span :class="result.color">{{result.levelName}}</span>
</td>

View File

@@ -0,0 +1,26 @@
{$layout}
{$template "../menu"}
<form class="ui form" data-tea-action="$" data-tea-success="success">
<csrf-token></csrf-token>
<table class="ui table definition selectable">
<tr>
<td class="title">提醒连通性阈值</td>
<td>
<div class="ui input right labeled">
<input type="text" maxlength="4" size="2" name="minNotifyConnectivity" v-model="setting.minNotifyConnectivity"/>
<span class="ui label">%</span>
</div>
<p class="comment">取值0到100当单个被监控对象连通性低于此值时不包含此值发送消息提醒。<span v-if="setting.minNotifyConnectivity == 100">100%表示只要有任何访问异常的情形都会发送提醒。</span></p>
</td>
</tr>
<tr>
<td>通知URL</td>
<td>
<input type="text" name="notifyWebHookURL" maxlength="1000" v-model="setting.notifyWebHookURL" placeholder="https://..."/>
<p class="comment">当达到连通性阈值时将监控对象的信息发送到此URL上。</p>
</td>
</tr>
</table>
<submit-btn></submit-btn>
</form>

View File

@@ -0,0 +1,3 @@
Tea.context(function () {
this.success = NotifyReloadSuccess("保存成功")
})