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.
85 lines
2.4 KiB
85 lines
2.4 KiB
2 weeks ago
|
<script setup lang="ts">
|
||
2 weeks ago
|
const { isUIAllowed } = useRoles()
|
||
2 weeks ago
|
|
||
2 weeks ago
|
const hasPermissionForSnapshots = computed(() => isUIAllowed('manageSnapshot'))
|
||
|
|
||
2 weeks ago
|
const { isFeatureEnabled } = useBetaFeatureToggle()
|
||
|
|
||
2 weeks ago
|
const router = useRouter()
|
||
|
|
||
2 weeks ago
|
const activeMenu = ref(
|
||
|
isEeUI && isFeatureEnabled(FEATURE_FLAG.BASE_SNAPSHOTS) && hasPermissionForSnapshots.value ? 'snapshots' : 'visibility',
|
||
|
)
|
||
2 weeks ago
|
|
||
2 weeks ago
|
const selectMenu = (option: string) => {
|
||
2 weeks ago
|
if (!hasPermissionForSnapshots.value && option === 'snapshots') {
|
||
|
return
|
||
|
}
|
||
2 weeks ago
|
router.push({
|
||
|
query: {
|
||
|
...router.currentRoute.value.query,
|
||
|
tab: option,
|
||
|
},
|
||
|
})
|
||
2 weeks ago
|
activeMenu.value = option
|
||
|
}
|
||
2 weeks ago
|
|
||
|
onMounted(() => {
|
||
|
const query = router.currentRoute.value.query
|
||
|
if (query && query.tab && ['snapshots', 'visibility'].includes(query.tab as string)) {
|
||
|
selectMenu(query.tab as string)
|
||
|
}
|
||
|
})
|
||
2 weeks ago
|
</script>
|
||
|
|
||
|
<template>
|
||
2 weeks ago
|
<div class="flex p-5 nc-base-settings justify-center overflow-auto gap-8">
|
||
2 weeks ago
|
<!-- Left Pane -->
|
||
|
<div class="flex flex-col">
|
||
|
<div class="h-full w-60">
|
||
|
<div
|
||
2 weeks ago
|
v-if="isEeUI && hasPermissionForSnapshots && isFeatureEnabled(FEATURE_FLAG.BASE_SNAPSHOTS)"
|
||
2 weeks ago
|
data-testid="snapshots-tab"
|
||
2 weeks ago
|
:class="{
|
||
2 weeks ago
|
'active-menu': activeMenu === 'snapshots',
|
||
2 weeks ago
|
}"
|
||
|
class="gap-3 !hover:bg-gray-50 transition-all text-nc-content-gray flex rounded-lg items-center cursor-pointer py-1.5 px-3"
|
||
2 weeks ago
|
@click="selectMenu('snapshots')"
|
||
2 weeks ago
|
>
|
||
2 weeks ago
|
<GeneralIcon icon="camera" />
|
||
|
|
||
|
<span>
|
||
|
{{ $t('general.snapshots') }}
|
||
|
</span>
|
||
|
</div>
|
||
2 weeks ago
|
|
||
2 weeks ago
|
<div
|
||
|
:class="{
|
||
|
'active-menu': activeMenu === 'visibility',
|
||
|
}"
|
||
|
class="gap-3 !hover:bg-gray-50 transition-all text-nc-content-gray flex rounded-lg items-center cursor-pointer py-1.5 px-3"
|
||
2 weeks ago
|
data-testid="visibility-tab"
|
||
2 weeks ago
|
@click="selectMenu('visibility')"
|
||
|
>
|
||
|
<GeneralIcon icon="ncEye" />
|
||
2 weeks ago
|
<span>
|
||
2 weeks ago
|
{{ $t('labels.visibilityAndDataHandling') }}
|
||
2 weeks ago
|
</span>
|
||
2 weeks ago
|
</div>
|
||
|
</div>
|
||
|
</div>
|
||
2 weeks ago
|
<!-- Data Pane -->
|
||
|
|
||
2 weeks ago
|
<div class="flex flex-col w-[760px]">
|
||
2 weeks ago
|
<DashboardSettingsBaseSnapshots v-if="activeMenu === 'snapshots'" />
|
||
|
<DashboardSettingsBaseVisibility v-if="activeMenu === 'visibility'" />
|
||
2 weeks ago
|
</div>
|
||
2 weeks ago
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<style lang="scss" scoped>
|
||
2 weeks ago
|
.active-menu {
|
||
2 weeks ago
|
@apply !bg-brand-50 font-semibold !text-nc-content-brand-disabled;
|
||
2 weeks ago
|
}
|
||
|
</style>
|