mirror of https://github.com/nocodb/nocodb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.3 KiB
47 lines
1.3 KiB
<script setup lang="ts"> |
|
import { isDrawerOrModalExist, isMac, useRoute, useUIPermission } from '#imports' |
|
|
|
const route = useRoute() |
|
|
|
const showUserModal = ref(false) |
|
|
|
const { isUIAllowed } = useUIPermission() |
|
|
|
const isShareBaseAllowed = computed( |
|
() => |
|
isUIAllowed('newUser') && |
|
route.name !== 'index' && |
|
route.name !== 'index-index-create' && |
|
route.name !== 'index-index-create-external' && |
|
route.name !== 'index-user-index', |
|
) |
|
|
|
useEventListener(document, 'keydown', async (e: KeyboardEvent) => { |
|
const cmdOrCtrl = isMac() ? e.metaKey : e.ctrlKey |
|
if (e.altKey && !e.shiftKey && !cmdOrCtrl) { |
|
switch (e.keyCode) { |
|
case 73: { |
|
// ALT + I |
|
if (isShareBaseAllowed.value && !isDrawerOrModalExist()) { |
|
showUserModal.value = true |
|
} |
|
break |
|
} |
|
} |
|
} |
|
}) |
|
</script> |
|
|
|
<template> |
|
<div class="flex items-center w-full pl-3 hover:(text-primary bg-primary bg-opacity-5)" @click="showUserModal = true"> |
|
<div v-if="isShareBaseAllowed"> |
|
<div class="flex items-center space-x-1"> |
|
<MdiAccountPlusOutline class="mr-1 nc-share-base" /> |
|
|
|
<div>{{ $t('activity.inviteTeam') }}</div> |
|
</div> |
|
</div> |
|
|
|
<LazyTabsAuthUserManagementUsersModal :show="showUserModal" @closed="showUserModal = false" /> |
|
</div> |
|
</template>
|
|
|