11import { useMemo , useState } from "react" ;
22import { createAdminClient } from "../api/client" ;
33import { ChatPanel } from "./panels/ChatPanel" ;
4+ import { DiagnosticsPanel } from "./panels/DiagnosticsPanel" ;
45import { ModelsPanel } from "./panels/ModelsPanel" ;
56import { PendingPanel } from "./panels/PendingPanel" ;
67import { PermissionsPanel } from "./panels/PermissionsPanel" ;
78import { RunsPanel } from "./panels/RunsPanel" ;
89import { SchedulesPanel } from "./panels/SchedulesPanel" ;
10+ import { SetupPanel } from "./panels/SetupPanel" ;
911import { SystemPanel } from "./panels/SystemPanel" ;
1012import { VfsPanel } from "./panels/VfsPanel" ;
1113import { Sidebar } from "./Sidebar" ;
@@ -14,7 +16,9 @@ import type { ViewId } from "./views";
1416const tokenKey = "serverless-agent:admin-token" ;
1517
1618export function App ( ) {
17- const [ active , setActive ] = useState < ViewId > ( "chat" ) ;
19+ const [ active , setActive ] = useState < ViewId > ( ( ) =>
20+ localStorage . getItem ( tokenKey ) ? "setup" : "system"
21+ ) ;
1822 const [ selectedRunId , setSelectedRunId ] = useState ( "" ) ;
1923 const [ token , setToken ] = useState ( ( ) => localStorage . getItem ( tokenKey ) ?? "" ) ;
2024 const [ notice , setNotice ] = useState < { message : string ; tone : "ok" | "error" } > ( ) ;
@@ -40,8 +44,12 @@ export function App() {
4044 < Sidebar active = { active } onChange = { setActive } />
4145 < main className = "main-surface" >
4246 { notice && < div className = { `notice ${ notice . tone } ` } > { notice . message } </ div > }
47+ { active === "setup" && (
48+ < SetupPanel client = { client } notify = { notify } onNavigate = { setActive } />
49+ ) }
4350 { active === "chat" && < ChatPanel client = { client } notify = { notify } onRun = { openRun } /> }
4451 { active === "models" && < ModelsPanel client = { client } notify = { notify } /> }
52+ { active === "diagnostics" && < DiagnosticsPanel client = { client } notify = { notify } /> }
4553 { active === "runs" && (
4654 < RunsPanel client = { client } notify = { notify } selectedRunId = { selectedRunId } />
4755 ) }
0 commit comments