|
|
@ -1,7 +1,13 @@ |
|
|
|
<script lang="ts" setup> |
|
|
|
<script lang="ts" setup> |
|
|
|
import { useTitle } from '@vueuse/core' |
|
|
|
import { useTitle } from '@vueuse/core' |
|
|
|
import NcLayout from '~icons/nc-icons/layout' |
|
|
|
import NcLayout from '~icons/nc-icons/layout' |
|
|
|
const { openedProject } = storeToRefs(useBases()) |
|
|
|
import { isEeUI } from '#imports' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const basesStore = useBases() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { getProjectUsers } = basesStore |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const { openedProject, activeProjectId, baseUserCount } = storeToRefs(basesStore) |
|
|
|
const { activeTables } = storeToRefs(useTablesStore()) |
|
|
|
const { activeTables } = storeToRefs(useTablesStore()) |
|
|
|
const { activeWorkspace, workspaceUserCount } = storeToRefs(useWorkspace()) |
|
|
|
const { activeWorkspace, workspaceUserCount } = storeToRefs(useWorkspace()) |
|
|
|
|
|
|
|
|
|
|
@ -26,6 +32,23 @@ const { isMobileMode } = useGlobal() |
|
|
|
|
|
|
|
|
|
|
|
const baseSettingsState = ref('') |
|
|
|
const baseSettingsState = ref('') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userCount = isEeUI ? workspaceUserCount : baseUserCount |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const updateBaseUserCount = async () => { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
const { totalRows } = await getProjectUsers({ |
|
|
|
|
|
|
|
baseId: activeProjectId.value!, |
|
|
|
|
|
|
|
page: 1, |
|
|
|
|
|
|
|
searchText: undefined, |
|
|
|
|
|
|
|
limit: 20, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
baseUserCount.value = totalRows |
|
|
|
|
|
|
|
} catch (e: any) { |
|
|
|
|
|
|
|
message.error(await extractSdkResponseErrorMsg(e)) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => route.value.query?.page, |
|
|
|
() => route.value.query?.page, |
|
|
|
(newVal, oldVal) => { |
|
|
|
(newVal, oldVal) => { |
|
|
@ -57,6 +80,16 @@ watch(projectPageTab, () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
|
|
|
|
() => route.value.params.baseId, |
|
|
|
|
|
|
|
(newVal, oldVal) => { |
|
|
|
|
|
|
|
if (newVal && oldVal === undefined) { |
|
|
|
|
|
|
|
updateBaseUserCount() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ immediate: true }, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
watch( |
|
|
|
watch( |
|
|
|
() => openedProject.value?.title, |
|
|
|
() => openedProject.value?.title, |
|
|
|
() => { |
|
|
|
() => { |
|
|
@ -75,7 +108,7 @@ watch( |
|
|
|
<GeneralOpenLeftSidebarBtn /> |
|
|
|
<GeneralOpenLeftSidebarBtn /> |
|
|
|
<div class="flex flex-row items-center h-full gap-x-2.5"> |
|
|
|
<div class="flex flex-row items-center h-full gap-x-2.5"> |
|
|
|
<GeneralProjectIcon :type="openedProject?.type" /> |
|
|
|
<GeneralProjectIcon :type="openedProject?.type" /> |
|
|
|
<NcTooltip class="flex font-medium text-sm capitalize truncate max-w-150"> |
|
|
|
<NcTooltip class="flex font-medium text-sm capitalize truncate max-w-150" show-on-truncate-only> |
|
|
|
<template #title> {{ openedProject?.title }}</template> |
|
|
|
<template #title> {{ openedProject?.title }}</template> |
|
|
|
<span class="truncate"> |
|
|
|
<span class="truncate"> |
|
|
|
{{ openedProject?.title }} |
|
|
|
{{ openedProject?.title }} |
|
|
@ -119,14 +152,14 @@ watch( |
|
|
|
<GeneralIcon icon="users" class="!h-3.5 !w-3.5" /> |
|
|
|
<GeneralIcon icon="users" class="!h-3.5 !w-3.5" /> |
|
|
|
<div>{{ $t('labels.members') }}</div> |
|
|
|
<div>{{ $t('labels.members') }}</div> |
|
|
|
<div |
|
|
|
<div |
|
|
|
v-if="workspaceUserCount" |
|
|
|
v-if="userCount" |
|
|
|
class="tab-info" |
|
|
|
class="tab-info" |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'bg-primary-selected': projectPageTab === 'data-source', |
|
|
|
'bg-primary-selected': projectPageTab === 'collaborator', |
|
|
|
'bg-gray-50': projectPageTab !== 'data-source', |
|
|
|
'bg-gray-50': projectPageTab !== 'collaborator', |
|
|
|
}" |
|
|
|
}" |
|
|
|
> |
|
|
|
> |
|
|
|
{{ workspaceUserCount }} |
|
|
|
{{ userCount }} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|