diff --git a/app/components/Dialog/Confirm.vue b/app/components/Dialog/Confirm.vue new file mode 100644 index 0000000..f4aeae8 --- /dev/null +++ b/app/components/Dialog/Confirm.vue @@ -0,0 +1,34 @@ + + + diff --git a/app/components/Dialog/CreateUser.vue b/app/components/Dialog/CreateUser.vue new file mode 100644 index 0000000..61014cc --- /dev/null +++ b/app/components/Dialog/CreateUser.vue @@ -0,0 +1,155 @@ + + + diff --git a/app/components/Dialog/index.vue b/app/components/Dialog/index.vue index 47f859a..f7bbdf9 100644 --- a/app/components/Dialog/index.vue +++ b/app/components/Dialog/index.vue @@ -4,6 +4,8 @@ import QuickSwitcher from './QuickSwitcher.vue'; import ChangePassword from './ChangePassword.vue'; import TwoFactor from './TwoFactor.vue'; import DeleteAccount from './DeleteAccount.vue'; +import Confirm from './Confirm.vue'; +import CreateUser from './CreateUser.vue'; import { DialogType } from '~/composables/useDialog'; @@ -69,6 +71,8 @@ onUnmounted(() => { + + diff --git a/app/components/Sidenav/NavSettings.vue b/app/components/Sidenav/NavSettings.vue index f1a55d8..e50232c 100644 --- a/app/components/Sidenav/NavSettings.vue +++ b/app/components/Sidenav/NavSettings.vue @@ -3,10 +3,21 @@ import { providerIcons } from '~/utils/model-mapping'; const route = useRoute(); const { providers } = await useModels(); +const { isAdmin } = useAuth(); -const groups = [ +const ADMIN_GROUP = { + label: 'Instance', + adminOnly: true, + items: [ + { to: '/settings/instance/users', name: 'Users', icon: 'i-mynaui-users' }, + { to: '/settings/instance', name: 'Instance', icon: 'i-tabler-server' }, + ], +}; + +const BASE_GROUPS = [ { label: 'Account', + adminOnly: false, items: [ { to: '/settings/profile', name: 'Profile', icon: 'i-mynaui-user' }, { to: '/settings/security', name: 'Security', icon: 'i-mynaui-shield' }, @@ -14,6 +25,7 @@ const groups = [ }, { label: 'App', + adminOnly: false, items: [ { to: '/settings/general', name: 'General', icon: 'i-mynaui-cog-four' }, { to: '/settings/appearance', name: 'Appearance', icon: 'i-tabler-palette' }, @@ -23,6 +35,8 @@ const groups = [ }, ]; +const groups = computed(() => isAdmin.value ? [...BASE_GROUPS, ADMIN_GROUP] : BASE_GROUPS); + const inProviders = computed(() => route.path.startsWith('/settings/providers')); // enabled providers first, same order the provider list uses @@ -35,8 +49,13 @@ const sortedProviders = computed(() => [