From d9ddf83fd2dacc2a1d9c601e945f067eda30c325 Mon Sep 17 00:00:00 2001 From: Hermes Agent Date: Thu, 28 May 2026 20:43:07 +0800 Subject: [PATCH] Hide notification channel internal summaries --- static/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/index.html b/static/index.html index e54f50e..6e72515 100644 --- a/static/index.html +++ b/static/index.html @@ -16,7 +16,7 @@ document.querySelectorAll('.tab').forEach(b=>b.onclick=()=>{closeDrawer();docume function statusPill(s){let c=s||'unknown';return `${esc(c)}`} async function refresh(){DATA=await api('/api/status'); $('now').textContent='当前时间:'+DATA.now_text; let ps=DATA.proxies, up=ps.filter(x=>x.state.status==='up').length, down=ps.filter(x=>x.state.status==='down').length; $('mTotal').textContent=ps.length;$('mUp').textContent=up;$('mDown').textContent=down;$('mChan').textContent=(DATA.notifications.channels||[]).length; renderSettings(); renderProxies(); renderChannels(); renderLogs()} function renderProxies(){let cards='', list=''; for(const it of DATA.proxies){let p=it.proxy,s=it.state; let recent=(it.recent||[]).slice(0,5).map(r=>`${ts(r.ts)}${r.ok?'OK':'FAIL'}${r.latency_ms??'-'}ms${esc(r.error||'')}`).join(''); let color=s.status==='up'?'green':s.status==='down'?'pink':'blue'; let block=`

${esc(p.name||p.id)}

${esc(p.host)}:${esc(p.port)} → ${esc(p.target_host)}:${esc(p.target_port)} · ${esc(p.interval_seconds||DATA.settings.interval_seconds)}s
${statusPill(s.status)}
最后检测
${ts(s.last_ts)}
延迟
${s.latency_ms??'-'} ms
失败/成功
${s.fail_count} / ${s.ok_count}
错误
${esc(s.error||'-')}
${recent}
时间结果延迟错误
`; cards+=block; list+=block } $('proxyCards').innerHTML=cards||'
还没有节点,点击新增节点。
'; $('proxyList').innerHTML=list||'

暂无节点

'} -function channelSummary(c){let x=cfg(c); if(c.type==='bark')return x.server||'https://api.day.app'; if(c.type==='pushplus')return 'template='+(x.template||'txt')+(x.topic?' · topic='+x.topic:''); if(c.type==='autman')return (x.url||'') + (x.access_token?' · token已配置':' · token未配置'); return x.url||''} +function channelSummary(c){let x=cfg(c); if(c.type==='bark')return x.key?'Key 已配置':'Key 未配置'; if(c.type==='pushplus')return x.token?'Token 已配置':'Token 未配置'; if(c.type==='autman')return x.access_token?'Token 已配置':'Token 未配置'; return x.url||''} function renderSettings(){let s=DATA.settings||{}; if($('sTarget')){$('sTarget').textContent=(s.target_host||'-')+':'+(s.target_port||'-');$('sInterval').textContent=s.interval_seconds||'-';$('sTimeout').textContent=s.timeout_seconds||'-';$('sThreshold').textContent='失败 '+(s.fail_threshold||'-')+' / 恢复 '+(s.recover_threshold||'-')}} function renderChannels(){let html=''; for(const c of DATA.notifications.channels||[]){html+=`

${esc(c.name)}

${esc(c.type)}${c.enabled?'启用':'停用'}
${esc(channelSummary(c))}
`} $('channelList').innerHTML=html||'

暂无通知渠道

'} function renderLogs(){ $('events').innerHTML=(DATA.events||[]).map(e=>`${ts(e.ts)}${esc(e.proxy_id)}${esc(e.old_status)} → ${esc(e.new_status)}${esc(e.message)}`).join(''); $('notifLogs').innerHTML=(DATA.notification_logs||[]).map(n=>`${ts(n.ts)}${esc(n.channel_name)}${n.ok?'OK':'FAIL'}${esc(n.title)}`).join('')}