Fold four pages into the pages they belong to; add a Backups menu group
Dependencies become a view of the Map (graph with the editor under it), Sessions the 'Signed in now' tab of Users, the Audit Log the 'Raw audit log' tab of the Change log, and the Diagnostic Log the 'Call log' tab of Integrations (admins). Backup coverage and Proxmox Backup move to a new Backups group. Old addresses redirect; a shared ViewTabs component does the tabs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4e0c6927b2
commit
1432b148e9
19 files changed
+177
-102
No files matched your search
@@ -1,7 +1,9 @@
|
||||
import { useEffect, useState, type CSSProperties } from "react";
|
||||
import { useEffect, useState, type CSSProperties, type ReactNode } from "react";
|
||||
import { Link, useSearchParams } from "react-router-dom";
|
||||
import { api, type CurrentUser, type IntegrationSummary, type IntegrationType } from "../api/client";
|
||||
import IntegrationForm from "../components/IntegrationForm";
|
||||
import ViewTabs from "../components/ViewTabs";
|
||||
import DiagLogView from "../views/DiagLogView";
|
||||
import IntegrationEditForm from "../components/IntegrationEditForm";
|
||||
import TableToolbar from "../components/TableToolbar";
|
||||
import { useTableSearch } from "../hooks/useTableSearch";
|
||||
@@ -73,7 +75,35 @@ function typeBadgeStyle(colors: Record<string, string>, type: IntegrationType):
|
||||
return { backgroundColor: `${color}22`, color, border: `1px solid ${color}55` };
|
||||
}
|
||||
|
||||
const integrationTabs = (view: "list" | "calls") => (
|
||||
<ViewTabs
|
||||
label="Integrations view"
|
||||
tabs={[
|
||||
{ to: "/integrations", label: "Integrations", active: view === "list" },
|
||||
{ to: "/integrations?view=calls", label: "Call log", active: view === "calls" },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
/** The integrations, and — for administrators — the log of every call made to them (`?view=calls`), where a connection is troubleshot. */
|
||||
export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
const [params] = useSearchParams();
|
||||
const isAdmin = user.role === "admin";
|
||||
if (isAdmin && params.get("view") === "calls") {
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-2">
|
||||
<h2 className="page-title mb-0">Integrations</h2>
|
||||
</div>
|
||||
{integrationTabs("calls")}
|
||||
<DiagLogView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <IntegrationsList user={user} tabs={isAdmin ? integrationTabs("list") : null} />;
|
||||
}
|
||||
|
||||
function IntegrationsList({ user, tabs }: { user: CurrentUser; tabs: ReactNode }) {
|
||||
const isAdmin = user.role === "admin";
|
||||
const isOperator = user.role === "admin" || user.role === "operator";
|
||||
const [searchParams, setSearchParams] = useSearchParams();
|
||||
@@ -171,6 +201,7 @@ export default function Integrations({ user }: { user: CurrentUser }) {
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
{tabs}
|
||||
<ErrorNotice error={error} />
|
||||
|
||||
{editingIntegration ? (
|
||||
|
||||
Reference in new issue
Block a user