Add account related routes to router file

This commit is contained in:
DaneEveritt 2022-06-12 13:33:25 -04:00
parent 7197d28815
commit b50e722948
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 58 additions and 27 deletions

View file

@ -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: '/',