From 9849be2ab289592075304e146ffe288d113562e4 Mon Sep 17 00:00:00 2001 From: 3970260761 <3970260761@qq.com> Date: Sat, 7 Nov 2026 23:48:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=87=AA=E5=8A=A8=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E8=B5=B0=E6=8E=92=E5=BA=8F=E6=B8=B2=E6=9F=93=E7=82=B9=E6=8E=92?= =?UTF-8?q?=E5=BA=8F=E4=B8=8D=E5=86=8D=E8=A2=AB=E5=88=B7=E5=9B=9E=20v1.3.1?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/public/index.html b/public/index.html index 70db4b9..8eac098 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.9 +v1.3.10 资享导航站 @@ -156,7 +156,7 @@ document.getElementById('cpuinfo').innerHTML=`
${esc(I.model|| document.getElementById('sub').textContent=`共 ${j.total} 个进程,显示占用最高的前 ${j.items.length} 个(进程CPU为单进程占用,单核满=100%,16核满=1600%,进程之和÷16≈整机占用)`; cpuAdvise();cpuSensor(); renderHeader(); -B.innerHTML=j.items.map(p=>`${esc(p.name)}${p.cpu}${p.threads}${p.pid}${esc(p.desc)}${esc(p.user)}${p.status}`).join(''); +renderBody(); }else if(cur==='mem'){ S.innerHTML=`
内存占用
${j.percent}%
已用 / 总共
${fmtB(j.used)} / ${fmtB(j.total)}
可用 / Swap
${fmtB(j.available)} / ${fmtB(j.swap_used)}/${fmtB(j.swap_total)} (Swap ${j.swap_percent||0}%)
操作
`; const D=j.detail||{},H2=j.hw||{},DM=H2.dimms||[]; @@ -167,14 +167,14 @@ document.getElementById('meminfo').innerHTML=`
物理 ${fmtB(H +`
占用拆解:
${row('空闲 MemFree',fmtB(D.MemFree))+row('可用 MemAvailable',fmtB(D.MemAvailable))+row('缓冲 Buffers',fmtB(D.Buffers))+row('缓存 Cached',fmtB(D.Cached))+row('Swap缓存',fmtB(D.SwapCached))+row('匿名页 AnonPages',fmtB(D.AnonPages))+row('映射 Mapped',fmtB(D.Mapped))+row('共享 Shmem',fmtB(D.Shmem))+row('Slab',fmtB(D.Slab))+row('可回收',fmtB(D.SReclaimable))+row('不可回收',fmtB(D.SUnreclaim))+row('页表',fmtB(D.PageTables))+row('内核栈',fmtB(D.KernelStack))+row('已提交',fmtB(D.Committed_AS))+row('提交上限',fmtB(D.CommitLimit))+row('脏页',fmtB(D.Dirty))}
`; document.getElementById('sub').textContent=`按内存占用排序,前 ${j.items.length} 个进程`; renderHeader(); -B.innerHTML=j.items.map(p=>`${esc(p.name)}${fmtB(p.rss)}${fmtB(p.uss)}${fmtB(p.swap)}${p.pid}${esc(p.desc)}${esc(p.user)}${p.status}`).join(''); +renderBody(); }else if(cur==='disk'){ let tot=0,used=0;j.parts.forEach(p=>{tot+=p.total;used+=p.used}); const pct=tot?Math.round(used/tot*100):0; S.innerHTML=`
磁盘占用
${pct}%
已用 / 总共
${fmtB(used)} / ${fmtB(tot)}
读 / 写累计
${fmtB(j.io.read||0)} / ${fmtB(j.io.write||0)}
`; document.getElementById('sub').textContent=`${j.parts.length} 个挂载点,下表按 IO 占用排序`; renderHeader(); -B.innerHTML=j.items.map(p=>`${esc(p.name)}${fmtB(p.io_r)}${fmtB(p.io_w)}${p.pid}${esc(p.user)}${p.status}`).join(''); +renderBody(); document.getElementById('disks').innerHTML=j.parts.map(p=>`
${esc(p.mount)} ${esc(p.device)} ${esc(p.fstype)}
${fmtB(p.used)} / ${fmtB(p.total)} (${p.percent}%) · 可用 ${fmtB(p.free)}
`).join(''); const W=j.hw||{},DS=W.disks||[],AR=W.arrays||[],EX=W.extra||{}; const drow=(k,v)=>`${k} ${v}`; @@ -188,7 +188,7 @@ const up=j.nics.reduce((a,n)=>a+n.up,0),down=j.nics.reduce((a,n)=>a+n.down,0); S.innerHTML=`
上行速率
${fmtR(up)}
下行速率
${fmtR(down)}
累计接收
${fmtB(j.total_recv||0)}
累计发送
${fmtB(j.total_sent||0)}
连接数
${j.conns}
`; document.getElementById('sub').textContent=j.nics.map(n=>`${n.nic}: ↑${fmtR(n.up)} ↓${fmtR(n.down)}`).join(' · ')||'无网卡数据'; renderHeader(); -B.innerHTML=j.items.map(p=>`${esc(p.name)}${p.conns}${p.pid}${esc(p.desc)}${esc(p.user)}${p.status}`).join(''); +renderBody(); document.getElementById('netextra').innerHTML=`

TCP连接

${(j.tcp||[]).map(c=>``).join('')}
进程名本地地址远程地址地址族PID状态
${esc(c.name)}${esc(c.laddr)}${esc(c.raddr)}${esc(c.family)}${c.pid||''}${esc(c.status)}

侦听端口

${(j.listen||[]).map(c=>``).join('')}
进程名监听地址端口地址族防火墙PID协议
${esc(c.name)}${esc(c.laddr)}${c.port}${esc(c.family)}不放行${c.pid||''}${esc(c.proto)}
`; const NW=j.hw||{},NN=NW.nics||[]; const nrow=(k,v)=>`${k} ${v}`;