Processes tab: whole page scrolls, tools + column header pinned together, detail sheet sticks to the bottom, metrics boxes collapsible
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
b802dcf313
commit
bd475eaafd
+9
-5
@@ -46,6 +46,7 @@ export default function Procs() {
|
||||
const [mine, setMine] = useState(false)
|
||||
const [sel, setSel] = useState<number | null>(null)
|
||||
const [paused, setPaused] = useState(false)
|
||||
const [showTop, setShowTop] = useState<boolean>(() => localStorage.getItem('hamlab.procs.top') !== '0')
|
||||
const [interval, setIntervalMs] = useState<number>(() => Number(localStorage.getItem('hamlab.procs.interval')) || 2000)
|
||||
|
||||
const load = useCallback(async () => {
|
||||
@@ -84,7 +85,7 @@ export default function Procs() {
|
||||
|
||||
return (
|
||||
<div className="procs-page">
|
||||
<div className="procs-top">
|
||||
{showTop && <div className="procs-top">
|
||||
<Box title="cpu" right={`${t.cpu_model ?? ''}${t.cpu_mhz ? ` · ${(t.cpu_mhz / 1000).toFixed(2)} GHz` : ''}${t.cpu_temp ? ` · ${t.cpu_temp.toFixed(0)}°C` : ''}`}>
|
||||
<div className="cpu-total">
|
||||
<Graph values={t.cpu_hist} />
|
||||
@@ -121,8 +122,10 @@ export default function Procs() {
|
||||
))}
|
||||
{t.net.filter((n) => n.up).length === 0 && <div className="muted">no interfaces up</div>}
|
||||
</Box>
|
||||
</div>
|
||||
</div>}
|
||||
<div className="procs-sticky">
|
||||
<div className="procs-tools">
|
||||
<button className={'chip' + (showTop ? ' on' : '')} title="show or hide the cpu/mem/net boxes" onClick={() => { setShowTop(!showTop); localStorage.setItem('hamlab.procs.top', showTop ? '0' : '1') }}>{showTop ? 'metrics ▴' : 'metrics ▾'}</button>
|
||||
<input placeholder="filter name, command, user, pid" value={q} onChange={(e) => setQ(e.target.value)} />
|
||||
<button className={'chip' + (mine ? ' on' : '')} onClick={() => setMine(!mine)}>hide root</button>
|
||||
<button className={'chip' + (paused ? ' on' : '')} onClick={() => setPaused(!paused)}>{paused ? 'paused' : 'live'}</button>
|
||||
@@ -134,10 +137,11 @@ export default function Procs() {
|
||||
<span className="muted small">{rows.length} shown</span>
|
||||
</div>
|
||||
|
||||
<div className="prow phead">
|
||||
{head('pid', 'PID', 'num')}{head('user', 'User')}{head('name', 'Program')}{head('cpu', 'CPU %', 'num')}{head('rss', 'Memory', 'num')}{head('cpu_time', 'CPU time', 'num')}{head('started', 'Started', 'num')}
|
||||
</div>
|
||||
</div>
|
||||
<div className="ptable">
|
||||
<div className="prow phead">
|
||||
{head('pid', 'PID', 'num')}{head('user', 'User')}{head('name', 'Program')}{head('cpu', 'CPU %', 'num')}{head('rss', 'Memory', 'num')}{head('cpu_time', 'CPU time', 'num')}{head('started', 'Started', 'num')}
|
||||
</div>
|
||||
{rows.map((p) => (
|
||||
<div key={p.pid} className={'prow' + (p.pid === sel ? ' active' : '') + (p.state === 'Z' ? ' zombie' : p.state === 'R' ? ' running' : '')} onClick={() => setSel(p.pid === sel ? null : p.pid)} title={p.cmd || p.name}>
|
||||
<span className="num muted">{p.pid}</span>
|
||||
|
||||
Reference in New Issue
Block a user