mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
2 changed files with 76 additions and 0 deletions
@ -0,0 +1,42 @@
|
||||
<script setup lang="ts"> |
||||
import { message } from 'ant-design-vue' |
||||
import { ActiveViewInj, FieldsInj, IsPublicInj, MetaInj, ReadonlyInj, ReloadViewDataHookInj } from '#imports' |
||||
|
||||
const { sharedView, meta, sorts, nestedFilters } = useSharedView() |
||||
|
||||
const { signedIn } = useGlobal() |
||||
|
||||
const { loadProject } = useProject(meta.value?.project_id) |
||||
|
||||
const reloadEventHook = createEventHook<void>() |
||||
|
||||
provide(ReloadViewDataHookInj, reloadEventHook) |
||||
|
||||
provide(ReadonlyInj, true) |
||||
|
||||
provide(MetaInj, meta) |
||||
|
||||
provide(ActiveViewInj, sharedView) |
||||
|
||||
provide(FieldsInj, ref(meta.value?.columns || [])) |
||||
|
||||
provide(IsPublicInj, ref(true)) |
||||
|
||||
useProvideSmartsheetStore(sharedView, meta, true, sorts, nestedFilters) |
||||
|
||||
if (signedIn.value) { |
||||
try { |
||||
await loadProject() |
||||
} catch (e: any) { |
||||
console.error(e) |
||||
message.error(await extractSdkResponseErrorMsg(e)) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<template> |
||||
<div class="nc-container flex flex-col h-full mt-1.5 px-12"> |
||||
<SmartsheetToolbar /> |
||||
<SmartsheetKanban /> |
||||
</div> |
||||
</template> |
@ -0,0 +1,34 @@
|
||||
<script setup lang="ts"> |
||||
import { message } from 'ant-design-vue' |
||||
|
||||
definePageMeta({ |
||||
public: true, |
||||
requiresAuth: false, |
||||
layout: 'shared-view', |
||||
}) |
||||
|
||||
const route = useRoute() |
||||
|
||||
const { loadSharedView } = useSharedView() |
||||
|
||||
const showPassword = ref(false) |
||||
|
||||
try { |
||||
await loadSharedView(route.params.viewId as string) |
||||
} catch (e: any) { |
||||
if (e?.response?.status === 403) { |
||||
showPassword.value = true |
||||
} else { |
||||
message.error(await extractSdkResponseErrorMsg(e)) |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<template> |
||||
<NuxtLayout id="content" class="flex" name="shared-view"> |
||||
<div v-if="showPassword"> |
||||
<SharedViewAskPassword v-model="showPassword" /> |
||||
</div> |
||||
<SharedViewKanban v-else /> |
||||
</NuxtLayout> |
||||
</template> |
Loading…
Reference in new issue