-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
143 additions
and
131 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
import React from 'react'; | ||
import ApplicationRoutes from "./config/ApplicationRoutes"; | ||
function App() { | ||
//process.env.REACT_APP_CYCLOPS_CTRL_HOST = 'http://localhost:8080' | ||
import { | ||
createBrowserRouter, | ||
RouterProvider, | ||
} from "react-router-dom" | ||
import routes from "./routes" | ||
import Page404 from "./components/pages/Page404" | ||
import AppLayout from "./components/layouts/AppLayout"; | ||
|
||
export default function App() { | ||
const router = createBrowserRouter([ | ||
{ | ||
element: <AppLayout />, | ||
errorElement: <Page404 />, | ||
children: routes | ||
}, | ||
]) | ||
|
||
return ( | ||
<ApplicationRoutes /> | ||
); | ||
} | ||
export default App; | ||
<RouterProvider router={router} /> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import {Outlet} from "react-router-dom"; | ||
import SideNav from "./sidebar"; | ||
import {Suspense} from "react"; | ||
import Sider from "antd/es/layout/Sider"; | ||
import {Content, Header} from "antd/es/layout/layout"; | ||
import {Layout} from 'antd'; | ||
|
||
export default function AppLayout() { | ||
return ( | ||
<Layout> | ||
<Sider> | ||
<SideNav/> | ||
</Sider> | ||
<Layout> | ||
<Header/> | ||
<Content style={{margin: '24px 16px', padding: 24, minHeight: "calc(100vh - 112px)", background: "#fff"}}> | ||
<Suspense fallback={<h1 style={{textAlign: "center"}}>Loading...</h1>}> | ||
<Outlet/> | ||
</Suspense> | ||
</Content> | ||
</Layout> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Sider from "antd/es/layout/Sider"; | ||
import SideNav from "../layouts/sidebar"; | ||
import {Layout} from "antd"; | ||
import {Content, Header} from "antd/es/layout/layout"; | ||
|
||
export default function Page404() { | ||
return ( | ||
<Layout> | ||
<Sider> | ||
<SideNav/> | ||
</Sider> | ||
<Layout> | ||
<Header/> | ||
<Content style={{margin: '24px 16px', padding: 24, minHeight: "calc(100vh - 112px)", background: "#fff"}}> | ||
<h1 style={{ | ||
verticalAlign: "center", | ||
textAlign: "center" | ||
}}>Page not found :/</h1> | ||
</Content> | ||
</Layout> | ||
</Layout> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const PathConstants = { | ||
HOME: "/", | ||
MODULES: "/modules", | ||
MODULE_NEW: "/modules/new", | ||
MODULE_GET: "/modules/:moduleName", | ||
MODULE_EDIT: "/modules/:moduleName/edit", | ||
MODULE_ROLLBACK: "/modules/:moduleName/rollback", | ||
NODES: "/nodes", | ||
NODE_GET: "/nodes/:nodeName" | ||
} | ||
|
||
export default PathConstants |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React from "react" | ||
import PathConstants from "./PathConstants" | ||
|
||
const Home = React.lazy(() => import("../components/pages/modules")) | ||
const Modules = React.lazy(() => import("../components/pages/modules")) | ||
const NewModule = React.lazy(() => import("../components/pages/new_module")) | ||
const ModuleDetails = React.lazy(() => import("../components/pages/module_details")) | ||
const EditModule = React.lazy(() => import("../components/pages/edit_module")) | ||
const ModuleHistory = React.lazy(() => import("../components/pages/history")) | ||
const Nodes = React.lazy(() => import("../components/pages/nodes")) | ||
const NodeDetails = React.lazy(() => import("../components/pages/node_details")) | ||
|
||
|
||
const routes = [ | ||
{ path: PathConstants.HOME, element: <Home /> }, | ||
{ path: PathConstants.MODULES, element: <Modules /> }, | ||
{ path: PathConstants.MODULE_NEW, element: <NewModule /> }, | ||
{ path: PathConstants.MODULE_GET, element: <ModuleDetails /> }, | ||
{ path: PathConstants.MODULE_EDIT, element: <EditModule /> }, | ||
{ path: PathConstants.MODULE_ROLLBACK, element: <ModuleHistory /> }, | ||
{ path: PathConstants.NODES, element: <Nodes /> }, | ||
{ path: PathConstants.NODE_GET, element: <NodeDetails /> } | ||
] | ||
|
||
export default routes |