Files
kandev/apps/web/lib/settings-discovery/catalog/system.ts
T
2026-08-05 14:07:52 +01:00

189 lines
4.9 KiB
TypeScript

import type { SettingsDiscoveryDefinition } from "../types";
export const SYSTEM_SETTINGS_HREF = "/settings/system";
export const SYSTEM_STATUS_SETTINGS_HREF = `${SYSTEM_SETTINGS_HREF}/status`;
const SYSTEM_STORAGE_DISCOVERY_ID = "system-storage";
const SYSTEM_STORAGE_SETTINGS_HREF = `${SYSTEM_SETTINGS_HREF}/storage`;
export const SYSTEM_SETTINGS_TARGETS = {
storageActions: "setting-system-storage-actions",
storageSchedule: "setting-system-storage-schedule",
storageWorkspaces: "setting-system-storage-workspaces",
storageGoCache: "setting-system-storage-go-cache",
storageDocker: "setting-system-storage-docker",
storageQuarantine: "setting-system-storage-quarantine",
} as const;
const STORAGE_SECTION_TARGETS: Record<string, string> = {
schedule: SYSTEM_SETTINGS_TARGETS.storageSchedule,
workspaces: SYSTEM_SETTINGS_TARGETS.storageWorkspaces,
"go-cache": SYSTEM_SETTINGS_TARGETS.storageGoCache,
docker: SYSTEM_SETTINGS_TARGETS.storageDocker,
quarantine: SYSTEM_SETTINGS_TARGETS.storageQuarantine,
};
export function storageSettingsTarget(sectionId: string): string | undefined {
return STORAGE_SECTION_TARGETS[sectionId];
}
export const SYSTEM_DISCOVERY_DEFINITIONS: SettingsDiscoveryDefinition[] = [
{
id: "system",
kind: "page",
labelKey: "common:system",
groupId: "system",
href: SYSTEM_STATUS_SETTINGS_HREF,
order: 600,
},
{
id: "system-status",
kind: "page",
labelKey: "common:status",
parentId: "system",
groupId: "system",
href: SYSTEM_STATUS_SETTINGS_HREF,
order: 610,
},
{
id: "system-feature-toggles",
kind: "page",
labelKey: "system:navFeatureToggles",
parentId: "system",
groupId: "system",
href: "/settings/system/feature-toggles",
order: 620,
},
{
id: "system-database",
kind: "page",
labelKey: "system:navDatabase",
parentId: "system",
groupId: "system",
href: "/settings/system/database",
order: 630,
},
{
id: "system-backups",
kind: "page",
labelKey: "system:navBackups",
parentId: "system",
groupId: "system",
href: "/settings/system/backups",
order: 640,
},
{
id: SYSTEM_STORAGE_DISCOVERY_ID,
kind: "page",
labelKey: "system:navStorage",
parentId: "system",
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
order: 650,
},
{
id: "system-storage-actions",
kind: "section",
labelKey: "system:storageActionsTitle",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageActions,
order: 651,
},
{
id: "system-storage-schedule",
kind: "section",
labelKey: "system:storageScheduleTitle",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageSchedule,
order: 652,
},
{
id: "system-storage-workspaces",
kind: "section",
labelKey: "system:storageWorkspacesTitle",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageWorkspaces,
order: 653,
},
{
id: "system-storage-go-cache",
kind: "section",
labelKey: "system:storageGoBuildCache",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageGoCache,
order: 654,
},
{
id: "system-storage-docker",
kind: "section",
labelKey: "system:storageDockerTitle",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageDocker,
order: 655,
},
{
id: "system-storage-quarantine",
kind: "section",
labelKey: "system:storageQuarantineSafetyTitle",
parentId: SYSTEM_STORAGE_DISCOVERY_ID,
groupId: "system",
href: SYSTEM_STORAGE_SETTINGS_HREF,
targetId: SYSTEM_SETTINGS_TARGETS.storageQuarantine,
order: 656,
},
{
id: "system-logs",
kind: "page",
labelKey: "system:navLogs",
parentId: "system",
groupId: "system",
href: "/settings/system/logs",
order: 660,
},
{
id: "system-updates",
kind: "page",
labelKey: "system:navUpdates",
parentId: "system",
groupId: "system",
href: "/settings/system/updates",
order: 670,
},
{
id: "system-about",
kind: "page",
labelKey: "system:navAbout",
parentId: "system",
groupId: "system",
href: "/settings/system/about",
order: 680,
},
{
id: "system-licenses",
kind: "page",
labelKey: "system:navLicenses",
parentId: "system",
groupId: "system",
href: "/settings/system/licenses",
order: 690,
},
{
id: "system-users",
kind: "page",
labelKey: "system:navUsers",
parentId: "system",
groupId: "system",
href: "/settings/system/users",
order: 700,
requires: "users",
},
];