This commit is contained in:
2026-02-16 19:34:35 +00:00
commit 9ab0940ca4
784 changed files with 41710 additions and 0 deletions
+70
View File
@@ -0,0 +1,70 @@
import { BrowserRouter, Routes, Route, Navigate } from 'react-router';
import { useAuth } from 'hooks/useAuth';
import { useServerSettings } from '@/state/useServerSettings';
import { useInitialData } from '@/state/useInitialData';
import { LandingPage, AuthLayout } from './Screens/LandingPage';
import { Home } from './Screens/Dashboard/Home';
import { Profile } from './Screens/Dashboard/Profile';
import { ClaudeSessions, ClaudeChat, OpenCodeChat, NewChat } from './Screens/Dashboard/Chat';
import { Plans } from './Screens/Dashboard/Plans';
import { Skills } from './Screens/Dashboard/Skills';
import { Tasks } from './Screens/Dashboard/Tasks';
import { Processes } from './Screens/Dashboard/Processes';
import { TaskLogs } from './Screens/Dashboard/TaskLogs';
import { SignoutScreen } from './Screens/Dashboard/SignoutScreen';
import { Screen as Files } from 'plugins/FileBrowser/client';
import { Screen as Terminal } from 'plugins/Terminal/client';
import { AISettings } from './Screens/Dashboard/Settings/AISettings';
import { ServerSettings } from './Screens/Dashboard/ServerSettings';
import { Applications } from './Screens/Dashboard/Applications';
import { OnboardingAdmin } from './Screens/Dashboard/OnboardingAdmin';
export function App() {
const { isLoading, isAuthenticated } = useAuth();
const { onboardingComplete, plugins, isLoading: isServerSettingsLoading } = useServerSettings();
useInitialData();
if (isLoading || isServerSettingsLoading) return null;
return (
<BrowserRouter>
{!isAuthenticated && (
<Routes>
<Route path="/" element={<LandingPage />} />
<Route path="/auth/*" element={<AuthLayout />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
)}
{isAuthenticated && !onboardingComplete && (
<Routes>
<Route path="/onboarding-admin" element={<OnboardingAdmin />} />
<Route path="/auth/signout" element={<SignoutScreen />} />
<Route path="*" element={<Navigate to="/onboarding-admin" replace />} />
</Routes>
)}
{isAuthenticated && onboardingComplete && (
<Routes>
<Route path="/" element={<Home />} />
<Route path="/settings/profile" element={<Profile />} />
<Route path="/chat" element={<ClaudeSessions />} />
<Route path="/chat/new" element={<NewChat />} />
<Route path="/chat/:sessionId" element={<ClaudeChat />} />
<Route path="/chat/opencode/new" element={<OpenCodeChat />} />
<Route path="/chat/opencode/:sessionId" element={<OpenCodeChat />} />
{plugins?.FileBrowser !== false && <Route path="/files" element={<Files />} />}
{plugins?.Terminal !== false && <Route path="/terminal" element={<Terminal />} />}
<Route path="/settings/ai" element={<AISettings />} />
<Route path="/settings/server" element={<ServerSettings />} />
<Route path="/settings/applications" element={<Applications />} />
<Route path="/plans" element={<Plans />} />
<Route path="/skills" element={<Skills />} />
<Route path="/tasks" element={<Tasks />} />
<Route path="/processes" element={<Processes />} />
<Route path="/task-logs" element={<TaskLogs />} />
<Route path="/auth/signout" element={<SignoutScreen />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
)}
</BrowserRouter>
);
}