@@ -8,27 +8,63 @@ import NetworkContainer from '@/components/server/network/NetworkContainer';
88import StartupContainer from '@/components/server/startup/StartupContainer' ;
99import FileManagerContainer from '@/components/server/files/FileManagerContainer' ;
1010import SettingsContainer from '@/components/server/settings/SettingsContainer' ;
11+ import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer' ;
12+ import AccountApiContainer from '@/components/dashboard/AccountApiContainer' ;
13+ import AccountSSHContainer from '@/components/dashboard/ssh/AccountSSHContainer' ;
14+ import ActivityLogContainer from '@/components/dashboard/activity/ActivityLogContainer' ;
1115
16+ // Each of the router files is already code split out appropriately — so
17+ // all of the items above will only be loaded in when that router is loaded.
18+ //
19+ // These specific lazy loaded routes are to avoid loading in heavy screens
20+ // for the server dashboard when they're only needed for specific instances.
1221const FileEditContainer = lazy ( ( ) => import ( '@/components/server/files/FileEditContainer' ) ) ;
1322const ScheduleEditContainer = lazy ( ( ) => import ( '@/components/server/schedules/ScheduleEditContainer' ) ) ;
1423
15- interface ServerRouteDefinition {
24+ interface RouteDefinition {
1625 path : string ;
17- permission : string | string [ ] | null ;
1826 // If undefined is passed this route is still rendered into the router itself
1927 // but no navigation link is displayed in the sub-navigation menu.
2028 name : string | undefined ;
2129 component : React . ComponentType ;
22- // The default for "exact" is assumed to be "true" unless you explicitly
23- // pass it as false.
2430 exact ?: boolean ;
2531}
2632
33+ interface ServerRouteDefinition extends RouteDefinition {
34+ permission : string | string [ ] | null ;
35+ }
36+
2737interface Routes {
38+ // All of the routes available under "/account"
39+ account : RouteDefinition [ ] ;
40+ // All of the routes available under "/server/:id"
2841 server : ServerRouteDefinition [ ] ;
2942}
3043
3144export default {
45+ account : [
46+ {
47+ path : '/' ,
48+ name : 'Account' ,
49+ component : AccountOverviewContainer ,
50+ exact : true ,
51+ } ,
52+ {
53+ path : '/api' ,
54+ name : 'API Credentials' ,
55+ component : AccountApiContainer ,
56+ } ,
57+ {
58+ path : '/ssh' ,
59+ name : 'SSH Keys' ,
60+ component : AccountSSHContainer ,
61+ } ,
62+ {
63+ path : '/activity' ,
64+ name : 'Activity' ,
65+ component : ActivityLogContainer ,
66+ } ,
67+ ] ,
3268 server : [
3369 {
3470 path : '/' ,
0 commit comments