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