Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions frontend/administration.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,15 +275,15 @@ function ComponentCard({ record, revision }) {
const help = !ui.getSnapshot().snapshot.apply_enabled ? "On-demand installation is disabled for this deployment."
: record.component === "webui" ? !ui.getSnapshot().snapshot.webui_storage_configured ? "Configure WebUI Storage to enable installation." : ""
: !observed?.self_update_enabled ? "Self-update is not enabled or the running component could not be verified." : "";
return h(Paper, { component: "section", withBorder: true, className: "administration-card" },
h("div", { className: "card-body" },
return h(Paper, { component: "section", withBorder: true, className: "sf-card administration-card" },
h("div", { className: "sf-card-body" },
h("div", { className: "administration-card-heading" },
h("div", null, h("h2", { className: "card-title" }, record.component.toUpperCase()),
h("div", null, h("h2", { className: "sf-card-title" }, record.component.toUpperCase()),
h("p", { className: "muted" }, { api: "Dashboard service", bot: "Discord moderation", webui: "Browser workspace" }[record.component])), ...heading),
h("div", { className: "administration-info" }, content),
h("details", { className: "administration-technical" }, h("summary", null, "Version & technical details"), h("div", null, details)),
h("p", { className: "muted administration-help", hidden: !help }, help),
h("div", { className: "card-actions administration-actions" },
h("div", { className: "sf-card-actions administration-actions" },
action("Check now", record.component, item => request("/api/updates/check", { component: item.component }), { disabled: (ui.getSnapshot().activity === "busy") || (ui.getSnapshot().freshness === "stale") }),
action(record.component === "webui" ? "Update WebUI" : "Update", record.component,
item => request("/api/updates/install", { component: item.component, digest: item.candidate.digest }),
Expand Down Expand Up @@ -322,15 +322,15 @@ function AlertChannelCard({ revision }) {
const [value, setValue] = useState(saved);
useEffect(() => { setValue(saved); }, [saved, revision]);
const blocked = (ui.getSnapshot().activity === "busy") || (ui.getSnapshot().freshness === "stale");
return h("section", { id: "alert-channel", className: "card bg-base-100 administration-card" },
h("div", { className: "card-body" },
h("h2", { className: "card-title" }, "Boot repair alerts"),
return h(Paper, { component: "section", withBorder: true, id: "alert-channel", className: "sf-card administration-card" },
h("div", { className: "sf-card-body" },
h("h2", { className: "sf-card-title" }, "Boot repair alerts"),
h("p", { className: "muted" }, "The bot posts here once when boot repair can't restore the recorded bot or API release."),
!saved && h("p", { id: "alert-channel-unset", className: "muted" }, "No alert channel is set. Mismatches are logged and shown on the component cards."),
h("label", { className: "fieldset field" }, h("span", { className: "fieldset-legend" }, "Alert channel ID"),
h(TextInput, noAutofill({ id: "alert-channel-id", size: "sm", inputMode: "numeric", value, disabled: blocked,
onChange: event => setValue(event.target.value) }))),
h("div", { className: "card-actions" },
h("div", { className: "sf-card-actions" },
h(Button, { id: "save-alert-channel", type: "button", size: "sm", variant: "default", disabled: blocked || value.trim() === saved,
onClick: () => mutate({ component: "alerts" }, "Save alert channel",
() => request("/api/updates/alert-channel", { channel_id: value.trim() })) }, "Save alert channel"))));
Expand Down Expand Up @@ -375,9 +375,9 @@ function AdministrationView({ appearance }) {
document.addEventListener("visibilitychange", visible);
return () => { document.removeEventListener("visibilitychange", visible); clearTimeout(refreshTimer); };
}, []);
if (display.access === "denied" && display.signIn !== "required") return h(Paper, { component: "section", className: "card bg-base-100 card-border" },
h("div", { className: "card-body" },
h("h1", { className: "card-title" }, "Owner access required"),
if (display.access === "denied" && display.signIn !== "required") return h(Paper, { component: "section", withBorder: true, className: "sf-card" },
h("div", { className: "sf-card-body" },
h("h1", { className: "sf-card-title" }, "Owner access required"),
h("p", null, "Administration is available only to the configured bot owner."),
h("a", { href: workspaceHref }, "Back to workspace"),
),
Expand Down
Loading
Loading