fabro/apps/fabro-web/app/routes/settings-storage.tsx
Bryan Helmkamp 76461da780
Remove the [server.slatedb] settings and the SlateDB prefix probe
No store sits behind `[server.slatedb]` any more: the section leaves the
settings layer, the resolved server settings, the defaults, the API schema,
the TypeScript client, the install wizard and the docs, and `fabro install`
probes the bucket for the `artifacts/` prefix alone. A settings file that
still carries the section is rewritten once at startup by a temporary
migration that removes it with a backup beside the file.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-18 16:00:24 -04:00

83 lines
2.2 KiB
TypeScript

import type {
ServerSettings,
SystemDiskResources,
} from "@qltysh/fabro-api-client";
import { formatBytesAsMemory } from "../lib/format";
import { useServerSettings, useSystemResources } from "../lib/queries";
import {
Mono,
ObjectStoreRows,
Panel,
PanelSkeleton,
Row,
SettingsPageIntro,
} from "../components/settings-panel";
export function meta() {
return [{ title: "Storage — Fabro" }];
}
const DESCRIPTION = (
<>
Filesystem and object store locations for run state, the embedded database,
and artifacts. Edit via{" "}
<code className="font-mono text-fg-2">settings.toml</code>; changes take
effect on the next server restart.
</>
);
export default function SettingsStorage() {
const settingsQuery = useServerSettings();
const resourcesQuery = useSystemResources();
const settings = settingsQuery.data;
const resources = resourcesQuery.data;
return (
<div className="space-y-6">
<SettingsPageIntro description={DESCRIPTION} />
{settings && resources ? (
<>
<StorageRootPanel settings={settings} disk={resources.disk} />
<ArtifactsPanel settings={settings} />
</>
) : (
<>
<PanelSkeleton />
<PanelSkeleton />
</>
)}
</div>
);
}
function StorageRootPanel({
settings,
disk,
}: {
settings: ServerSettings;
disk: SystemDiskResources;
}) {
const { storage } = settings.server;
return (
<Panel title="Storage root">
<Row title="Path" help="Filesystem path for run state and logs.">
<Mono>{storage.root}</Mono>
</Row>
<Row title="Fabro managed" help="Bytes currently tracked under Fabro storage.">
{formatBytesAsMemory(disk.fabro_managed_bytes, 0)}
</Row>
<Row title="Reclaimable" help="Bytes Fabro can reclaim by pruning inactive data.">
{formatBytesAsMemory(disk.fabro_reclaimable_bytes, 0)}
</Row>
</Panel>
);
}
function ArtifactsPanel({ settings }: { settings: ServerSettings }) {
const { artifacts } = settings.server;
return (
<Panel title="Artifacts">
<ObjectStoreRows store={artifacts.store} prefix={artifacts.prefix} />
</Panel>
);
}