diff --git a/src/frontend/src/App.jsx b/src/frontend/src/App.jsx
index 5322ded..8bf93dd 100644
--- a/src/frontend/src/App.jsx
+++ b/src/frontend/src/App.jsx
@@ -1,14 +1,17 @@
-import { Route, Routes } from 'react-router-dom';
-import Welcome from '@/pages/Welcome';
-import Dashboard from '@/pages/Dashboard';
+import { BrowserRouter, Routes, Route } from 'react-router-dom';
+import AppShell from '@/components/system/layout/AppShell';
+import buildRoutes from '@/constants/routes/routes';
const App = () => {
return (
-
- } />
- } />
-
+
+
+ }>
+ {buildRoutes()}
+
+
+
);
};
-export default App;
\ No newline at end of file
+export default App;
diff --git a/src/frontend/src/components/pages/welcome/DashboardCard.jsx b/src/frontend/src/components/pages/welcome/DashboardCard.jsx
new file mode 100644
index 0000000..67bed13
--- /dev/null
+++ b/src/frontend/src/components/pages/welcome/DashboardCard.jsx
@@ -0,0 +1,10 @@
+import manageIcon from '@/resources/welcome/image/setting.svg';
+import MotionCard from '@/components/ui/MotionCard';
+import { useNavigate } from 'react-router-dom';
+
+const DashboardCard = () => {
+ const navigate = useNavigate();
+ return navigate('/dashboard')} />;
+};
+
+export default DashboardCard;
diff --git a/src/frontend/src/components/pages/welcome/GithubCard.jsx b/src/frontend/src/components/pages/welcome/GithubCard.jsx
new file mode 100644
index 0000000..86f4f77
--- /dev/null
+++ b/src/frontend/src/components/pages/welcome/GithubCard.jsx
@@ -0,0 +1,14 @@
+import githubIcon from '@/resources/welcome/image/github.svg';
+import MotionCard from '@/components/ui/MotionCard';
+
+const GithubCard = () => {
+ return (
+ window.open('https://github.com/Jerryplusy/AI-powered-switches', '_blank')}
+ />
+ );
+};
+
+export default GithubCard;
diff --git a/src/frontend/src/components/pages/welcome/WelcomeContent.jsx b/src/frontend/src/components/pages/welcome/WelcomeContent.jsx
index aa09ef6..48471e5 100644
--- a/src/frontend/src/components/pages/welcome/WelcomeContent.jsx
+++ b/src/frontend/src/components/pages/welcome/WelcomeContent.jsx
@@ -1,32 +1,20 @@
import { Box, Heading, Text, VStack } from '@chakra-ui/react';
-import githubIcon from '@/resources/welcome/image/github.svg';
-import manageIcon from '@/resources/welcome/image/setting.svg';
-import MotionCard from '@/components/ui/MotionCard';
-import { useNavigate } from 'react-router-dom';
+import DashboardCard from '@/components/pages/welcome/DashboardCard';
const WelcomeContent = () => {
- const navigate = useNavigate();
-
return (
-
+
-
+
智能网络交换机
管理系统
-
+
助力大型网络交换机配置及网络流量管理,方便的管控网络,让网络配置不再困难
-
- navigate('/dashboard')} />
-
- window.open('https://github.com/Jerryplusy/AI-powered-switches', '_blank')}
- />
+
);
};
diff --git a/src/frontend/src/components/system/layout/AppShell.jsx b/src/frontend/src/components/system/layout/AppShell.jsx
new file mode 100644
index 0000000..c33b395
--- /dev/null
+++ b/src/frontend/src/components/system/layout/AppShell.jsx
@@ -0,0 +1,22 @@
+import { Outlet, useLocation } from 'react-router-dom';
+import PageTransition from './PageTransition';
+import { Box } from '@chakra-ui/react';
+import { AnimatePresence } from 'framer-motion';
+
+const AppShell = () => {
+ const location = useLocation();
+
+ return (
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default AppShell;
diff --git a/src/frontend/src/components/system/layout/GithubNavTransition.jsx b/src/frontend/src/components/system/layout/GithubNavTransition.jsx
new file mode 100644
index 0000000..704e275
--- /dev/null
+++ b/src/frontend/src/components/system/layout/GithubNavTransition.jsx
@@ -0,0 +1,53 @@
+import { useLocation } from 'react-router-dom';
+import { motion, AnimatePresence } from 'framer-motion';
+import { Box, Text, Image } from '@chakra-ui/react';
+import githubIcon from '@/resources/welcome/image/github.svg';
+
+const GithubNavTransition = () => {
+ const { pathname } = useLocation();
+ const isDashboard = pathname.startsWith('/dashboard');
+
+ return (
+
+
+ window.open('https://github.com/Jerryplusy/AI-powered-switches', '_blank')}
+ >
+
+ {isDashboard && (
+
+ GitHub 项目主页
+
+ )}
+
+
+
+ );
+};
+
+export default GithubNavTransition;
diff --git a/src/frontend/src/components/system/layout/PageTransition.jsx b/src/frontend/src/components/system/layout/PageTransition.jsx
new file mode 100644
index 0000000..e1e84ca
--- /dev/null
+++ b/src/frontend/src/components/system/layout/PageTransition.jsx
@@ -0,0 +1,13 @@
+import { motion } from 'framer-motion';
+
+const PageTransition = ({ children }) => (
+
+ {children}
+
+);
+
+export default PageTransition;
diff --git a/src/frontend/src/constants/keep b/src/frontend/src/constants/keep
deleted file mode 100644
index e69de29..0000000
diff --git a/src/frontend/src/constants/routes/routes.jsx b/src/frontend/src/constants/routes/routes.jsx
new file mode 100644
index 0000000..7170259
--- /dev/null
+++ b/src/frontend/src/constants/routes/routes.jsx
@@ -0,0 +1,13 @@
+import { Route } from 'react-router-dom';
+import Welcome from '@/pages/Welcome';
+import Dashboard from '@/pages/Dashboard';
+
+const routeList = [
+ { path: '/', element: },
+ { path: '/dashboard', element: },
+];
+
+const buildRoutes = () =>
+ routeList.map(({ path, element }) => );
+
+export default buildRoutes;
diff --git a/src/frontend/src/index.js b/src/frontend/src/index.js
index aca27d5..d021c8d 100644
--- a/src/frontend/src/index.js
+++ b/src/frontend/src/index.js
@@ -1,14 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from '@/App';
-import { BrowserRouter } from 'react-router-dom';
import { Provider } from '@/components/ui/provider';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
-
-
-
+
);
diff --git a/src/frontend/src/pages/Welcome.jsx b/src/frontend/src/pages/Welcome.jsx
index c14ee59..9d0b659 100644
--- a/src/frontend/src/pages/Welcome.jsx
+++ b/src/frontend/src/pages/Welcome.jsx
@@ -1,11 +1,15 @@
import { Box } from '@chakra-ui/react';
import BackgroundBlur from '@/components/pages/welcome/BackgroundBlur';
import WelcomeContent from '@/components/pages/welcome/WelcomeContent';
+import GithubCard from '@/components/pages/welcome/GithubCard';
const Welcome = () => {
return (
+
+
+