}
@@ -34,18 +36,11 @@ export default () => {
-
-
-
-
-
-
-
-
-
-
-
-
+ {routes.account.map(({ path, component: Component }) => (
+
+
+
+ ))}
diff --git a/resources/scripts/routers/routes.ts b/resources/scripts/routers/routes.ts
index e840604eb..51c6997c7 100644
--- a/resources/scripts/routers/routes.ts
+++ b/resources/scripts/routers/routes.ts
@@ -8,27 +8,63 @@ import NetworkContainer from '@/components/server/network/NetworkContainer';
import StartupContainer from '@/components/server/startup/StartupContainer';
import FileManagerContainer from '@/components/server/files/FileManagerContainer';
import SettingsContainer from '@/components/server/settings/SettingsContainer';
+import AccountOverviewContainer from '@/components/dashboard/AccountOverviewContainer';
+import AccountApiContainer from '@/components/dashboard/AccountApiContainer';
+import AccountSSHContainer from '@/components/dashboard/ssh/AccountSSHContainer';
+import ActivityLogContainer from '@/components/dashboard/activity/ActivityLogContainer';
+// Each of the router files is already code split out appropriately — so
+// all of the items above will only be loaded in when that router is loaded.
+//
+// These specific lazy loaded routes are to avoid loading in heavy screens
+// for the server dashboard when they're only needed for specific instances.
const FileEditContainer = lazy(() => import('@/components/server/files/FileEditContainer'));
const ScheduleEditContainer = lazy(() => import('@/components/server/schedules/ScheduleEditContainer'));
-interface ServerRouteDefinition {
+interface RouteDefinition {
path: string;
- permission: string | string[] | null;
// If undefined is passed this route is still rendered into the router itself
// but no navigation link is displayed in the sub-navigation menu.
name: string | undefined;
component: React.ComponentType;
- // The default for "exact" is assumed to be "true" unless you explicitly
- // pass it as false.
exact?: boolean;
}
+interface ServerRouteDefinition extends RouteDefinition {
+ permission: string | string[] | null;
+}
+
interface Routes {
+ // All of the routes available under "/account"
+ account: RouteDefinition[];
+ // All of the routes available under "/server/:id"
server: ServerRouteDefinition[];
}
export default {
+ account: [
+ {
+ path: '/',
+ name: 'Account',
+ component: AccountOverviewContainer,
+ exact: true,
+ },
+ {
+ path: '/api',
+ name: 'API Credentials',
+ component: AccountApiContainer,
+ },
+ {
+ path: '/ssh',
+ name: 'SSH Keys',
+ component: AccountSSHContainer,
+ },
+ {
+ path: '/activity',
+ name: 'Activity',
+ component: ActivityLogContainer,
+ },
+ ],
server: [
{
path: '/',