1- import React , { lazy , useEffect } from 'react' ;
1+ import React , { useEffect } from 'react' ;
22import { NavLink , Route , RouteComponentProps , Switch } from 'react-router-dom' ;
33import NavigationBar from '@/components/NavigationBar' ;
44import ServerConsole from '@/components/server/ServerConsole' ;
@@ -12,8 +12,6 @@ import FileManagerContainer from '@/components/server/files/FileManagerContainer
1212import { CSSTransition } from 'react-transition-group' ;
1313import SuspenseSpinner from '@/components/elements/SuspenseSpinner' ;
1414import FileEditContainer from '@/components/server/files/FileEditContainer' ;
15- import UsersContainer from '@/components/server/users/UsersContainer' ;
16- import ScheduleContainer from '@/components/server/schedules/ScheduleContainer' ;
1715import SettingsContainer from '@/components/server/settings/SettingsContainer' ;
1816
1917const ServerRouter = ( { match, location } : RouteComponentProps < { id : string } > ) => {
@@ -32,48 +30,44 @@ const ServerRouter = ({ match, location }: RouteComponentProps<{ id: string }>)
3230 < NavigationBar />
3331 < CSSTransition timeout = { 250 } classNames = { 'fade' } appear = { true } in = { true } >
3432 < div id = { 'sub-navigation' } >
35- < div className = { 'mx-auto' } style = { { maxWidth : '1200px' } } >
36- < div className = { 'items' } >
37- < NavLink to = { `${ match . url } ` } exact > Console</ NavLink >
38- < NavLink to = { `${ match . url } /files` } > File Manager</ NavLink >
39- < NavLink to = { `${ match . url } /databases` } > Databases</ NavLink >
40- { /* <NavLink to={`${match.url}/users` }>User Management</NavLink> */ }
41- { /* <NavLink to={`${match.url}/schedules` }>Schedules</NavLink> */ }
42- < NavLink to = { `${ match . url } /settings` } > Settings</ NavLink >
43- </ div >
33+ < div className = { 'items' } >
34+ < NavLink to = { `${ match . url } ` } exact > Console</ NavLink >
35+ < NavLink to = { `${ match . url } /files` } > File Manager</ NavLink >
36+ < NavLink to = { `${ match . url } /databases` } > Databases</ NavLink >
37+ { /* <NavLink to={`${match.url}/users` }>User Management</NavLink> */ }
38+ { /* <NavLink to={`${match.url}/schedules` }>Schedules</NavLink> */ }
39+ < NavLink to = { `${ match . url } /settings` } > Settings</ NavLink >
4440 </ div >
4541 </ div >
4642 </ CSSTransition >
4743 < Provider store = { ServerContext . useStore ( ) } >
4844 < WebsocketHandler />
4945 < TransitionRouter >
50- < div className = { 'w-full mx-auto px-3' } style = { { maxWidth : '1200px' } } >
51- { ! server ?
52- < div className = { 'flex justify-center m-20' } >
53- < Spinner size = { 'large' } />
54- </ div >
55- :
56- < React . Fragment >
57- < Switch location = { location } >
58- < Route path = { `${ match . path } ` } component = { ServerConsole } exact />
59- < Route path = { `${ match . path } /files` } component = { FileManagerContainer } exact />
60- < Route
61- path = { `${ match . path } /files/:action(edit|new)` }
62- render = { props => (
63- < SuspenseSpinner >
64- < FileEditContainer { ...props as any } />
65- </ SuspenseSpinner >
66- ) }
67- exact
68- />
69- < Route path = { `${ match . path } /databases` } component = { DatabasesContainer } exact />
70- { /* <Route path={`${match.path}/users` } component={UsersContainer} exact/> */ }
71- { /* <Route path={`${match.path}/schedules` } component={ScheduleContainer} exact/> */ }
72- < Route path = { `${ match . path } /settings` } component = { SettingsContainer } exact />
73- </ Switch >
74- </ React . Fragment >
75- }
76- </ div >
46+ { ! server ?
47+ < div className = { 'flex justify-center m-20' } >
48+ < Spinner size = { 'large' } />
49+ </ div >
50+ :
51+ < React . Fragment >
52+ < Switch location = { location } >
53+ < Route path = { `${ match . path } ` } component = { ServerConsole } exact />
54+ < Route path = { `${ match . path } /files` } component = { FileManagerContainer } exact />
55+ < Route
56+ path = { `${ match . path } /files/:action(edit|new)` }
57+ render = { props => (
58+ < SuspenseSpinner >
59+ < FileEditContainer { ...props as any } />
60+ </ SuspenseSpinner >
61+ ) }
62+ exact
63+ />
64+ < Route path = { `${ match . path } /databases` } component = { DatabasesContainer } exact />
65+ { /* <Route path={`${match.path}/users` } component={UsersContainer} exact/> */ }
66+ { /* <Route path={`${match.path}/schedules` } component={ScheduleContainer} exact/> */ }
67+ < Route path = { `${ match . path } /settings` } component = { SettingsContainer } exact />
68+ </ Switch >
69+ </ React . Fragment >
70+ }
7771 </ TransitionRouter >
7872 </ Provider >
7973 </ React . Fragment >
0 commit comments