feat: 添加/修改通知方式时可选择不发送测试信息
This commit is contained in:
parent
213b2ee2e3
commit
7d03da21f3
@ -395,6 +395,7 @@ type notificationForm struct {
|
||||
RequestHeader string
|
||||
RequestBody string
|
||||
VerifySSL string
|
||||
SkipCheck string
|
||||
}
|
||||
|
||||
func (ma *memberAPI) addOrEditNotification(c *gin.Context) {
|
||||
@ -416,7 +417,12 @@ func (ma *memberAPI) addOrEditNotification(c *gin.Context) {
|
||||
Notification: &n,
|
||||
Server: nil,
|
||||
}
|
||||
err = ns.Send("这是测试消息")
|
||||
// 勾选了跳过检查
|
||||
if nf.SkipCheck == "on" {
|
||||
err = nil
|
||||
} else {
|
||||
err = ns.Send("这是测试消息")
|
||||
}
|
||||
}
|
||||
if err == nil {
|
||||
// 保证Tag不为空
|
||||
|
@ -154,6 +154,7 @@ function addOrEditNotification(notification) {
|
||||
} else {
|
||||
modal.find(".ui.nf-ssl.checkbox").checkbox("set unchecked");
|
||||
}
|
||||
modal.find(".ui.nf-skip-check.checkbox").checkbox("set unchecked");
|
||||
showFormModal(
|
||||
".notification.modal",
|
||||
"#notificationForm",
|
||||
|
@ -44,6 +44,12 @@
|
||||
<label>验证SSL</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="field">
|
||||
<div class="ui nf-skip-check checkbox">
|
||||
<input name="SkipCheck" type="checkbox" tabindex="0" class="hidden">
|
||||
<label>不发送测试信息</label>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="actions">
|
||||
|
Loading…
Reference in New Issue
Block a user