🎨 refactor(ui): modernize setup page
- Refactored system initialization page using TailwindCSS 3 and SemiUI components - Changed layout from step navigation to single page display for all configurations - Modified top area from vertical to more compact horizontal layout - Updated gradient color scheme from blue/purple to orange/pink - Fixed form field name duplication issues and optimized Form implementation - Changed usage mode selection from three-column grid to vertical layout - Replaced usage mode card icons from settings to more appropriate Layers icon - Added specific prompts for different database types (SQLite/MySQL/PostgreSQL) - Removed configuration summary section while keeping the initialization button - Fixed useSetupCheck issue by using SetupCheck as a direct component for proper redirection
This commit is contained in:
18
web/src/components/layout/SetupCheck.js
Normal file
18
web/src/components/layout/SetupCheck.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import React, { useContext, useEffect } from 'react';
|
||||
import { Navigate, useLocation } from 'react-router-dom';
|
||||
import { StatusContext } from '../../context/Status';
|
||||
|
||||
const SetupCheck = ({ children }) => {
|
||||
const [statusState] = useContext(StatusContext);
|
||||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
if (statusState?.status?.setup === false && location.pathname !== '/setup') {
|
||||
window.location.href = '/setup';
|
||||
}
|
||||
}, [statusState?.status?.setup, location.pathname]);
|
||||
|
||||
return children;
|
||||
};
|
||||
|
||||
export default SetupCheck;
|
||||
Reference in New Issue
Block a user