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
+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 ? (
|
||||
|
||||
Reference in new issue
Block a user