Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/src/packages/frontend/admin/page.tsx
Views: 687
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45import { Collapse, CollapseProps } from "antd";6import { useState } from "react";78import { Icon, Title } from "@cocalc/frontend/components";9import { SiteLicenses } from "../site-licenses/admin/component";10import { RegistrationToken } from "./registration-token";11import SiteSettings from "./site-settings";12import { UsageStatistics } from "./stats/page";13import { SystemNotifications } from "./system-notifications";14import { UserSearch } from "./users/user-search";15import AIAvatar from "@cocalc/frontend/components/ai-avatar";16import { TestLLMAdmin } from "./llm";1718const headerStyle = { fontSize: "12pt" } as const;1920export function AdminPage() {21const [activeKey, setActiveKey] = useState<string[]>([]);2223const items: CollapseProps["items"] = [24{25key: "user-search",26label: (27<div style={headerStyle}>28<Icon name="users" style={{ marginRight: "8px" }} /> User Search29</div>30),31children: <UserSearch />,32},33{34key: "site-licenses",35label: (36<div style={headerStyle}>37<Icon name="key" style={{ marginRight: "8px" }} /> Licenses38</div>39),40children: <SiteLicenses />,41},42{43key: "site-settings",44label: (45<div style={headerStyle}>46<Icon name="gears" style={{ marginRight: "8px" }} /> Site Settings47</div>48),49children: (50<SiteSettings51close={() => {52setActiveKey(activeKey.filter((key) => key != "site-settings"));53}}54/>55),56},57{58key: "registration-tokens",59label: (60<div style={headerStyle}>61<Icon name="sign-in" style={{ marginRight: "8px" }} /> Registration62Tokens63</div>64),65children: <RegistrationToken />,66},67{68key: "system-notifications",69label: (70<div style={headerStyle}>71<Icon name="comment" style={{ marginRight: "8px" }} /> System72Notifications73</div>74),75children: <SystemNotifications />,76},77{78key: "usage-stats",79label: (80<div style={headerStyle}>81<Icon name="line-chart" style={{ marginRight: "8px" }} /> Usage82Statistics83</div>84),85children: <UsageStatistics />,86},87{88key: "llm-testing",89label: (90<div style={headerStyle}>91<AIAvatar size={16} style={{ marginRight: "8px" }} /> Test LLM92Integration93</div>94),95children: <TestLLMAdmin />,96},97];9899return (100<div101className="smc-vfill"102style={{103overflowY: "auto",104overflowX: "hidden",105padding: "30px 45px",106}}107>108<Title level={3}>Administration</Title>109<Collapse110destroyInactivePanel /* so that data is refreshed when they are shown */111activeKey={activeKey}112onChange={(activeKey) => {113setActiveKey(activeKey as string[]);114}}115items={items}116/>117</div>118);119}120121122