π The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.
Vue dockergolangkanbanknowledge-baseknowledge-managementmarkdownnote-takingnotesnotes-appnotionnuxtnuxtjsoffline-firstoidcpwaselfhostedssovuevuejswiki
Add download button
Smaug67398242e6c66c6b
diff --git a/frontend/app/composables/useApi.ts b/frontend/app/composables/useApi.tsindex a84c5736..cad2cfc3 100644--- a/frontend/app/composables/useApi.ts+++ b/frontend/app/composables/useApi.ts@@ -10,7 +10,6 @@ export function useApi() {}function resourceURL(resource?: Node): string {- console.log(resource);if (!resource) return '';return `${CDN}/${resource.user_id}/${resource.metadata?.transformed_path || resource.content}`;}diff --git a/frontend/app/pages/dashboard/cdn/[id]/preview.vue b/frontend/app/pages/dashboard/cdn/[id]/preview.vueindex f477c15a..495f009c 100644--- a/frontend/app/pages/dashboard/cdn/[id]/preview.vue+++ b/frontend/app/pages/dashboard/cdn/[id]/preview.vue@@ -12,7 +12,14 @@<div class="preview"><img v-if="isImageFile(mimeType)" :src="resourceURL(resource)" alt="Preview" /><LazyPDFViewer v-else-if="isPdfFile(mimeType)" :src="resourceURL(resource)" :scale="scale" />- <p v-else>Preview not available for this file type.</p>+ <div v-else class="no-preview">+ <p>Preview not available for this file type.</p>+ <p>+ <NuxtLink :href="resourceURL(resource)" target="_blank" rel="noopener">+ <AppButton type="primary">Download file</AppButton>+ </NuxtLink>+ </p>+ </div></div></template></div>@@ -66,4 +73,10 @@ header {object-fit: contain;}}++.no-preview {+ display: flex;+ flex-direction: column;+ text-align: center;+}</style>