diff --git a/static/admin/notify.js b/static/admin/notify.js index 96ea5b2..12985ab 100644 --- a/static/admin/notify.js +++ b/static/admin/notify.js @@ -107,8 +107,11 @@ function openNotifyModal(id){ const box = document.getElementById('notify-modal-box'); if(!box) return; box.innerHTML = - '
' - + (id ? '编辑 Webhook' : '新建 Webhook') + '
' + '
' + + '
' + + (id ? '编辑 Webhook' : '新建 Webhook') + '
' + + '' + + '
' + '
' + '
' + '
' @@ -136,7 +139,7 @@ function openNotifyModal(id){ + '带 ★ 的是建议开启的。也可以直接写通配(如 task.*)——在下面的芯片框里加。
' + '
' + '' - + '' + '
' + '
点「预览请求体」看真实会发出去的内容与字节数。
' + + '
' + // 底部操作栏(缺了它就只能靠刷新页面逃出去) + + '
' + + '' + + '' + + '' + + 'Esc 或点空白处也能关' + '
'; box.querySelector('#nf-body').value = h.body_template || ''; renderEventTree(checked); @@ -157,12 +167,18 @@ function openNotifyModal(id){ function _notifyFormatChanged(){ const f = (document.getElementById('nf-format') || {}).value; + // 只有「通用 JSON」才需要自定义请求体模板 const bodyWrap = document.getElementById('nf-body-wrap'); if(bodyWrap) bodyWrap.style.display = (f === 'json') ? 'block' : 'none'; - const patWrap = document.getElementById('nf-pattern-wrap'); - if(patWrap) patWrap.style.display = (f === 'json' || true) ? 'block' : 'none'; } +// Esc 关闭弹窗(点空白处关闭在 overlay 的 onclick 上) +document.addEventListener('keydown', function(ev){ + if(ev.key !== 'Escape') return; + const ov = document.getElementById('notify-modal-overlay'); + if(ov && ov.style.display !== 'none') closeNotifyModal(); +}); + function renderEventTree(checked){ const box = document.getElementById('nf-events'); if(!box) return; diff --git a/templates/admin/monitor.html b/templates/admin/monitor.html index 0c46a84..6cfb923 100644 --- a/templates/admin/monitor.html +++ b/templates/admin/monitor.html @@ -1169,9 +1169,10 @@ body{background:var(--bg);font-family:var(--body);color:var(--text);font-size:14 启用通知 默认聚合 - 秒 · - 限流 条/分 + 秒 · + 限流 条/分 @@ -1193,7 +1194,8 @@ body{background:var(--bg);font-family:var(--body);color:var(--text);font-size:14 -