diff options
Diffstat (limited to 'apps/settings/src/router/routes.ts')
-rw-r--r-- | apps/settings/src/router/routes.ts | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/apps/settings/src/router/routes.ts b/apps/settings/src/router/routes.ts new file mode 100644 index 00000000000..35b3b1306d5 --- /dev/null +++ b/apps/settings/src/router/routes.ts @@ -0,0 +1,63 @@ +/** + * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-License-Identifier: AGPL-3.0-or-later + */ +import type { RouteConfig } from 'vue-router' +import { loadState } from '@nextcloud/initial-state' + +const appstoreEnabled = loadState<boolean>('settings', 'appstoreEnabled', true) + +// Dynamic loading +const AppStore = () => import(/* webpackChunkName: 'settings-apps-view' */'../views/AppStore.vue') +const AppStoreNavigation = () => import(/* webpackChunkName: 'settings-apps-view' */'../views/AppStoreNavigation.vue') +const AppStoreSidebar = () => import(/* webpackChunkName: 'settings-apps-view' */'../views/AppStoreSidebar.vue') + +const UserManagement = () => import(/* webpackChunkName: 'settings-users' */'../views/UserManagement.vue') +const UserManagementNavigation = () => import(/* webpackChunkName: 'settings-users' */'../views/UserManagementNavigation.vue') + +const routes: RouteConfig[] = [ + { + name: 'users', + path: '/:index(index.php/)?settings/users', + components: { + default: UserManagement, + navigation: UserManagementNavigation, + }, + props: true, + children: [ + { + path: ':selectedGroup', + name: 'group', + }, + ], + }, + { + path: '/:index(index.php/)?settings/apps', + name: 'apps', + redirect: { + name: 'apps-category', + params: { + category: appstoreEnabled ? 'discover' : 'installed', + }, + }, + components: { + default: AppStore, + navigation: AppStoreNavigation, + sidebar: AppStoreSidebar, + }, + children: [ + { + path: ':category', + name: 'apps-category', + children: [ + { + path: ':id', + name: 'apps-details', + }, + ], + }, + ], + }, +] + +export default routes |