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.
41 lines
863 B
41 lines
863 B
<script setup lang="ts"> |
|
definePageMeta({ |
|
public: true, |
|
requiresAuth: false, |
|
layout: 'shared-view', |
|
hasSidebar: false, |
|
}) |
|
|
|
const route = useRoute() |
|
|
|
const { loadSharedView, meta } = useSharedView() |
|
const { isViewDataLoading } = storeToRefs(useViewsStore()) |
|
|
|
provide(MetaInj, meta) |
|
|
|
const showPassword = ref(false) |
|
|
|
onMounted(async () => { |
|
isViewDataLoading.value = true |
|
try { |
|
await loadSharedView(route.params.viewId as string) |
|
} catch (e: any) { |
|
if (e?.response?.status === 403) { |
|
showPassword.value = true |
|
} else { |
|
console.error(e) |
|
message.error(await extractSdkResponseErrorMsg(e)) |
|
} |
|
} finally { |
|
isViewDataLoading.value = false |
|
} |
|
}) |
|
</script> |
|
|
|
<template> |
|
<div v-if="showPassword"> |
|
<LazySharedViewAskPassword v-model="showPassword" /> |
|
</div> |
|
|
|
<LazySharedViewGrid v-else-if="meta" /> |
|
</template>
|
|
|