guardia-manager/frontend/src/App.tsx

98 lines
5.1 KiB
TypeScript

import { lazy, Suspense } from 'react'
import { Routes, Route, Navigate } from 'react-router-dom'
import { AppLayout } from './components/layout/AppLayout'
import { ProtectedRoute } from './components/common/ProtectedRoute'
const Login = lazy(() => import('./pages/Login'))
const Dashboard = lazy(() => import('./pages/Dashboard'))
const Servers = lazy(() => import('./pages/Servers'))
const CMDB = lazy(() => import('./pages/CMDB'))
const Deployments = lazy(() => import('./pages/Deployments'))
const Repos = lazy(() => import('./pages/Repos'))
const Users = lazy(() => import('./pages/Users'))
const Institutions = lazy(() => import('./pages/Institutions'))
const ApiKeys = lazy(() => import('./pages/ApiKeys'))
const AuditLog = lazy(() => import('./pages/AuditLog'))
const LLMManager = lazy(() => import('./pages/LLMManager'))
const ConfigEnv = lazy(() => import('./pages/ConfigEnv'))
const ConfigNginx = lazy(() => import('./pages/ConfigNginx'))
const Notifications = lazy(() => import('./pages/Notifications'))
const Licenses = lazy(() => import('./pages/Licenses'))
const ExportImport = lazy(() => import('./pages/ExportImport'))
const DrConsole = lazy(() => import('./pages/DrConsole'))
const NetworkConsole = lazy(() => import('./pages/NetworkConsole'))
const CsapConsole = lazy(() => import('./pages/CsapConsole'))
const ScrapingManager = lazy(() => import('./pages/ScrapingManager'))
// ── GUARDiA 확장 v3 ──
const KpiDashboard = lazy(() => import('./pages/KpiDashboard'))
const BiAnalytics = lazy(() => import('./pages/BiAnalytics'))
const BillingManage = lazy(() => import('./pages/BillingManage'))
const IntegrationHub = lazy(() => import('./pages/IntegrationHub'))
const AiPlatform = lazy(() => import('./pages/AiPlatform'))
// ── GUARDiA 기능 개선 v4 ──
const AppDistribution = lazy(() => import('./pages/AppDistribution'))
const NotificationRules = lazy(() => import('./pages/NotificationRules'))
const InstallGuide = lazy(() => import('./pages/InstallGuide'))
// ── 비즈니스 지원 도구 ──
const PerfTestStudio = lazy(() => import('./pages/PerfTestStudio'))
const JasperReports = lazy(() => import('./pages/JasperReports'))
const BidWatcher = lazy(() => import('./pages/BidWatcher'))
function Loading() {
return (
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center',
height: '60vh', color: '#94a3b8', gap: 10 }}>
<span style={{ width: 16, height: 16, border: '2px solid #4f6ef7',
borderTopColor: 'transparent', borderRadius: '50%',
animation: 'spin .6s linear infinite', display: 'inline-block' }} />
...
</div>
)
}
export default function App() {
return (
<Suspense fallback={<Loading />}>
<Routes>
<Route path="/login" element={<Login />} />
<Route path="/" element={<ProtectedRoute><AppLayout /></ProtectedRoute>}>
<Route index element={<Dashboard />} />
<Route path="servers" element={<Servers />} />
<Route path="cmdb" element={<CMDB />} />
<Route path="deployments" element={<Deployments />} />
<Route path="repos" element={<Repos />} />
<Route path="users" element={<Users />} />
<Route path="institutions" element={<Institutions />} />
<Route path="api-keys" element={<ApiKeys />} />
<Route path="audit" element={<AuditLog />} />
<Route path="llm" element={<LLMManager />} />
<Route path="config/env" element={<ConfigEnv />} />
<Route path="config/nginx" element={<ConfigNginx />} />
<Route path="notifications" element={<Notifications />} />
<Route path="licenses" element={<Licenses />} />
<Route path="export-import" element={<ExportImport />} />
<Route path="dr" element={<DrConsole />} />
<Route path="network" element={<NetworkConsole />} />
<Route path="csap" element={<CsapConsole />} />
<Route path="scraping" element={<ScrapingManager />} />
{/* GUARDiA 확장 v3 */}
<Route path="kpi" element={<KpiDashboard />} />
<Route path="bi" element={<BiAnalytics />} />
<Route path="billing" element={<BillingManage />} />
<Route path="integrations" element={<IntegrationHub />} />
<Route path="ai-platform" element={<AiPlatform />} />
{/* GUARDiA 기능 개선 v4 */}
<Route path="app-distribution" element={<AppDistribution />} />
<Route path="notification-rules" element={<NotificationRules />} />
<Route path="install-guide" element={<InstallGuide />} />
{/* 비즈니스 지원 도구 */}
<Route path="perf-test-studio" element={<PerfTestStudio />} />
<Route path="jasper-reports" element={<JasperReports />} />
<Route path="bid-watcher" element={<BidWatcher />} />
</Route>
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
</Suspense>
)
}