Notifications gains Alert tickets, Display gains Badge colours, and a new Data tab holds Backup, Logs and Cache. Domains is the 'Domain names' tab of DNS. Old addresses redirect; the docs, the Privacy page and the links from alerts and the agenda name the new places. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
69 lines
2.6 KiB
TypeScript
69 lines
2.6 KiB
TypeScript
import { useSearchParams } from "react-router-dom";
|
|
import ViewTabs from "../../components/ViewTabs";
|
|
import NotificationSettings from "./NotificationSettings";
|
|
import AlertTicketSettings from "./AlertTicketSettings";
|
|
import DisplaySettings from "./DisplaySettings";
|
|
import BadgeSettings from "./BadgeSettings";
|
|
import BackupSettings from "./BackupSettings";
|
|
import LogSettings from "./LogSettings";
|
|
import CacheSettings from "./CacheSettings";
|
|
|
|
// Settings used to have twelve tabs of its own. Three of them gather the ones that belong together; each part is the same page it always was,
|
|
// switched by `?view=` (so it can be linked to, and the old addresses redirect here).
|
|
|
|
/** Notifications, and — beside it — opening an osTicket ticket for an alert. */
|
|
export function NotificationsGroup() {
|
|
const [params] = useSearchParams();
|
|
const view = params.get("view") === "tickets" ? "tickets" : "notifications";
|
|
return (
|
|
<>
|
|
<ViewTabs
|
|
label="Notification settings"
|
|
tabs={[
|
|
{ to: "/settings/notifications", label: "Notifications", active: view === "notifications" },
|
|
{ to: "/settings/notifications?view=tickets", label: "Alert tickets", active: view === "tickets" },
|
|
]}
|
|
/>
|
|
{view === "tickets" ? <AlertTicketSettings /> : <NotificationSettings />}
|
|
</>
|
|
);
|
|
}
|
|
|
|
/** How things look: dates, times and table sizes, and the colours of the badges. */
|
|
export function DisplayGroup() {
|
|
const [params] = useSearchParams();
|
|
const view = params.get("view") === "badges" ? "badges" : "display";
|
|
return (
|
|
<>
|
|
<ViewTabs
|
|
label="Display settings"
|
|
tabs={[
|
|
{ to: "/settings/display", label: "Dates, times and tables", active: view === "display" },
|
|
{ to: "/settings/display?view=badges", label: "Badge colours", active: view === "badges" },
|
|
]}
|
|
/>
|
|
{view === "badges" ? <BadgeSettings /> : <DisplaySettings />}
|
|
</>
|
|
);
|
|
}
|
|
|
|
/** The upkeep of the app's own data: its backups, how long its logs are kept, and the DNS record cache. */
|
|
export function DataGroup() {
|
|
const [params] = useSearchParams();
|
|
const asked = params.get("view");
|
|
const view = asked === "logs" || asked === "cache" ? asked : "backup";
|
|
return (
|
|
<>
|
|
<ViewTabs
|
|
label="Data settings"
|
|
tabs={[
|
|
{ to: "/settings/data", label: "Backup", active: view === "backup" },
|
|
{ to: "/settings/data?view=logs", label: "Logs", active: view === "logs" },
|
|
{ to: "/settings/data?view=cache", label: "Cache", active: view === "cache" },
|
|
]}
|
|
/>
|
|
{view === "logs" ? <LogSettings /> : view === "cache" ? <CacheSettings /> : <BackupSettings />}
|
|
</>
|
|
);
|
|
}
|