mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-12 20:15:26 +00:00
- 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.
50 lines
1.7 KiB
TypeScript
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>
|
|
);
|
|
}
|