Add frontend wiring for setup wizard — setupAPI, SetupGuard, /setup route
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -42,6 +42,8 @@ import Login from './pages/Login';
|
|||||||
import AccountSettings from './pages/AccountSettings';
|
import AccountSettings from './pages/AccountSettings';
|
||||||
import PeerDashboard from './pages/PeerDashboard';
|
import PeerDashboard from './pages/PeerDashboard';
|
||||||
import MyServices from './pages/MyServices';
|
import MyServices from './pages/MyServices';
|
||||||
|
import Setup from './pages/Setup';
|
||||||
|
import SetupGuard from './components/SetupGuard';
|
||||||
|
|
||||||
function PendingRestartBanner({ pending, onApply, onCancel }) {
|
function PendingRestartBanner({ pending, onApply, onCancel }) {
|
||||||
const [confirming, setConfirming] = useState(false);
|
const [confirming, setConfirming] = useState(false);
|
||||||
@@ -264,7 +266,9 @@ function AppCore() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Router>
|
<Router>
|
||||||
|
<SetupGuard>
|
||||||
<Routes>
|
<Routes>
|
||||||
|
<Route path="/setup" element={<Setup />} />
|
||||||
<Route path="/login" element={<Login />} />
|
<Route path="/login" element={<Login />} />
|
||||||
<Route path="*" element={
|
<Route path="*" element={
|
||||||
<ConfigProvider>
|
<ConfigProvider>
|
||||||
@@ -350,6 +354,7 @@ function AppCore() {
|
|||||||
</ConfigProvider>
|
</ConfigProvider>
|
||||||
} />
|
} />
|
||||||
</Routes>
|
</Routes>
|
||||||
|
</SetupGuard>
|
||||||
</Router>
|
</Router>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -311,6 +311,13 @@ export const logsAPI = {
|
|||||||
setVerbosity: (levels) => api.put('/api/logs/verbosity', levels),
|
setVerbosity: (levels) => api.put('/api/logs/verbosity', levels),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Setup Wizard API
|
||||||
|
export const setupAPI = {
|
||||||
|
getStatus: () => api.get('/api/setup/status'),
|
||||||
|
validate: (step, data) => api.post('/api/setup/validate', { step, data }),
|
||||||
|
complete: (payload) => api.post('/api/setup/complete', payload),
|
||||||
|
};
|
||||||
|
|
||||||
// Container Management API
|
// Container Management API
|
||||||
export const containerAPI = {
|
export const containerAPI = {
|
||||||
// Containers
|
// Containers
|
||||||
|
|||||||
Reference in New Issue
Block a user