Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Filter docs of selected workspaces on /docs page

Smaug67391635f2d03845
diff --git a/frontend/app/pages/dashboard/docs/index.vue b/frontend/app/pages/dashboard/docs/index.vue
index 73173ca4..f9a80833 100644
--- a/frontend/app/pages/dashboard/docs/index.vue
+++ b/frontend/app/pages/dashboard/docs/index.vue
@@ -17,8 +17,20 @@
</template>
<script setup lang="ts">
+import type { Document } from '~/stores';
+
const view: Ref<'table' | 'list'> = ref('list');
-const documents = computed(() => useDocumentsStore().getAll);
+const documents = computed(() => {
+ const result: Document[] = [];
+ const getDocs = (items: Item[]) => {
+ for (const item of items) {
+ if (item.data.type == 'document') result.push(item.data);
+ if (item.childrens) getDocs(item.childrens);
+ }
+ };
+ getDocs(useSidebarTree().filtered.value);
+ return result;
+});
</script>
<style scoped lang="scss">