swarm-ui: shared Hint, ActionRow, Toolbar, EmptyState, ExternalLink and ExpandableCard replace per-page copies
Hint, ActionRow, Toolbar, EmptyState and ExternalLink replace the muted text, button row, refresh bar, empty line and _blank anchor that each page restyled under its own class. ExpandableCard (with a loading twin) holds the builds and recent-runs cards, which had identical head and body CSS. The create form's raw checkbox becomes CheckboxField. The components page shows each new piece.
This commit is contained in:
parent
b74b5e77e4
commit
8a2e5203ad
1 changed files with 689 additions and 427 deletions
|
|
@ -16,8 +16,10 @@ import { useEffect, useState } from "preact/hooks";
|
|||
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
|
||||
import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js";
|
||||
import { Badge } from "@hive/shared/badge.js";
|
||||
import { ActionRow } from "../../ui/action-row/ActionRow.js";
|
||||
import { Button } from "../../ui/button/Button.js";
|
||||
import { Dialog } from "../../ui/dialog/Dialog.js";
|
||||
import { Hint } from "../../ui/hint/Hint.js";
|
||||
import { Panel } from "../../ui/panel/Panel.js";
|
||||
import { TextField } from "../../ui/text-field/TextField.js";
|
||||
import { BadgeSkeleton } from "../../ui/skeleton/BadgeSkeleton.js";
|
||||
|
|
@ -71,9 +73,9 @@ export function LimitsFields({
|
|||
placeholder="e.g. 400%"
|
||||
onInput={onCpu}
|
||||
/>
|
||||
<p class="ui-agent-limits-hint">
|
||||
<Hint class="ui-agent-limits-hint">
|
||||
A percentage of one core: 100% is one core, 400% is four.
|
||||
</p>
|
||||
</Hint>
|
||||
<TextField
|
||||
id={`${idPrefix}-memory-max`}
|
||||
label="memory max"
|
||||
|
|
@ -81,10 +83,10 @@ export function LimitsFields({
|
|||
placeholder="e.g. 8G"
|
||||
onInput={onMemory}
|
||||
/>
|
||||
<p class="ui-agent-limits-hint">
|
||||
<Hint class="ui-agent-limits-hint">
|
||||
A size such as 512M or 8G, a percentage of the machine's memory such as
|
||||
50%, or infinity.
|
||||
</p>
|
||||
</Hint>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
@ -239,7 +241,7 @@ function LimitsForm({
|
|||
{problem ? (
|
||||
<ApiErrorPanel context="the caps were not saved" problem={problem} />
|
||||
) : null}
|
||||
<div class="ui-agent-limits-actions">
|
||||
<ActionRow>
|
||||
<Button variant="primary" type="submit" disabled={busy || empty}>
|
||||
{busy ? "saving…" : "save"}
|
||||
</Button>
|
||||
|
|
@ -249,7 +251,7 @@ function LimitsForm({
|
|||
>
|
||||
clear the swarm's caps
|
||||
</Button>
|
||||
</div>
|
||||
</ActionRow>
|
||||
</form>
|
||||
</Panel>
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in a new issue