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 <noreply@anthropic.com>
This commit is contained in:
1 parent
1432b148e9
commit
ddd0aa622a
23 files changed
+153
-65
No files matched your search
+12
-17
@@ -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 }) {
|
||||
<Route path="/generator" element={<Generator user={user} />} />
|
||||
<Route path="/privacy" element={<Privacy />} />
|
||||
<Route path="/consistency" element={<Consistency user={user} />} />
|
||||
<Route path="/domains" element={<Domains user={user} />} />
|
||||
<Route path="/domains" element={<Navigate to="/dns?view=domains" replace />} />
|
||||
<Route path="/maintenance" element={<Maintenance user={user} />} />
|
||||
<Route path="/updates" element={<Updates user={user} />} />
|
||||
<Route path="/inventory" element={<Inventory user={user} />} />
|
||||
@@ -199,18 +192,20 @@ function Shelled({ user }: { user: CurrentUser }) {
|
||||
}
|
||||
>
|
||||
<Route index element={<Navigate to="notifications" replace />} />
|
||||
<Route path="notifications" element={<NotificationSettings />} />
|
||||
<Route path="badges" element={<BadgeSettings />} />
|
||||
<Route path="notifications" element={<NotificationsGroup />} />
|
||||
<Route path="sign-in" element={<SignInSettings />} />
|
||||
<Route path="display" element={<DisplaySettings />} />
|
||||
<Route path="tags" element={<TagSettings />} />
|
||||
<Route path="display" element={<DisplayGroup />} />
|
||||
<Route path="names" element={<NameSettings />} />
|
||||
<Route path="alert-tickets" element={<AlertTicketSettings />} />
|
||||
<Route path="tags" element={<TagSettings />} />
|
||||
<Route path="share" element={<ShareSettings />} />
|
||||
<Route path="api" element={<ApiSettings />} />
|
||||
<Route path="cache" element={<CacheSettings />} />
|
||||
<Route path="logs" element={<LogSettings />} />
|
||||
<Route path="backup" element={<BackupSettings />} />
|
||||
<Route path="data" element={<DataGroup />} />
|
||||
{/* Tabs that were gathered into others: old links and bookmarks still arrive. */}
|
||||
<Route path="badges" element={<Navigate to="/settings/display?view=badges" replace />} />
|
||||
<Route path="alert-tickets" element={<Navigate to="/settings/notifications?view=tickets" replace />} />
|
||||
<Route path="backup" element={<Navigate to="/settings/data" replace />} />
|
||||
<Route path="logs" element={<Navigate to="/settings/data?view=logs" replace />} />
|
||||
<Route path="cache" element={<Navigate to="/settings/data?view=cache" replace />} />
|
||||
</Route>
|
||||
</Routes>
|
||||
<DialogHost />
|
||||
|
||||
@@ -16,7 +16,6 @@ import {
|
||||
IconSettings,
|
||||
IconWand,
|
||||
IconTool,
|
||||
IconWorldWww,
|
||||
IconListCheck,
|
||||
IconRefresh,
|
||||
IconDownload,
|
||||
@@ -92,7 +91,6 @@ export const NAV: NavEntry[] = [
|
||||
icon: <IconWorld size={20} />,
|
||||
items: [
|
||||
{ to: "/dns", label: "DNS", icon: <IconWorld size={20} /> },
|
||||
{ to: "/domains", label: "Domains", icon: <IconWorldWww size={20} /> },
|
||||
{ to: "/ipam", label: "IP Addresses", icon: <IconNetwork size={20} /> },
|
||||
{ to: "/ports", label: "Ports", icon: <IconPlug size={20} /> },
|
||||
{ to: "/consistency", label: "Consistency", icon: <IconListCheck size={20} /> },
|
||||
|
||||
@@ -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 && <WidgetSkeleton />
|
||||
) : domains.length === 0 ? (
|
||||
<div className="text-secondary">
|
||||
Domains for your DNS zones appear on the <Link to="/domains">Domains</Link> page after the next daily check, or add one there.
|
||||
Domains for your DNS zones appear on the <Link to="/dns?view=domains">Domains</Link> page after the next daily check, or add one there.
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<div className="row g-2 mb-3">
|
||||
<div className="col-4">
|
||||
<MiniStat label="Tracked" value={<Link to="/domains" className="text-reset text-decoration-none">{domains.length}</Link>} />
|
||||
<MiniStat label="Tracked" value={<Link to="/dns?view=domains" className="text-reset text-decoration-none">{domains.length}</Link>} />
|
||||
</div>
|
||||
<div className="col-4">
|
||||
<MiniStat label="Expiring" value={expiringDomains.length} accent={expiringDomains.length > 0 ? "#f59e0b" : undefined} />
|
||||
@@ -935,7 +935,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
{expiredDomains.slice(0, 3).map((d, i) => (
|
||||
<span key={d.id}>
|
||||
{i > 0 && ", "}
|
||||
<Link to="/domains">{d.name}</Link> <span className="text-secondary">({Math.abs(d.daysLeft ?? 0)} d ago)</span>
|
||||
<Link to="/dns?view=domains">{d.name}</Link> <span className="text-secondary">({Math.abs(d.daysLeft ?? 0)} d ago)</span>
|
||||
</span>
|
||||
))}
|
||||
{expiredDomains.length > 3 && <span className="text-secondary"> +{expiredDomains.length - 3} more</span>}
|
||||
@@ -951,7 +951,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
.map((d, i) => (
|
||||
<span key={d.id}>
|
||||
{i > 0 && ", "}
|
||||
<Link to="/domains">{d.name}</Link> <span className="text-secondary">({d.daysLeft} d)</span>
|
||||
<Link to="/dns?view=domains">{d.name}</Link> <span className="text-secondary">({d.daysLeft} d)</span>
|
||||
</span>
|
||||
))}
|
||||
{expiringDomains.length > 3 && <span className="text-secondary"> +{expiringDomains.length - 3} more</span>}
|
||||
@@ -964,7 +964,7 @@ export default function Dashboard({ user }: { user: CurrentUser }) {
|
||||
)}
|
||||
{failingDomainChecks > 0 && (
|
||||
<div className="text-secondary small mt-2">
|
||||
{failingDomainChecks} domain{failingDomainChecks === 1 ? "" : "s"} couldn't be refreshed — see the <Link to="/domains">Domains</Link> page.
|
||||
{failingDomainChecks} domain{failingDomainChecks === 1 ? "" : "s"} couldn't be refreshed — see the <Link to="/dns?view=domains">Domains</Link> page.
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
+31
-1
@@ -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<string, string>, providerType: DnsPro
|
||||
return { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` };
|
||||
}
|
||||
|
||||
const dnsTabs = (view: "records" | "domains") => (
|
||||
<ViewTabs
|
||||
label="DNS view"
|
||||
tabs={[
|
||||
{ to: "/dns", label: "Zones and records", active: view === "records" },
|
||||
{ to: "/dns?view=domains", label: "Domain names", active: view === "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 (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-2">
|
||||
<h2 className="page-title mb-0">DNS</h2>
|
||||
</div>
|
||||
{dnsTabs("domains")}
|
||||
<DomainsView user={user} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <DnsRecords user={user} tabs={dnsTabs("records")} />;
|
||||
}
|
||||
|
||||
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 }) {
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{tabs}
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{managingProviders ? (
|
||||
|
||||
@@ -172,7 +172,7 @@ export default function Privacy() {
|
||||
<td>
|
||||
{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.
|
||||
</td>
|
||||
</tr>
|
||||
@@ -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.)
|
||||
</td>
|
||||
<td>Until deleted. Settings → Backup exports include them, encrypted with a passphrase you choose.</td>
|
||||
<td>Until deleted. Settings → Data → Backup exports include them, encrypted with a passphrase you choose.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Inventory</td>
|
||||
@@ -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…).
|
||||
</li>
|
||||
<li className="mb-2">
|
||||
<strong>osTicket tickets</strong> — only if an admin has switched on Settings → Alert tickets: for a problem that has lasted, the text of the alert
|
||||
<strong>osTicket tickets</strong> — 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.
|
||||
</li>
|
||||
<li className="mb-2">
|
||||
@@ -337,7 +337,7 @@ export default function Privacy() {
|
||||
<strong>Sign out</strong> to end your session now. Administrators can also end anyone's on the <Link to="/users?view=sessions">Users → Signed in now</Link> page.
|
||||
</li>
|
||||
<li className="mb-2">
|
||||
<strong>Audit and diagnostic logs</strong> can be deleted automatically after a set number of days under Settings → Logs
|
||||
<strong>Audit and diagnostic logs</strong> can be deleted automatically after a set number of days under Settings → Data → Logs
|
||||
{retention ? ` — currently ${retention.enabled ? `on, ${retention.retentionDays} days` : "off"}` : ""}.
|
||||
</li>
|
||||
<li className="mb-2">
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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 (
|
||||
<>
|
||||
<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 />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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<DomainList | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -124,7 +125,7 @@ export default function Domains({ user }: { user: CurrentUser }) {
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-3">
|
||||
<h2 className="page-title mb-0">Domains</h2>
|
||||
<h3 className="mb-0">Domain names</h3>
|
||||
{canEdit && (
|
||||
<button className="btn btn-outline-secondary ms-auto" onClick={refreshAll} disabled={refreshingAll}>
|
||||
{refreshingAll ? "Checking…" : "Check all now"}
|
||||
Reference in new issue
Block a user