import type { Overview } from "../lib/overview";
import { ComingWithV2, Kpi, ScreenHead } from "../components/ui";
export function Jobs({ ov }: { ov: Overview | null }) {
const w = ov?.thisNode.workers;
return (
<>
<ScreenHead title="Jobs" sub="What this node runs, by source" />
<div className="grid grid-cols-3 gap-2.5">
<Kpi label="Busy workers" value={w ? `${w.busy} of ${w.running}` : "—"} sub={w?.draining ? `${w.draining} draining` : "this node"} />
<Kpi label="Requests 5 h" value={ov ? ov.thisNode.requests5h.toLocaleString("en-US") : "—"} />
<Kpi label="Requests 1 w" value={ov ? ov.thisNode.requests1w.toLocaleString("en-US") : "—"} />
</div>
<ComingWithV2 what="Live and finished jobs: Spaces batches, Environment guests, Hub serving, L'Atelier runs and test jobs." route="GET /v2/jobs" />
</>
);
}
export function Environments() {
return (
<>
<ScreenHead title="Environments" sub="Signed templates, on any node, over the mesh" />
<ComingWithV2 what="Launch Jupyter, code-server or SSH environments on your nodes or the mesh, and connect over the environment's own mesh peer." route="GET /v2/envs" />
</>
);
}
export function Squads() {
return (
<>
<ScreenHead title="Squads" sub="Trust groups this node lends to" />
<ComingWithV2 what="Every node is in the public squad by default. Trusted squads you join by invite appear here with the grants this node gives them." route="GET /v2/squads" />
</>
);
}