From ddd0aa622afe4cdf1ac7d81893b9bfa5eaf18bff Mon Sep 17 00:00:00 2001 From: Bobban Rydh Date: Mon, 19 Oct 2026 22:36:24 +0200 Subject: [PATCH] Settings down to eight tabs; Domains become a tab of DNS 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 --- BACKUP.md | 14 ++-- DATABASE.md | 4 +- INTEGRATIONS.md | 4 +- NOTIFICATIONS.md | 2 +- README.md | 6 +- ROLES.md | 4 +- server/src/db/applyRestore.ts | 2 +- server/src/index.ts | 2 +- server/src/integrations/fieldSchemas.ts | 2 +- server/src/services/agenda.ts | 2 +- server/src/services/alertTickets.ts | 2 +- server/src/services/alerts.ts | 4 +- server/src/services/selfBackup.ts | 2 +- server/src/services/settingsStore.ts | 2 +- server/test/selfBackup.test.ts | 2 +- web/src/App.tsx | 29 ++++---- web/src/layout/nav.tsx | 2 - web/src/pages/Dashboard.tsx | 12 ++-- web/src/pages/Dns.tsx | 32 ++++++++- web/src/pages/Privacy.tsx | 8 +-- web/src/pages/Settings.tsx | 8 +-- web/src/pages/settings/SettingsGroups.tsx | 68 +++++++++++++++++++ .../Domains.tsx => views/DomainsView.tsx} | 5 +- 23 files changed, 153 insertions(+), 65 deletions(-) create mode 100644 web/src/pages/settings/SettingsGroups.tsx rename web/src/{pages/Domains.tsx => views/DomainsView.tsx} (97%) diff --git a/BACKUP.md b/BACKUP.md index b579160..697f2aa 100644 --- a/BACKUP.md +++ b/BACKUP.md @@ -4,7 +4,7 @@ Everything Homelab Manager knows is in **one SQLite file**, plus a handful of se `.env`. A backup is those two things — and the part people get wrong is keeping them **apart** (see [Keeping backups safe](#keeping-backups-safe)). -- [The built-in backups (Settings → Backup)](#the-built-in-backups-settings--backup) +- [The built-in backups (Settings → Data → Backup)](#the-built-in-backups-settings--data--backup) - [What to back up](#what-to-back-up) - [Taking a backup](#taking-a-backup) - [Checking a backup](#checking-a-backup) @@ -12,19 +12,19 @@ Everything Homelab Manager knows is in **one SQLite file**, plus a handful of se - [Keeping backups safe](#keeping-backups-safe) - [Automating it](#automating-it) - [Restoring](#restoring) -- [The encrypted export in Settings → Backup](#the-encrypted-export-in-settings--backup) +- [The encrypted export in Settings → Data → Backup](#the-encrypted-export-in-settings--data--backup) - [If there is no backup](#if-there-is-no-backup) - [What has been tested, and what hasn't](#what-has-been-tested-and-what-hasnt) The commands assume the standard Docker setup from the README: you run them in the folder that holds `docker-compose.yml`, `.env` and `data/`, and the service is called `homelab-manager`. -## The built-in backups (Settings → Backup) +## The built-in backups (Settings → Data → Backup) You don't need the snippets below for the everyday case: Homelab Manager takes a backup of its own database **every day** (03:30 in the notification time zone, the newest 14 kept — both changeable, and it can be switched off), checks each one as it makes it, and keeps them in `data/backups/` with the same -names the snippets use. **Settings → Backup** shows them and does the rest: +names the snippets use. **Settings → Data → Backup** shows them and does the rest: - **Back up now** makes one on the spot. **Download** takes a copy to your computer (the quickest way off the machine). **Check** opens a backup and says whether SQLite finds it sound, how many users, @@ -268,9 +268,9 @@ everything stored so far unreadable. not show the gap, so it is worth noting it somewhere. - Everyone has to sign in again if you restored without `data/sessions/`. That is expected. -## The encrypted export in Settings → Backup +## The encrypted export in Settings → Data → Backup -A different tool, for a different job. **Settings → Backup** downloads one file, encrypted with a +A different tool, for a different job. **Settings → Data → Backup** downloads one file, encrypted with a passphrase you choose (AES-256-GCM, key derived with scrypt), holding: - the settings (notification channels, display, log retention, alert tickets, and so on), @@ -292,7 +292,7 @@ Keep the passphrase somewhere safe; it can't be recovered. What you can get back, from least to most work: -- **You have a Settings → Backup export:** a fresh install plus an import restores the settings, +- **You have a Settings → Data → Backup export:** a fresh install plus an import restores the settings, integrations and DNS providers. Everything else is re-created. - **You only have the `.env`:** a fresh install with the same file works, and everything in the database starts empty. Sign in (the first account becomes admin), re-add the integrations, diff --git a/DATABASE.md b/DATABASE.md index 8abca5b..4e8f673 100644 --- a/DATABASE.md +++ b/DATABASE.md @@ -817,7 +817,7 @@ that were never changed aren't stored; the app fills in defaults when reading. | `display` | `dateFormat`, `timeFormat`, `pageSize`. | | `providerColors`, `integrationColors` | Badge colours, by provider / integration type. | | `consistency` | `excludedRanges` — addresses the Consistency and IP Addresses pages ignore. Default `["172.16.0.0/12"]` (Docker's networks). | -| `alertTickets` | Opening osTicket tickets for alerts: `enabled`, `integrationId`, `severities`, `categories`, `requesterName`/`requesterEmail`, `topicId`, `priorityId`, `notifyStaff`, `existingProblems`, `confirmChecks`, `summaryAbove`, `reopenAfterMinutes`. Edited under Settings → Alert tickets. The API address and key are on the osTicket integration, not here. | +| `alertTickets` | Opening osTicket tickets for alerts: `enabled`, `integrationId`, `severities`, `categories`, `requesterName`/`requesterEmail`, `topicId`, `priorityId`, `notifyStaff`, `existingProblems`, `confirmChecks`, `summaryAbove`, `reopenAfterMinutes`. Edited under Settings → Notifications → Alert tickets. The API address and key are on the osTicket integration, not here. | | `nameGenerator` | `themes` — the Generator's server-name lists: `[{ "id", "label", "names": [...], "lastImport"? }]`. Edited under Settings → Names. | Rows whose key starts with **`_internal:`** are scheduler bookkeeping, not @@ -907,7 +907,7 @@ dates, the audit log — is readable by anyone who can read the file, so treat t file and its backups as sensitive anyway. **Backups.** -- **Settings → Backup** exports the settings, the integrations and the DNS +- **Settings → Data → Backup** exports the settings, the integrations and the DNS providers (with their credentials decrypted, then wrapped in a file encrypted with a passphrase you choose). Importing merges the settings over the current ones, and adds integrations and providers that don't exist yet (matched by type and name) — it never diff --git a/INTEGRATIONS.md b/INTEGRATIONS.md index 9a4a50c..155cb19 100644 --- a/INTEGRATIONS.md +++ b/INTEGRATIONS.md @@ -182,7 +182,7 @@ the dashboard views themselves load fine. a field looks wrong, tell us what happened and we'll adjust — this one has had less real-world exposure than every other integration listed here. -**Optional: opening tickets for alerts** (Settings → Alert tickets) +**Optional: opening tickets for alerts** (Settings → Notifications → Alert tickets) - **Config fields:** Ticket API address (optional), Ticket API key (optional, stored encrypted like the database password), Allow self-signed certificate (ticket API). Leave them empty and the integration works as before. @@ -191,7 +191,7 @@ the dashboard views themselves load fine. app's requests come from (behind Docker or a reverse proxy that is the host's or proxy's address, not the container's — check osTicket's log if it refuses) and tick **Can create tickets**. osTicket refuses a key from any other address, which is the most common reason a test ticket fails. -- **What is sent:** one ticket per problem — name and email you set under Settings → Alert tickets, a subject, the +- **What is sent:** one ticket per problem — name and email you set under Settings → Notifications → Alert tickets, a subject, the problem's text and a link back to this app, optionally a help topic and priority id — with `autorespond` off (the "user" is this app, so an acknowledgement would only bounce) and osTicket's own staff alert on or off as you choose. - **What it can't do:** close, reopen, or comment on a ticket — osTicket's API has no such endpoint. A ticket opened diff --git a/NOTIFICATIONS.md b/NOTIFICATIONS.md index 94e47b3..126f5fe 100644 --- a/NOTIFICATIONS.md +++ b/NOTIFICATIONS.md @@ -191,7 +191,7 @@ It runs the checks live when opened (a recent result is reused for a minute), an ## Tickets in osTicket -Not a notification, but it acts on the same alerts: with **Settings → Alert tickets** switched on (off by default), a problem on the Alerts page opens a +Not a notification, but it acts on the same alerts: with **Settings → Notifications → Alert tickets** switched on (off by default), a problem on the Alerts page opens a ticket in osTicket. It runs every 15 minutes, starting about a minute and a half after the app starts. | Rule | What it means | diff --git a/README.md b/README.md index d76c47b..1ddd420 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ can be ignored with a reason, and stays ignored. The excluded-ranges list is the same one the IP Addresses page manages — edit it from either page and both reflect the change. -**Domains** — when each domain registration expires, read from the registry +**Domains** (Network → DNS → *Domain names*) — when each domain registration expires, read from the registry itself. The domains behind your DNS zones are picked up automatically (a zone like `lab.example.se` resolves to the `example.se` registration that actually expires); others can be added by hand. Each is looked up daily over RDAP where @@ -337,7 +337,7 @@ It checks live (a recent result is reused for a minute; "Check now" forces a fresh one), and anything it couldn't read is called out at the top rather than quietly treated as fine. -**Alert tickets** (Settings → Alert tickets, admin only) opens a ticket in osTicket for an alert, through osTicket's own API. Every 15 minutes the +**Alert tickets** (Settings → Notifications → Alert tickets, admin only) opens a ticket in osTicket for an alert, through osTicket's own API. Every 15 minutes the problems on the Alerts page are looked at, and one that is new and has lasted two checks in a row gets one ticket — never a second for the same problem, and never one for something under a maintenance window or about osTicket itself. You choose which severities and kinds count (critical and warning by default), and the Alerts page shows the ticket number on each alert that has one. If many problems appear at once — a network drop that makes thirty @@ -518,7 +518,7 @@ resolved after it has been missing for a couple of minutes in a row — thirty w never in the first minutes after the app starts, when server alerts are held back on purpose. Resolved incidents are kept for 400 days. The weekly digest has an *Incidents* section. -**Database backups** (Settings → Backup). A copy of Homelab Manager's own database is taken every day (03:30 +**Database backups** (Settings → Data → Backup). A copy of Homelab Manager's own database is taken every day (03:30 in the notification time zone, the newest 14 kept; on unless you turn it off), checked as it is made, and kept in `data/backups/`. The page lists them with **Download**, **Check**, **Restore…** and **Delete**, makes one now (**Back up now**), takes one from somewhere else (**Upload a backup…**) and sets the schedule. diff --git a/ROLES.md b/ROLES.md index 317a615..8492612 100644 --- a/ROLES.md +++ b/ROLES.md @@ -92,7 +92,7 @@ even further, to admin only: - **Alert tickets**: everyone sees which alerts have an osTicket ticket (a badge on the Alerts page, linking to the ticket in osTicket); switching the feature on, choosing what opens a ticket, and sending a test ticket are - under Settings → Alert tickets, which is admin-only. + under Settings → Notifications → Alert tickets, which is admin-only. - **Runbooks**: everyone reads them (on a server's page, an integration's card, next to an alert); writing, editing and removing one needs operator. - **Inventory**: everyone can see the hardware (and print its labels); adding, editing and removing needs @@ -109,7 +109,7 @@ even further, to admin only: - **Acknowledging an alert, handing it over, and taking it back** need operator (the person it is handed to must be an operator or administrator); everyone sees who has what. **Incidents** (Alerts → History) are readable by everyone signed in; writing a note needs operator, and a note can be removed by its author or an administrator. -- **Database backups** (Settings → Backup: making, downloading, uploading, checking, restoring and deleting them, and the schedule) are +- **Database backups** (Settings → Data → Backup: making, downloading, uploading, checking, restoring and deleting them, and the schedule) are administrator-only: a backup holds the audit log, every server's address, the hashed agent tokens and all the stored credentials (encrypted). - **Alert limits** on a server's page: everyone can see the ones a server has of its own; only an administrator changes them. The same goes for the **services to diff --git a/server/src/db/applyRestore.ts b/server/src/db/applyRestore.ts index 1323615..0eea00b 100644 --- a/server/src/db/applyRestore.ts +++ b/server/src/db/applyRestore.ts @@ -1,5 +1,5 @@ /** - * Finishes a restore that was staged from Settings → Backup. It has to happen before the database is opened, which is why it is a module + * Finishes a restore that was staged from Settings → Data → Backup. It has to happen before the database is opened, which is why it is a module * of its own that index.ts imports first: by the time anything else loads, the file is already the one that was chosen. * * Nothing is deleted. The database that was in use is moved into the backups folder (as "…-pre-restore.sqlite") before the chosen one is put diff --git a/server/src/index.ts b/server/src/index.ts index c0240c3..0fdb651 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -1,5 +1,5 @@ import "./loadEnv.js"; -// Before anything opens the database: puts a restore that was staged from Settings → Backup in place. +// Before anything opens the database: puts a restore that was staged from Settings → Data → Backup in place. import "./db/applyRestore.js"; import { env, warnIfAuthNotConfigured, checkSessionSecret } from "./env.js"; import { createApp } from "./app.js"; diff --git a/server/src/integrations/fieldSchemas.ts b/server/src/integrations/fieldSchemas.ts index d98bb61..ff5ca34 100644 --- a/server/src/integrations/fieldSchemas.ts +++ b/server/src/integrations/fieldSchemas.ts @@ -85,7 +85,7 @@ export const INTEGRATION_FIELDS: Partial ({ title: `${certificate ? "Certificate" : "Secret"} “${s.name}” ${past ? "expired" : "expires"}`, detail: certificate ? "kept as a secret" : null, link: "/secrets" })); } - for (const d of data.domains) day(`domain:${d.id}`, "domain", d.expiresAt, (past) => ({ title: `Domain ${d.name} ${past ? "expired" : "expires"}`, link: "/domains" })); + for (const d of data.domains) day(`domain:${d.id}`, "domain", d.expiresAt, (past) => ({ title: `Domain ${d.name} ${past ? "expired" : "expires"}`, link: "/dns?view=domains" })); for (const e of data.endpoints) { if (!e.enabled || !e.certExpiresAt) continue; day(`endpoint-cert:${e.id}`, "certificate", e.certExpiresAt.slice(0, 10), (past) => ({ title: `The certificate for ${e.name} ${past ? "expired" : "expires"}`, detail: "seen by an endpoint check", link: "/endpoints", serverId: e.serverId })); diff --git a/server/src/services/alertTickets.ts b/server/src/services/alertTickets.ts index ec1337a..1e9dfec 100644 --- a/server/src/services/alertTickets.ts +++ b/server/src/services/alertTickets.ts @@ -359,7 +359,7 @@ export async function sendTestTicket(actor: CurrentUser): Promise topicId: settings.topicId, priorityId: settings.priorityId, subject: "[Homelab] Test ticket from Homelab Manager", - message: `This is a test. ${actor.name ?? actor.email ?? "An administrator"} asked Homelab Manager to open it from Settings → Alert tickets, to check that tickets can be created here.\n\nNothing is wrong. You can close this ticket.\n\n${absolute("/settings/alert-tickets")}`, + message: `This is a test. ${actor.name ?? actor.email ?? "An administrator"} asked Homelab Manager to open it from Settings → Notifications → Alert tickets, to check that tickets can be created here.\n\nNothing is wrong. You can close this ticket.\n\n${absolute("/settings/alert-tickets")}`, }); await recordAudit({ actor, category: "alert_ticket", action: "test", targetType: "integration", targetId: settings.integrationId ?? undefined, detail: { ticket: created.number } }); return created; diff --git a/server/src/services/alerts.ts b/server/src/services/alerts.ts index 517ca6a..601b2aa 100644 --- a/server/src/services/alerts.ts +++ b/server/src/services/alerts.ts @@ -59,12 +59,12 @@ const SOURCES: Record = { gitea: { label: "Gitea", link: "/gitea" }, dockhand: { label: "Docker", link: "/docker" }, tailscale: { label: "Tailscale", link: "/tailscale" }, - homelab: { label: "Homelab Manager", link: "/settings/backup" }, + homelab: { label: "Homelab Manager", link: "/settings/data" }, pbs: { label: "Proxmox Backup", link: "/pbs" }, uptimekuma: { label: "Uptime Kuma", link: "/uptime-kuma" }, osticket: { label: "osTicket", link: "/osticket" }, secrets: { label: "Secrets", link: "/secrets" }, - domains: { label: "Domains", link: "/domains" }, + domains: { label: "Domains", link: "/dns?view=domains" }, endpoint: { label: "Endpoint", link: "/endpoints" }, heartbeat: { label: "Heartbeat", link: "/heartbeats" }, }; diff --git a/server/src/services/selfBackup.ts b/server/src/services/selfBackup.ts index d1f7c7f..555e44d 100644 --- a/server/src/services/selfBackup.ts +++ b/server/src/services/selfBackup.ts @@ -1,7 +1,7 @@ /** * Backups of Homelab Manager itself. Everything it knows is one SQLite file, so a backup is a consistent copy of that file (`VACUUM INTO`, * which is safe while the app is working) kept in the data folder's `backups/`: taken every day, the newest few kept, each one checked as - * it is made, and downloadable, uploadable and restorable from Settings → Backup. + * it is made, and downloadable, uploadable and restorable from Settings → Data → Backup. * * What a backup is not: it does not hold `CREDENTIALS_ENCRYPTION_KEY`, which decrypts the credentials stored in it, and it isn't off the * machine until someone copies it there. Both are said where backups are shown. diff --git a/server/src/services/settingsStore.ts b/server/src/services/settingsStore.ts index a4a695b..9dcafc2 100644 --- a/server/src/services/settingsStore.ts +++ b/server/src/services/settingsStore.ts @@ -180,7 +180,7 @@ export interface NameGeneratorSettings { export type AlertTicketSeverity = "critical" | "warning" | "info"; -/** Opening an osTicket ticket for an alert. Off until an admin sets it up under Settings → Alert tickets. */ +/** Opening an osTicket ticket for an alert. Off until an admin sets it up under Settings → Notifications → Alert tickets. */ export interface AlertTicketSettings { enabled: boolean; /** The osTicket integration whose API (address and key) is used. */ diff --git a/server/test/selfBackup.test.ts b/server/test/selfBackup.test.ts index d57ffd9..4fee0e0 100644 --- a/server/test/selfBackup.test.ts +++ b/server/test/selfBackup.test.ts @@ -420,7 +420,7 @@ describe("how current the backups are, in the alerts and /metrics", () => { assert.equal(stale!.severity, "warning"); assert.match(stale!.message, /60 h old/); assert.equal(stale!.source, "Homelab Manager"); - assert.equal(stale!.link, "/settings/backup"); + assert.equal(stale!.link, "/settings/data"); await oneAged(24 * 8); assert.equal((await selfAlert())!.severity, "critical"); assert.match((await selfAlert())!.message, /8 days old/); diff --git a/web/src/App.tsx b/web/src/App.tsx index b89fd91..950750c 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -35,19 +35,12 @@ import Heartbeats from "./pages/Heartbeats"; import ComingUp from "./pages/ComingUp"; import ChangeLog from "./pages/ChangeLog"; import Backups from "./pages/Backups"; -import Domains from "./pages/Domains"; import Consistency from "./pages/Consistency"; import Privacy from "./pages/Privacy"; import Settings from "./pages/Settings"; -import NotificationSettings from "./pages/settings/NotificationSettings"; -import BadgeSettings from "./pages/settings/BadgeSettings"; -import DisplaySettings from "./pages/settings/DisplaySettings"; +import { DataGroup, DisplayGroup, NotificationsGroup } from "./pages/settings/SettingsGroups"; import TagSettings from "./pages/settings/TagSettings"; -import CacheSettings from "./pages/settings/CacheSettings"; -import LogSettings from "./pages/settings/LogSettings"; -import BackupSettings from "./pages/settings/BackupSettings"; import NameSettings from "./pages/settings/NameSettings"; -import AlertTicketSettings from "./pages/settings/AlertTicketSettings"; import ShareSettings from "./pages/settings/ShareSettings"; import SignInSettings from "./pages/settings/SignInSettings"; import ApiSettings from "./pages/settings/ApiSettings"; @@ -151,7 +144,7 @@ function Shelled({ user }: { user: CurrentUser }) { } /> } /> } /> - } /> + } /> } /> } /> } /> @@ -199,18 +192,20 @@ function Shelled({ user }: { user: CurrentUser }) { } > } /> - } /> - } /> + } /> } /> - } /> - } /> + } /> } /> - } /> + } /> } /> } /> - } /> - } /> - } /> + } /> + {/* Tabs that were gathered into others: old links and bookmarks still arrive. */} + } /> + } /> + } /> + } /> + } /> diff --git a/web/src/layout/nav.tsx b/web/src/layout/nav.tsx index 9bec775..6045a18 100644 --- a/web/src/layout/nav.tsx +++ b/web/src/layout/nav.tsx @@ -16,7 +16,6 @@ import { IconSettings, IconWand, IconTool, - IconWorldWww, IconListCheck, IconRefresh, IconDownload, @@ -92,7 +91,6 @@ export const NAV: NavEntry[] = [ icon: , items: [ { to: "/dns", label: "DNS", icon: }, - { to: "/domains", label: "Domains", icon: }, { to: "/ipam", label: "IP Addresses", icon: }, { to: "/ports", label: "Ports", icon: }, { to: "/consistency", label: "Consistency", icon: }, diff --git a/web/src/pages/Dashboard.tsx b/web/src/pages/Dashboard.tsx index 0262062..ad26855 100644 --- a/web/src/pages/Dashboard.tsx +++ b/web/src/pages/Dashboard.tsx @@ -648,7 +648,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) { if (serverSummary?.total === 0) notSetUp.push({ label: "Servers", to: "/servers", what: "add a server and install its agent" }); if (heartbeatList !== null && heartbeatList.length === 0) notSetUp.push({ label: "Heartbeats", to: "/heartbeats", what: "have a backup or cron job report in, so you hear when it doesn't run" }); if (endpointChecks !== null && endpointChecks.length === 0) notSetUp.push({ label: "Endpoints", to: "/endpoints", what: "ask a web address, a port or a certificate whether it is fine" }); - if (domainList !== null && domains.length === 0) notSetUp.push({ label: "Domains", to: "/domains", what: "appear after a DNS zone is added and the daily check has run" }); + if (domainList !== null && domains.length === 0) notSetUp.push({ label: "Domains", to: "/dns?view=domains", what: "appear after a DNS zone is added and the daily check has run" }); if (integrations !== null) { for (const { type, label } of WIDGETS) { if (!integrations.some((i) => i.type === type)) notSetUp.push({ label, to: "/integrations", what: "connect it under Integrations" }); @@ -904,13 +904,13 @@ export default function Dashboard({ user }: { user: CurrentUser }) { !domainError && ) : domains.length === 0 ? (
- Domains for your DNS zones appear on the Domains page after the next daily check, or add one there. + Domains for your DNS zones appear on the Domains page after the next daily check, or add one there.
) : ( <>
- {domains.length}} /> + {domains.length}} />
0 ? "#f59e0b" : undefined} /> @@ -935,7 +935,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) { {expiredDomains.slice(0, 3).map((d, i) => ( {i > 0 && ", "} - {d.name} ({Math.abs(d.daysLeft ?? 0)} d ago) + {d.name} ({Math.abs(d.daysLeft ?? 0)} d ago) ))} {expiredDomains.length > 3 && +{expiredDomains.length - 3} more} @@ -951,7 +951,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) { .map((d, i) => ( {i > 0 && ", "} - {d.name} ({d.daysLeft} d) + {d.name} ({d.daysLeft} d) ))} {expiringDomains.length > 3 && +{expiringDomains.length - 3} more} @@ -964,7 +964,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) { )} {failingDomainChecks > 0 && (
- {failingDomainChecks} domain{failingDomainChecks === 1 ? "" : "s"} couldn't be refreshed — see the Domains page. + {failingDomainChecks} domain{failingDomainChecks === 1 ? "" : "s"} couldn't be refreshed — see the Domains page.
)} diff --git a/web/src/pages/Dns.tsx b/web/src/pages/Dns.tsx index b857f60..1c3ebd3 100644 --- a/web/src/pages/Dns.tsx +++ b/web/src/pages/Dns.tsx @@ -1,4 +1,6 @@ -import { useEffect, useState, type CSSProperties } from "react"; +import { useEffect, useState, type CSSProperties, type ReactNode } from "react"; +import ViewTabs from "../components/ViewTabs"; +import DomainsView from "../views/DomainsView"; import TimeAgo from "../components/TimeAgo"; import { useSearchParams } from "react-router-dom"; import { @@ -39,7 +41,34 @@ function providerBadgeStyle(colors: Record, providerType: DnsPro return { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` }; } +const dnsTabs = (view: "records" | "domains") => ( + +); + +/** Zones and records from the DNS providers, and the registration expiry of the domain names (`?view=domains`). */ export default function Dns({ user }: { user: CurrentUser }) { + const [params] = useSearchParams(); + if (params.get("view") === "domains") { + return ( + <> +
+

DNS

+
+ {dnsTabs("domains")} + + + ); + } + return ; +} + +function DnsRecords({ user, tabs }: { user: CurrentUser; tabs: ReactNode }) { const isAdmin = user.role === "admin"; const canEdit = user.role === "admin" || user.role === "operator"; @@ -277,6 +306,7 @@ export default function Dns({ user }: { user: CurrentUser }) { )}
+ {tabs} {managingProviders ? ( diff --git a/web/src/pages/Privacy.tsx b/web/src/pages/Privacy.tsx index 719529c..9f4d4cf 100644 --- a/web/src/pages/Privacy.tsx +++ b/web/src/pages/Privacy.tsx @@ -172,7 +172,7 @@ export default function Privacy() { {retention?.enabled ? `Entries older than ${retention.retentionDays} days are deleted (checked every ${retention.intervalHours} h).` - : "Indefinitely — automatic deletion is off (Settings → Logs)."}{" "} + : "Indefinitely — automatic deletion is off (Settings → Data → Logs)."}{" "} The name stays in old entries even if the account is removed. @@ -202,7 +202,7 @@ export default function Privacy() { API tokens and passwords — including the Gotify/ntfy tokens, SMTP password and webhook secret — encrypted (AES-256-GCM) with a key held in the server's environment, not in the database. (If that key isn't set, notification credentials are kept unencrypted and the server says so at startup.) - Until deleted. Settings → Backup exports include them, encrypted with a passphrase you choose. + Until deleted. Settings → Data → Backup exports include them, encrypted with a passphrase you choose. Inventory @@ -229,7 +229,7 @@ export default function Privacy() { you configured, to read status and, when someone with permission asks, to act (start a VM, run a template…).
  • - osTicket tickets — only if an admin has switched on Settings → Alert tickets: for a problem that has lasted, the text of the alert + osTicket tickets — only if an admin has switched on Settings → Notifications → Alert tickets: for a problem that has lasted, the text of the alert (which server or integration, what is wrong), a link back to this app, and the requester name and email set there go to your osTicket's API.
  • @@ -337,7 +337,7 @@ export default function Privacy() { Sign out to end your session now. Administrators can also end anyone's on the Users → Signed in now page.
  • - Audit and diagnostic logs can be deleted automatically after a set number of days under Settings → Logs + Audit and diagnostic logs can be deleted automatically after a set number of days under Settings → Data → Logs {retention ? ` — currently ${retention.enabled ? `on, ${retention.retentionDays} days` : "off"}` : ""}.
  • diff --git a/web/src/pages/Settings.tsx b/web/src/pages/Settings.tsx index 51399df..69d5d99 100644 --- a/web/src/pages/Settings.tsx +++ b/web/src/pages/Settings.tsx @@ -3,17 +3,13 @@ import { NavLink, Outlet } from "react-router-dom"; const SUB_NAV = [ { to: "/settings/notifications", label: "Notifications" }, - { to: "/settings/badges", label: "Badges" }, { to: "/settings/sign-in", label: "Sign-in" }, { to: "/settings/display", label: "Display" }, - { to: "/settings/tags", label: "Tags" }, - { to: "/settings/alert-tickets", label: "Alert tickets" }, { to: "/settings/names", label: "Names" }, + { to: "/settings/tags", label: "Tags" }, { to: "/settings/share", label: "Share links" }, { to: "/settings/api", label: "API and webhooks" }, - { to: "/settings/cache", label: "Cache" }, - { to: "/settings/logs", label: "Logs" }, - { to: "/settings/backup", label: "Backup" }, + { to: "/settings/data", label: "Data" }, ]; export default function Settings() { diff --git a/web/src/pages/settings/SettingsGroups.tsx b/web/src/pages/settings/SettingsGroups.tsx new file mode 100644 index 0000000..d0459b2 --- /dev/null +++ b/web/src/pages/settings/SettingsGroups.tsx @@ -0,0 +1,68 @@ +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 ( + <> + + {view === "tickets" ? : } + + ); +} + +/** 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 ( + <> + + {view === "badges" ? : } + + ); +} + +/** 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 ( + <> + + {view === "logs" ? : view === "cache" ? : } + + ); +} diff --git a/web/src/pages/Domains.tsx b/web/src/views/DomainsView.tsx similarity index 97% rename from web/src/pages/Domains.tsx rename to web/src/views/DomainsView.tsx index c11489c..17a77d1 100644 --- a/web/src/pages/Domains.tsx +++ b/web/src/views/DomainsView.tsx @@ -27,7 +27,8 @@ function statusBadge(d: DomainRecord) { } } -export default function Domains({ user }: { user: CurrentUser }) { +/** When each domain registration expires — the "Domain names" side of the DNS page. */ +export default function DomainsView({ user }: { user: CurrentUser }) { const canEdit = user.role === "admin" || user.role === "operator"; const [data, setData] = useState(null); const [error, setError] = useState(null); @@ -124,7 +125,7 @@ export default function Domains({ user }: { user: CurrentUser }) { return ( <>
    -

    Domains

    +

    Domain names

    {canEdit && (