From 7fd72e2106a117e2c7e93de37369bfd530481ab8 Mon Sep 17 00:00:00 2001 From: 3970260761 <3970260761@qq.com> Date: Sat, 7 Nov 2026 23:26:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E7=8B=AC=E7=AB=8B=E4=BF=9D=E5=AD=98=E8=AF=8A=E6=96=AD=E9=87=8D?= =?UTF-8?q?=E7=BB=98=E5=90=8E=E8=87=AA=E5=8A=A8=E6=81=A2=E5=A4=8D=20v1.3.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/index.html b/public/index.html index 0bb65c5..c9df7ef 100644 --- a/public/index.html +++ b/public/index.html @@ -56,7 +56,7 @@ button.refresh{background:#20a53a;color:#fff;border:none;border-radius:3px;paddi
磁盘
网络
-v1.3.6 +v1.3.7 资享导航站 @@ -86,12 +86,14 @@ function fmtR(b){return fmtB(b)+'/s'} function esc(s){return String(s==null?'':s).replace(/&/g,'&').replace(/t.name.indexOf('CPU')===0);const oth=j.temps.filter(t=>t.name.indexOf('CPU')!==0);const chip=t=>{const c=t.value>=85?'#f00':(t.value>=70?'#ff9900':'#20a53a');return `${esc(t.name)} ${t.value}°C`};if(cpu.length)h+='
'+cpu.map(chip).join('')+'
';if(oth.length)h+='
'+oth.map(chip).join('')+'
'}if(j.fans&&j.fans.length){h+='
'+j.fans.map(f=>`🌀 ${esc(f.name)} ${f.value} RPM`).join('')+'
'}else{h+='
🌀 风扇转速:宿主未暴露(家用 NAS/主板多无此传感器,属正常)
'}if(j.note&&!j.temps.length)h+=`
${esc(j.note)}
`;el.innerHTML=h}catch(e){el.style.display='';el.innerHTML='
🌡️ 温度读取失败
'}} -async function cpuAdvise(){const el=document.getElementById('cpuadvise');const now=Date.now();if(now-lastAdvise<15000){if(el.innerHTML)el.style.display='';return;}lastAdvise=now;try{const r=await fetch('/api/cpu/advise');const j=await r.json();const col=j.level==='轻松'||j.level==='正常'?'#20a53a':(j.level==='偏高'?'#ff9900':'#f00');document.getElementById('cpuadvise').style.display='';document.getElementById('cpuadvise').innerHTML=`
📊 负载诊断:${j.level} (1分钟负载 ${j.load[0]} ÷ ${j.logical}核 = 单核 ${j.per_core})
${esc(j.verdict)}
如何更流畅:
${j.tips.map(t=>`
· ${esc(t)}
`).join('')}
会做两件事:① 把内存里暂存的数据写回硬盘(sync,防断电丢数据);② 回收系统缓存占用的内存(drop caches,只清缓存、不动正在运行的程序)。全程不重启、不杀进程,页面照常刷新。
`}catch(e){}} +async function cpuAdvise(){const el=document.getElementById('cpuadvise');const now=Date.now();if(now-lastAdvise<15000){if(el.innerHTML)el.style.display='';return;}lastAdvise=now;try{const r=await fetch('/api/cpu/advise');const j=await r.json();const col=j.level==='轻松'||j.level==='正常'?'#20a53a':(j.level==='偏高'?'#ff9900':'#f00');document.getElementById('cpuadvise').style.display='';document.getElementById('cpuadvise').innerHTML=`
📊 负载诊断:${j.level} (1分钟负载 ${j.load[0]} ÷ ${j.logical}核 = 单核 ${j.per_core})
${esc(j.verdict)}
如何更流畅:
${j.tips.map(t=>`
· ${esc(t)}
`).join('')}
会做两件事:① 把内存里暂存的数据写回硬盘(sync,防断电丢数据);② 回收系统缓存占用的内存(drop caches,只清缓存、不动正在运行的程序)。全程不重启、不杀进程,页面照常刷新。
`;restoreOptUI()}catch(e){}} async function kill(pid,name){if(!confirm('结束进程 '+name+' (PID '+pid+') ?'))return;const r=await fetch('/api/kill',{method:'POST',headers:{'Content-Type':'application/json'},body:JSON.stringify({pid})});const j=await r.json();alert(j.ok?'已发送结束信号':('失败: '+j.error));load(true)} function cmpVal(p,key){ if(key==='name')return String(p.name||'');