mirror of
https://github.com/Niko1221/Strata.git
synced 2026-11-07 18:35:04 -10:00
Monitor: the saved screenshot starts with the Strata logo alone, without the Monitor headline
This commit is contained in:
1 parent
7f7bfa962b
commit
b3348da493
2 files changed
+18
-1
No files matched your search
@@ -151,7 +151,7 @@ function LegacyMonitorScreen({ native }: {
|
||||
const multipleScope = selection === 'all' && (runtime?.instances.length ?? 0) > 1;
|
||||
const chooseInstance = (id: string) => { setInstanceSelection(id); setGpuSelection(id !== 'all' && (runtime?.instances.find(instance => instance.id === id)?.gpuIds.length ?? 0) > 0 ? 'assigned' : 'all'); };
|
||||
const overview = <div className="stack stack--lg monitor-capture monitor-dashboard" ref={snapshotRef}>
|
||||
{tr(frozen ? <header className="section-toolbar"><div><div className="snapshot__brand-title"><Brand variant="lockup" height={24} decorative/><h1 className="h2">{tr("Monitor")}</h1></div><p className="small muted">{tr(frozen.modelLabel)} · {tr(frozen.time)}</p></div></header> : null)}
|
||||
{tr(frozen ? <header className="section-toolbar"><div><div className="snapshot__brand-title"><Brand variant="lockup" height={24} decorative/></div><p className="small muted">{tr(frozen.modelLabel)} · {tr(frozen.time)}</p></div></header> : null)}
|
||||
{tr(multipleModels ? <section className="st-card"><h2 className="h4">{tr("Model performance")}</h2><div className="st-tablewrap"><table className="st-table native-performance-table"><thead><tr><th>{tr("Model / device")}</th><th>{tr("Generating tok/s")}</th><th>{tr("Reading tok/s")}</th><th>{tr("State")}</th><th>{tr("Active / queued")}</th></tr></thead><tbody>{tr(runtime?.instances.map(i => { const recent = (data.requests ?? []).find(r => r.instanceId === i.id); const writing = i.phase === 'generating' || i.phase === 'thinking', reading = i.phase === 'reading'; return <tr key={i.id}><td><button className="text-btn strong" onClick={() => chooseInstance(i.id)}>{tr(instanceLabel(i))}</button><small>{tr(deviceLabel(i.gpuIds, inventory))}</small></td><td>{tr(number(writing ? i.outputTps : recent?.tps, 1))}<small>{tr(writing ? 'Now' : recent ? 'Last request' : 'No request yet')}</small></td><td>{tr(number(reading ? i.promptTps : recent?.promptTps, 0))}<small>{tr(reading ? 'Now' : recent ? 'Last request' : 'No request yet')}</small></td><td>{tr(i.phase)}{tr(runtime.mode === 'simulated' ? <small>{tr("Illustrative")}</small> : null)}</td><td>{tr(number(i.active))} / {tr(number(i.queued))}</td></tr>; }))}</tbody></table></div></section> : null)}
|
||||
{tr(multipleModels ? <p className="xs muted monitor-scope-note">{tr(selectedInstance ? selectedInstance.gpuIds.length ? 'Requests, context and speed are scoped to this model. GPU readings include all work on the selected devices.' : 'CPU-only model. Requests and context are scoped to this model; system metrics are shared host measurements.' : 'Select a model for its context and speed. GPU readings and system RAM are shared host measurements.')}</p> : null)}
|
||||
<section className="st-card monitor-state" aria-label={tr("Model state")} data-snapshot-skip>
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
// The saved Monitor screenshot starts with the Strata logo alone (no "Monitor" headline); the live Monitor page keeps its title.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFile } from 'node:fs/promises';
|
||||
|
||||
const read = path => readFile(new URL(path, import.meta.url), 'utf8').then(s => s.replace(/\r\n/g, '\n'));
|
||||
|
||||
test('the exported Monitor picture has the logo and no "Monitor" headline; the page itself keeps its title', async () => {
|
||||
const source = await read('../src/screens/Monitor.tsx');
|
||||
const header = /\{tr\(frozen \? <header className="section-toolbar">(.*?)<\/header> : null\)\}/s.exec(source)?.[1];
|
||||
assert.ok(header, 'the picture has its own header (it only exists while the picture is taken)');
|
||||
assert.match(header, /<Brand variant="lockup"/);
|
||||
assert.doesNotMatch(header, /<h1/);
|
||||
assert.doesNotMatch(header, /tr\("Monitor"\)/);
|
||||
assert.match(header, /frozen\.modelLabel/, 'the model and time line stays');
|
||||
assert.match(source, /<Screen width="wide" plainHeader title=\{tr\("Monitor"\)\}/, 'the live page still says Monitor');
|
||||
});
|
||||
Reference in new issue
Block a user