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
@@ -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 ? (
|
||||
|
||||
@@ -1,248 +0,0 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { api, type CurrentUser, type DomainList, type DomainRecord } from "../api/client";
|
||||
import { downloadCsv } from "../utils/csv";
|
||||
import { formatDateTime } from "../utils/date";
|
||||
import { formatAgo } from "../utils/duration";
|
||||
import { readableError } from "../utils/errors";
|
||||
import { useSortable } from "../hooks/useSortable";
|
||||
import { usePagination } from "../hooks/usePagination";
|
||||
import SortableTh from "../components/SortableTh";
|
||||
import Pagination from "../components/Pagination";
|
||||
import { confirmDialog } from "../utils/dialogs";
|
||||
import { ErrorNotice } from "../components/Notice";
|
||||
import { SearchBox } from "../components/TableToolbar";
|
||||
import { useTableSearch } from "../hooks/useTableSearch";
|
||||
import { EmptyRow } from "../components/EmptyState";
|
||||
|
||||
function statusBadge(d: DomainRecord) {
|
||||
switch (d.status) {
|
||||
case "expired":
|
||||
return <span className="badge bg-red-lt text-red">Expired {Math.abs(d.daysLeft ?? 0)} d ago</span>;
|
||||
case "expiring":
|
||||
return <span className="badge bg-yellow-lt text-yellow">{d.daysLeft} d left</span>;
|
||||
case "ok":
|
||||
return <span className="badge bg-green-lt text-green">{d.daysLeft} d left</span>;
|
||||
default:
|
||||
return <span className="badge bg-secondary-lt text-secondary">Unknown</span>;
|
||||
}
|
||||
}
|
||||
|
||||
export default function Domains({ 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);
|
||||
const [notice, setNotice] = useState<string | null>(null);
|
||||
const [name, setName] = useState("");
|
||||
const [adding, setAdding] = useState(false);
|
||||
const [refreshingAll, setRefreshingAll] = useState(false);
|
||||
const [checkingId, setCheckingId] = useState<number | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
api.domains
|
||||
.list()
|
||||
.then(setData)
|
||||
.catch((err) => setError(readableError(err)));
|
||||
}, []);
|
||||
|
||||
const tableSearch = useTableSearch(data?.domains);
|
||||
const { sorted, sortKey, sortDir, requestSort } = useSortable(tableSearch.filtered, "expiresAt", "asc", { url: true });
|
||||
const { pageItems, page, setPage, pageCount, totalCount } = usePagination(sorted);
|
||||
|
||||
async function add(e: React.FormEvent) {
|
||||
e.preventDefault();
|
||||
setError(null);
|
||||
setNotice(null);
|
||||
setAdding(true);
|
||||
try {
|
||||
const res = await api.domains.add(name.trim());
|
||||
setName("");
|
||||
if (res.resolvedFrom) setNotice(`${res.resolvedFrom} is part of ${res.domain.name}, so that's the registration being tracked.`);
|
||||
setData(await api.domains.list());
|
||||
} catch (err) {
|
||||
setError(readableError(err));
|
||||
} finally {
|
||||
setAdding(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function refreshAll() {
|
||||
setError(null);
|
||||
setNotice(null);
|
||||
setRefreshingAll(true);
|
||||
try {
|
||||
setData(await api.domains.refresh());
|
||||
} catch (err) {
|
||||
setError(readableError(err));
|
||||
} finally {
|
||||
setRefreshingAll(false);
|
||||
}
|
||||
}
|
||||
|
||||
async function check(d: DomainRecord) {
|
||||
setError(null);
|
||||
setNotice(null);
|
||||
setCheckingId(d.id);
|
||||
try {
|
||||
await api.domains.check(d.id);
|
||||
setData(await api.domains.list());
|
||||
} catch (err) {
|
||||
setError(readableError(err));
|
||||
} finally {
|
||||
setCheckingId(null);
|
||||
}
|
||||
}
|
||||
|
||||
async function remove(d: DomainRecord) {
|
||||
if (!(await confirmDialog({ title: "Stop tracking domain", message: `Stop tracking ${d.name}?`, confirmLabel: "Stop tracking", danger: true }))) return;
|
||||
setError(null);
|
||||
try {
|
||||
await api.domains.remove(d.id);
|
||||
setData(await api.domains.list());
|
||||
} catch (err) {
|
||||
setError(readableError(err));
|
||||
}
|
||||
}
|
||||
|
||||
function exportCsv() {
|
||||
if (!sorted) return;
|
||||
downloadCsv(
|
||||
"domains.csv",
|
||||
["Domain", "Expires", "Days left", "Registrar", "Source", "Origin", "Last checked", "Problem"],
|
||||
sorted.map((d) => [
|
||||
d.name,
|
||||
d.expiresAt ?? "",
|
||||
d.daysLeft ?? "",
|
||||
d.registrar ?? "",
|
||||
d.lookupSource ?? "",
|
||||
d.origin === "zone" ? "DNS zone" : "manual",
|
||||
d.lastCheckedAt ? formatDateTime(new Date(d.lastCheckedAt)) : "",
|
||||
d.lastCheckError ?? "",
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-3">
|
||||
<h2 className="page-title mb-0">Domains</h2>
|
||||
{canEdit && (
|
||||
<button className="btn btn-outline-secondary ms-auto" onClick={refreshAll} disabled={refreshingAll}>
|
||||
{refreshingAll ? "Checking…" : "Check all now"}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<div className="text-secondary mb-3">
|
||||
When each domain registration expires, read from the registry itself. Domains for the DNS zones you've added show up
|
||||
here automatically; add any others by hand.
|
||||
</div>
|
||||
<ErrorNotice error={error} />
|
||||
{notice && <div className="alert alert-info">{notice}</div>}
|
||||
|
||||
{canEdit && (
|
||||
<form onSubmit={add} className="card mb-3">
|
||||
<div className="card-body row g-2 align-items-end">
|
||||
<div className="col-md-6">
|
||||
<label className="form-label">Track another domain</label>
|
||||
<input
|
||||
className="form-control"
|
||||
required
|
||||
placeholder="e.g. example.se"
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
/>
|
||||
</div>
|
||||
<div className="col-md-3">
|
||||
<button type="submit" className="btn btn-primary" disabled={adding || !name.trim()}>
|
||||
{adding ? "Looking it up…" : "Add domain"}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
)}
|
||||
|
||||
<div className="card mb-3">
|
||||
<div className="card-header">
|
||||
<h3 className="card-title">Registrations</h3>
|
||||
<SearchBox value={tableSearch.query} onChange={tableSearch.setQuery} className="ms-3" />
|
||||
<div className="card-actions">
|
||||
<button className="btn btn-sm btn-outline-secondary" onClick={exportCsv} disabled={!sorted || sorted.length === 0}>
|
||||
Export CSV
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="table-responsive">
|
||||
<table className="table table-vcenter card-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<SortableTh<DomainRecord> label="Domain" sortKeyName="name" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DomainRecord> label="Expires" sortKeyName="expiresAt" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DomainRecord> label="Registrar" sortKeyName="registrar" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
<SortableTh<DomainRecord> label="Last checked" sortKeyName="lastCheckedAt" activeKey={sortKey} direction={sortDir} onSort={requestSort} />
|
||||
{canEdit && <th className="w-1">Actions</th>}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{pageItems?.map((d) => (
|
||||
<tr key={d.id}>
|
||||
<td>
|
||||
{d.name}
|
||||
<span className="badge bg-secondary-lt text-secondary ms-2">{d.origin === "zone" ? "DNS zone" : "Manual"}</span>
|
||||
</td>
|
||||
<td>
|
||||
{d.expiresAt ? (
|
||||
<>
|
||||
{statusBadge(d)} <span className="text-secondary small ms-1">{d.expiresAt}</span>
|
||||
</>
|
||||
) : (
|
||||
<span className="text-secondary">—</span>
|
||||
)}
|
||||
</td>
|
||||
<td className="text-secondary">
|
||||
{d.registrar ?? "—"}
|
||||
{d.lookupSource && <span className="small ms-1">· {d.lookupSource.toUpperCase()}</span>}
|
||||
</td>
|
||||
<td>
|
||||
{d.lastCheckedAt ? (
|
||||
<span className="text-secondary" title={formatDateTime(new Date(d.lastCheckedAt))}>
|
||||
{formatAgo(d.lastCheckedAt)}
|
||||
</span>
|
||||
) : (
|
||||
<span className="text-secondary">not yet</span>
|
||||
)}
|
||||
{d.lastCheckError && <div className={`small ${d.expiresAt ? "text-warning" : "text-secondary"}`}>{d.lastCheckError}</div>}
|
||||
</td>
|
||||
{canEdit && (
|
||||
<td>
|
||||
<div className="btn-list flex-nowrap">
|
||||
<button className="btn btn-sm btn-outline-secondary" onClick={() => check(d)} disabled={checkingId === d.id}>
|
||||
{checkingId === d.id ? "Checking…" : "Check now"}
|
||||
</button>
|
||||
{d.origin === "manual" && (
|
||||
<button className="btn btn-sm btn-outline-danger" onClick={() => remove(d)}>
|
||||
Remove
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
</td>
|
||||
)}
|
||||
</tr>
|
||||
))}
|
||||
{data && data.domains.length === 0 && (
|
||||
<EmptyRow colSpan={canEdit ? 5 : 4} title="No domains tracked yet" hint={canEdit ? "Domains for your DNS zones appear after the next daily check, or when you press “Check all now”. You can also add one by hand above." : "Domains for your DNS zones appear after the next daily check."} />
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<Pagination page={page} pageCount={pageCount} totalCount={totalCount} onPageChange={setPage} />
|
||||
</div>
|
||||
|
||||
{data && (
|
||||
<div className="text-secondary small">
|
||||
Expiry is read daily from the registry — over RDAP where the TLD offers it, otherwise from its WHOIS server (.se and
|
||||
.nu, for example). You're reminded every day from {data.warnDays} days before a domain expires until it's renewed. A
|
||||
registry that doesn't publish expiry dates (.de, .eu) can be tracked but has no date to warn about.
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
@@ -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 />}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user