mirror of
https://github.com/Jerryplusy/AI-powered-switches.git
synced 2025-07-04 13:19:20 +00:00
修正错误的依赖&添加示例页面
This commit is contained in:
parent
47a26d0232
commit
dce6523f3c
4
.idea/AI-powered-switches.iml
generated
4
.idea/AI-powered-switches.iml
generated
@ -1,7 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PYTHON_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<excludeFolder url="file://$MODULE_DIR$/.venv" />
|
||||
</content>
|
||||
<orderEntry type="jdk" jdkName="Python 3.13" jdkType="Python SDK" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
|
1
.idea/prettier.xml
generated
1
.idea/prettier.xml
generated
@ -3,5 +3,6 @@
|
||||
<component name="PrettierConfiguration">
|
||||
<option name="myConfigurationMode" value="AUTOMATIC" />
|
||||
<option name="myRunOnSave" value="true" />
|
||||
<option name="myRunOnReformat" value="true" />
|
||||
</component>
|
||||
</project>
|
5
src/frontend/.prettierignore
Normal file
5
src/frontend/.prettierignore
Normal file
@ -0,0 +1,5 @@
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
.next
|
||||
coverage
|
8
src/frontend/config-overrides.js
Normal file
8
src/frontend/config-overrides.js
Normal file
@ -0,0 +1,8 @@
|
||||
const path = require('path');
|
||||
const { override, addWebpackAlias } = require('customize-cra');
|
||||
|
||||
module.exports = override(
|
||||
addWebpackAlias({
|
||||
'@': path.resolve(__dirname, 'src'),
|
||||
}),
|
||||
);
|
@ -13,7 +13,6 @@
|
||||
"axios": "^1.9.0",
|
||||
"framer-motion": "^12.14.0",
|
||||
"next-themes": "^0.4.6",
|
||||
"prettierrc": "0.0.0-5",
|
||||
"react": "^19.1.0",
|
||||
"react-dom": "^19.1.0",
|
||||
"react-icons": "^5.5.0",
|
||||
@ -24,10 +23,11 @@
|
||||
"webpack": "^5.99.9"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
"start": "react-app-rewired start",
|
||||
"build": "react-app-rewired build",
|
||||
"test": "react-app-rewired test",
|
||||
"eject": "react-scripts eject",
|
||||
"format": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\""
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
@ -48,9 +48,12 @@
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"customize-cra": "^1.0.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-plugin-react": "^7.37.5",
|
||||
"eslint-plugin-react-hooks": "^4.3.0"
|
||||
"eslint-plugin-react-hooks": "^4.3.0",
|
||||
"prettier": "^3.5.3",
|
||||
"react-app-rewired": "^2.2.1"
|
||||
}
|
||||
}
|
||||
|
799
src/frontend/pnpm-lock.yaml
generated
799
src/frontend/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@ -1,9 +1,9 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>React App</title>
|
||||
<title>网络管理后台</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
@ -1,20 +1,14 @@
|
||||
import React from 'react';
|
||||
//import { Button, HStack } from '@chakra-ui/react';
|
||||
//import { Routes, Route } from 'react-router-dom';
|
||||
//import Dashboard from './pages/Dashboard';
|
||||
//import Configuration from './pages/Configuration';
|
||||
//import Header from './components/Header';
|
||||
//import { Box, Button } from '@chakra-ui/react';
|
||||
import { Route, Routes } from 'react-router-dom';
|
||||
import Welcome from '@/pages/Welcome';
|
||||
import Dashboard from '@/pages/Dashboard';
|
||||
|
||||
const App = () => (//待扩展
|
||||
<>
|
||||
</>
|
||||
const App = () => {
|
||||
return (
|
||||
<Routes>
|
||||
<Route path={'/'} element={<Welcome />} />
|
||||
<Route path={'/dashboard'} element={<Dashboard />} />
|
||||
</Routes>
|
||||
);
|
||||
};
|
||||
|
||||
/**备用
|
||||
* <Routes>
|
||||
* <Route path="/" element={<Dashboard />} />
|
||||
* <Route path="/config" element={<Configuration />} />
|
||||
* </Routes>
|
||||
*/
|
||||
export default App;
|
@ -0,0 +1,20 @@
|
||||
import React from 'react';
|
||||
import { Box, Flex, Heading, Spacer, Button } from '@chakra-ui/react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const Header = () => {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<Box bg={'teal.500'} px={4} py={2} color={'white'}>
|
||||
<Flex align={'center'}>
|
||||
<Heading size={'md'}>网络管理后台</Heading>
|
||||
<Spacer />
|
||||
<Button varint={'ghost'} color={'white'} onClick={() => navigate('/')}>
|
||||
返回欢迎页
|
||||
</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Header;
|
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { Box, Text } from '@chakra-ui/react';
|
||||
import Header from '../components/Header';
|
||||
|
||||
const Dashboard = () => {
|
||||
return (
|
||||
<>
|
||||
<Header />
|
||||
<Box p={6}>
|
||||
<Text fontSize={'xl'}>控制台奇怪的功能+1</Text>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Dashboard;
|
21
src/frontend/src/pages/Welcome.jsx
Normal file
21
src/frontend/src/pages/Welcome.jsx
Normal file
@ -0,0 +1,21 @@
|
||||
import React from 'react';
|
||||
import { Box, Button, Heading, VStack } from '@chakra-ui/react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
|
||||
const Welcome = () => {
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<Box textAlign={'center'} py={10} px={6}>
|
||||
<VStack spacing={4}>
|
||||
<Heading as={'h1'} size={'x1'}>
|
||||
欢迎使用交换机管理后台
|
||||
</Heading>
|
||||
<Button colorScheme={'teal'} onClick={() => navigate('/dashboard')}>
|
||||
进入控制台
|
||||
</Button>
|
||||
</VStack>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
export default Welcome;
|
Loading…
x
Reference in New Issue
Block a user