treefmt: apply prettier
Pure `nix fmt` output from the commit before this one — no hand edits. 203 files: 52 md, 42 tsx, 32 js, 32 css, 21 ts, 13 html, 8 json, 3 mjs. Reproduce with `nix develop -c nix fmt` on the parent commit; the result should be byte-identical to this tree. None of the 13 `.prettierignore` entries appears here — verified by intersecting the changed-file list against the ignore file, with a control proving the intersection finds a match when one exists.
This commit is contained in:
parent
5d24bedd60
commit
39b95c2ede
203 changed files with 10090 additions and 6085 deletions
|
|
@ -28,12 +28,19 @@
|
|||
// `refreshToken` to force a refetch. No mount wrapper: `render` is
|
||||
// already the re-render/diff entry point.
|
||||
|
||||
import { useState, useEffect } from 'preact/hooks';
|
||||
import { useState, useEffect } from "preact/hooks";
|
||||
|
||||
// Mirrors `hive_jobq_wire::StateSchema` — only the subset this banner
|
||||
// cares about, not the full union `JobqGraph.tsx` mirrors, since a
|
||||
// rollup row's `state` is read by exact string match, not rendered.
|
||||
type NodeState = 'Pending' | 'Running' | 'Finishing' | 'Done' | 'Failed' | 'Cancelled' | 'Skipped';
|
||||
type NodeState =
|
||||
| "Pending"
|
||||
| "Running"
|
||||
| "Finishing"
|
||||
| "Done"
|
||||
| "Failed"
|
||||
| "Cancelled"
|
||||
| "Skipped";
|
||||
|
||||
interface StateCount {
|
||||
state: NodeState;
|
||||
|
|
@ -47,7 +54,11 @@ export interface JobqRollupProps {
|
|||
refreshToken?: number;
|
||||
}
|
||||
|
||||
export function JobqRollup({ endpoint, queueHref, refreshToken = 0 }: JobqRollupProps) {
|
||||
export function JobqRollup({
|
||||
endpoint,
|
||||
queueHref,
|
||||
refreshToken = 0,
|
||||
}: JobqRollupProps) {
|
||||
const [counts, setCounts] = useState<StateCount[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -66,12 +77,16 @@ export function JobqRollup({ endpoint, queueHref, refreshToken = 0 }: JobqRollup
|
|||
// ignore — keep the previous snapshot
|
||||
}
|
||||
})();
|
||||
return () => { cancelled = true; };
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
}, [endpoint, refreshToken]);
|
||||
|
||||
const byState = new Map(counts.map((c) => [c.state, c]));
|
||||
const running = (byState.get('Running')?.roots ?? 0) + (byState.get('Finishing')?.roots ?? 0);
|
||||
const queued = byState.get('Pending')?.roots ?? 0;
|
||||
const running =
|
||||
(byState.get("Running")?.roots ?? 0) +
|
||||
(byState.get("Finishing")?.roots ?? 0);
|
||||
const queued = byState.get("Pending")?.roots ?? 0;
|
||||
if (!running && !queued) return null;
|
||||
|
||||
const parts: string[] = [];
|
||||
|
|
@ -80,10 +95,12 @@ export function JobqRollup({ endpoint, queueHref, refreshToken = 0 }: JobqRollup
|
|||
|
||||
return (
|
||||
<div class="jqr-summary">
|
||||
<span class="jqr-glyph spinner">◐</span>{' '}
|
||||
<strong>build queue</strong> — {parts.join(' · ')}{' '}
|
||||
<span class="jqr-glyph spinner">◐</span> <strong>build queue</strong> —{" "}
|
||||
{parts.join(" · ")}{" "}
|
||||
{queueHref && (
|
||||
<a class="jqr-link" href={queueHref}>view queue →</a>
|
||||
<a class="jqr-link" href={queueHref}>
|
||||
view queue →
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@
|
|||
margin-bottom: 0.6em;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.jqr-summary strong { color: var(--amber); }
|
||||
.jqr-summary strong {
|
||||
color: var(--amber);
|
||||
}
|
||||
.jqr-link {
|
||||
margin-left: auto;
|
||||
color: var(--amber);
|
||||
|
|
@ -22,4 +24,6 @@
|
|||
font-weight: bold;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.jqr-link:hover { text-decoration: underline; }
|
||||
.jqr-link:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue