Files
DocsGPT/frontend/src/admin/index.tsx
T
arc53-machine 2411118048 Show which service did what, and let owners pick whose account a share uses
- Tool chips and the streaming status name the service: "Searched
  Notion", "Used Linear: create issue". Citations from a connector
  source read "From Google Drive".
- The share dialog for a connection-backed tool asks whose account team
  members use. Owner mode warns which account they act as and needs an
  explicit OK when the tool can write; an admin-forced mode is locked.
- Admin > Connectors: enable or disable each connector, force a sharing
  mode, allow custom MCP servers, and a setup guide per OAuth connector
  with its redirect URI and the server settings still missing. Warns
  when credentials use the default encryption key.
- The composer and the agent builder group tools by connection, and the
  Sources and Tools popovers link to Connect more.
- MCP presets open the server form titled after the service.
2026-09-28 17:55:56 +01:00

50 lines
1.7 KiB
TypeScript

import { Navigate, Route, Routes, useLocation } from 'react-router-dom';
import { useMediaQuery } from '../hooks';
import SectionIndexPage from '../navigation/SectionIndexPage';
import SectionShell from '../navigation/SectionShell';
import { ADMIN_SECTION } from '../navigation/sections';
import Admins from './Admins';
import Activity from './Activity';
import Overview from './Overview';
import Quotas from './Quotas';
import Connectors from './Connectors';
import Usage from './Usage';
import Users from './Users';
/**
* Admin dashboard (operator-level, global admin). Reached only via <AdminRoute>
* (cosmetic guard); every endpoint it calls is independently @admin_required on
* the server. Navigation lives in the sidebar, like the settings section.
*/
export default function Admin() {
const location = useLocation();
const { isMobile } = useMediaQuery();
const showIndex = isMobile && location.pathname === ADMIN_SECTION.rootPath;
if (showIndex) {
return (
<SectionShell width="wide" header={false}>
<SectionIndexPage section={ADMIN_SECTION} />
</SectionShell>
);
}
return (
<SectionShell width="wide">
<Routes>
<Route index element={<Overview />} />
<Route path="overview" element={<Overview />} />
<Route path="users" element={<Users />} />
<Route path="roles" element={<Admins />} />
<Route path="usage" element={<Usage />} />
<Route path="quotas" element={<Quotas />} />
<Route path="connectors" element={<Connectors />} />
<Route path="audit" element={<Activity />} />
<Route path="*" element={<Navigate to="/admin" replace />} />
</Routes>
</SectionShell>
);
}