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
+32
-2
@@ -1,5 +1,7 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useEffect, useState, type ReactNode } from "react";
|
||||
import { Link, useSearchParams } from "react-router-dom";
|
||||
import ViewTabs from "../components/ViewTabs";
|
||||
import SessionsView from "../views/SessionsView";
|
||||
import { api, type UserRecord, type UserRole } from "../api/client";
|
||||
import { formatDateTime } from "../utils/date";
|
||||
import { useSortable } from "../hooks/useSortable";
|
||||
@@ -13,7 +15,34 @@ import Avatar from "../components/Avatar";
|
||||
|
||||
const ROLES: UserRole[] = ["viewer", "operator", "admin"];
|
||||
|
||||
/** People and Signed in now: who has an account and what they may do, and who is signed in at this moment. Switched by `?view=sessions`. */
|
||||
const userTabs = (view: "people" | "sessions") => (
|
||||
<ViewTabs
|
||||
label="Users view"
|
||||
tabs={[
|
||||
{ to: "/users", label: "People", active: view === "people" },
|
||||
{ to: "/users?view=sessions", label: "Signed in now", active: view === "sessions" },
|
||||
]}
|
||||
/>
|
||||
);
|
||||
|
||||
export default function Users() {
|
||||
const [params] = useSearchParams();
|
||||
if (params.get("view") === "sessions") {
|
||||
return (
|
||||
<>
|
||||
<div className="d-flex align-items-center mb-2">
|
||||
<h2 className="page-title mb-0">Users</h2>
|
||||
</div>
|
||||
{userTabs("sessions")}
|
||||
<SessionsView />
|
||||
</>
|
||||
);
|
||||
}
|
||||
return <People tabs={userTabs("people")} />;
|
||||
}
|
||||
|
||||
function People({ tabs }: { tabs: ReactNode }) {
|
||||
const [users, setUsers] = useState<UserRecord[] | null>(null);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [savingId, setSavingId] = useState<number | null>(null);
|
||||
@@ -65,6 +94,7 @@ export default function Users() {
|
||||
Export CSV
|
||||
</button>
|
||||
</div>
|
||||
{tabs}
|
||||
<ErrorNotice error={error} />
|
||||
{followGroups && (
|
||||
<div className="alert alert-info">
|
||||
|
||||
Reference in new issue
Block a user