swarm-ui: a schedules page, one card per scheduled prompt
/schedules lists the controller's scheduled prompts as cards: name as the title, the agents it fires for, the message, its cadence and next fire. Edit turns a card into its own form; pause, resume and remove act in place, and + schedule opens an empty form. The form sends only what changed, so a rename never moves the fire times, and warns when the start or the repeat does. Filters reuse the shared card filter bar. Adds a TextAreaField to the ui kit, and an upcoming mode on RelativeTime so a next-fire time reads "in 5m". Needs the controller's /api/schedules routes.
This commit is contained in:
parent
7f597f5c43
commit
63ee6d12be
14 changed files with 931 additions and 3 deletions
|
|
@ -22,6 +22,7 @@ import {
|
|||
import { SplitView } from "../ui/split-view/SplitView.js";
|
||||
import { Table, type TableColumn } from "../ui/table/Table.js";
|
||||
import { TextField } from "../ui/text-field/TextField.js";
|
||||
import { TextAreaField } from "../ui/text-area-field/TextAreaField.js";
|
||||
import {
|
||||
SelectField,
|
||||
type SelectOption,
|
||||
|
|
@ -114,6 +115,18 @@ const MODEL_OPTIONS: DropdownOption[] = [
|
|||
{ value: "opus", label: "opus", description: "powerful" },
|
||||
];
|
||||
|
||||
function TextAreaFieldSample() {
|
||||
const [value, setValue] = useState("");
|
||||
return (
|
||||
<TextAreaField
|
||||
id="sample-text-area-field"
|
||||
label="message"
|
||||
value={value}
|
||||
onInput={setValue}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
// Controlled samples need their own state to actually type/select into —
|
||||
// module-level consts can't do that, hence these two small wrappers
|
||||
// rather than inline JSX in the page body below.
|
||||
|
|
@ -465,6 +478,12 @@ export function ComponentsPage() {
|
|||
</Sample>
|
||||
</Section>
|
||||
|
||||
<Section title="TextAreaField">
|
||||
<Sample label="editable">
|
||||
<TextAreaFieldSample />
|
||||
</Sample>
|
||||
</Section>
|
||||
|
||||
<Section title="SelectField">
|
||||
<Sample label="editable">
|
||||
<SelectFieldSample />
|
||||
|
|
|
|||
Loading…
Reference in a new issue