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=>`
| 时间 | 结果 | 延迟 | 错误 |
|---|
暂无节点
'} -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+=`暂无通知渠道
'} function renderLogs(){ $('events').innerHTML=(DATA.events||[]).map(e=>`