testing: web-based server setup with automatic restart

- Add React setup form matching our design system
- Implement automatic server restart after configuration
- Add WelcomeChecker component for proper routing
- Update API to handle setup endpoints and restart logic
- Improve setup workflow with proper loading states and redirects

Testing complete setup workflow from welcome mode to login.
This commit is contained in:
Fimeg
2025-10-29 13:37:02 -04:00
parent 73fb8d49b0
commit 1f520fd9e6
7 changed files with 500 additions and 22 deletions

View File

@@ -255,6 +255,40 @@ export const authApi = {
},
};
// Setup API for server configuration (uses base API without auth)
const setupApiInstance = axios.create({
baseURL: API_BASE_URL,
timeout: 30000,
headers: {
'Content-Type': 'application/json',
},
});
export const setupApi = {
// Check server health and status
checkHealth: async (): Promise<{ status: string }> => {
const response = await setupApiInstance.get('/health');
return response.data;
},
// Submit server configuration
configure: async (config: {
adminUser: string;
adminPassword: string;
dbHost: string;
dbPort: string;
dbName: string;
dbUser: string;
dbPassword: string;
serverHost: string;
serverPort: string;
maxSeats: string;
}): Promise<{ message: string; configPath?: string; restart?: boolean }> => {
const response = await setupApiInstance.post('/setup', config);
return response.data;
},
};
// Utility functions
export const createQueryString = (params: Record<string, any>): string => {
const searchParams = new URLSearchParams();