π 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
Fixes and file preview
Smaug6739aca2a4bb7a19
diff --git a/backend/migrations/000006_file_parent_id_constraint_rmdoc.down.sql b/backend/migrations/000006_file_parent_id_constraint_rmdoc.down.sqlnew file mode 100644index 00000000..e69de29bdiff --git a/backend/migrations/000006_file_parent_id_constraint_rmdoc.up.sql b/backend/migrations/000006_file_parent_id_constraint_rmdoc.up.sqlnew file mode 100644index 00000000..2b838899--- /dev/null+++ b/backend/migrations/000006_file_parent_id_constraint_rmdoc.up.sql@@ -0,0 +1,8 @@+alter table ressources+ drop foreign key ressources_documents_id_fk;++alter table ressources+ add constraint ressources_documents_id_fk+ foreign key (parent_id) references documents (id)+ on delete set null;+diff --git a/frontend/components/AppButton.vue b/frontend/components/AppButton.vueindex ce4323e3..3b92f1cd 100644--- a/frontend/components/AppButton.vue+++ b/frontend/components/AppButton.vue@@ -34,7 +34,7 @@ button {outline: 1px solid $primary-color;color: var(--font-color);&:hover {- box-shadow: inset 0 0 0 1px $primary-dark;+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);}}.success {diff --git a/frontend/components/MarkdownEditor/MarkdownEditor.vue b/frontend/components/MarkdownEditor/MarkdownEditor.vueindex b0119b84..29e2ffb9 100644--- a/frontend/components/MarkdownEditor/MarkdownEditor.vue+++ b/frontend/components/MarkdownEditor/MarkdownEditor.vue@@ -75,7 +75,7 @@ function debounce(fn: Function, wait: number) {.editor-container {height: 90%;width: 100%;- box-shadow: 0 0 10px 0 var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);border-radius: 15px;padding: 10px;}diff --git a/frontend/components/ModalManager.vue b/frontend/components/ModalManager.vueindex 4b998da1..a6b442ba 100644--- a/frontend/components/ModalManager.vue+++ b/frontend/components/ModalManager.vue@@ -22,7 +22,7 @@ const modals = modalManager.modals;padding: 12px 18px;background-color: var(--bg-contrast);border-radius: 10px;- box-shadow: 0 2px 8px rgba(0, 0, 0, 0.33);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);transition: all 0.3s ease;font-size: initial;position: relative;diff --git a/frontend/components/Notification.vue b/frontend/components/Notification.vueindex 540d8db8..1892c5b5 100644--- a/frontend/components/Notification.vue+++ b/frontend/components/Notification.vue@@ -37,7 +37,7 @@ const close = (id: number) => useNotifications().remove(id);backdrop-filter: blur(12px);background: rgba(30, 30, 30, 0.6);color: white;- box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);animation: fadeIn 0.3s ease;position: relative;}diff --git a/frontend/components/Sidebar/SidebarWorkspaces.vue b/frontend/components/Sidebar/SidebarWorkspaces.vueindex c7003a4b..8eea8a03 100644--- a/frontend/components/Sidebar/SidebarWorkspaces.vue+++ b/frontend/components/Sidebar/SidebarWorkspaces.vue@@ -61,7 +61,7 @@ onBeforeUnmount(() => document.removeEventListener('click', handleClickOutside)).dropdown-selected.open {border-color: var(--selection-color);- box-shadow: 0 0 5px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);}.dropdown-arrow {diff --git a/frontend/composables/useSidebarTree.ts b/frontend/composables/useSidebarTree.tsindex 924f2ae0..e07b2690 100644--- a/frontend/composables/useSidebarTree.ts+++ b/frontend/composables/useSidebarTree.ts@@ -43,7 +43,7 @@ export function useSidebarTree() {id: cat.id,parent_id: cat.parent_id || '',label: cat.filename,- route: `/dashboard/cdn/${cat.id}`,+ route: `/dashboard/cdn/${cat.id}/preview`,icon: 'image',data: cat,show: ref(true),diff --git a/frontend/helpers/icons.ts b/frontend/helpers/icons.tsindex e0306435..53dfcc84 100644--- a/frontend/helpers/icons.ts+++ b/frontend/helpers/icons.ts@@ -17,6 +17,7 @@ const icons = {image: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--green);" d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"/></svg>`,import: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m720-80 120-120-28-28-72 72v-164h-40v164l-72-72-28 28L720-80ZM480-800 243-663l237 137 237-137-237-137ZM120-321v-318q0-22 10.5-40t29.5-29l280-161q10-5 19.5-8t20.5-3q11 0 21 3t19 8l280 161q19 11 29.5 29t10.5 40v159h-80v-116L479-434 200-596v274l240 139v92L160-252q-19-11-29.5-29T120-321ZM720 0q-83 0-141.5-58.5T520-200q0-83 58.5-141.5T720-400q83 0 141.5 58.5T920-200q0 83-58.5 141.5T720 0ZM480-491Z"/></svg>`,logout: `<svg xmlns="http://www.w3.org/2000/svg" style="fill:var(--font-color);" viewBox="0 -960 960 960"><path d="M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h280v80H200v560h280v80H200Zm440-160-55-58 102-102H360v-80h327L585-622l55-58 200 200-200 200Z"/></svg>`,+ pdf: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#1f1f1f"><path d="M360-460h40v-80h40q17 0 28.5-11.5T480-580v-40q0-17-11.5-28.5T440-660h-80v200Zm40-120v-40h40v40h-40Zm120 120h80q17 0 28.5-11.5T640-500v-120q0-17-11.5-28.5T600-660h-80v200Zm40-40v-120h40v120h-40Zm120 40h40v-80h40v-40h-40v-40h40v-40h-80v200ZM320-240q-33 0-56.5-23.5T240-320v-480q0-33 23.5-56.5T320-880h480q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H320Zm0-80h480v-480H320v480ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Zm160-720v480-480Z"/></svg>`,plus: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>`,profil: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M234-276q51-39 114-61.5T480-360q69 0 132 22.5T726-276q35-41 54.5-93T800-480q0-133-93.5-226.5T480-800q-133 0-226.5 93.5T160-480q0 59 19.5 111t54.5 93Zm246-164q-59 0-99.5-40.5T340-580q0-59 40.5-99.5T480-720q59 0 99.5 40.5T620-580q0 59-40.5 99.5T480-440Zm0 360q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q53 0 100-15.5t86-44.5q-39-29-86-44.5T480-280q-53 0-100 15.5T294-220q39 29 86 44.5T480-160Zm0-360q26 0 43-17t17-43q0-26-17-43t-43-17q-26 0-43 17t-17 43q0 26 17 43t43 17Zm0-60Zm0 360Z"/></svg>`,search: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none"stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"class="mr-2 h-4 w-4 shrink-0 opacity-50"><circle cx="11" cy="11" r="8"></circle><path d="m21 21-4.3-4.3"></path></svg>`,diff --git a/frontend/pages/(public)/index.vue b/frontend/pages/(public)/index.vueindex 1a682206..36dc5dd6 100644--- a/frontend/pages/(public)/index.vue+++ b/frontend/pages/(public)/index.vue@@ -137,10 +137,12 @@ h3 {font-size: 1rem;transition: all 0.3s ease;display: inline-block;- box-shadow: 0px 4px 12px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);+border: none;&:hover {- box-shadow: 0px 6px 15px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);+transform: translateY(-4px);}}@@ -162,7 +164,7 @@ h3 {img {width: 100%;border-radius: 1rem;- box-shadow: 0 20px 40px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);}}@@ -182,12 +184,14 @@ h3 {margin: 0 auto;border-radius: 1rem;overflow: hidden;- box-shadow: 0 10px 30px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);+border: 1px solid var(--border-color);}.demo img {- box-shadow: 0 10px 20px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);+display: block;margin: 25px auto;max-height: unset;diff --git a/frontend/pages/dashboard/categories/[id]/index.vue b/frontend/pages/dashboard/categories/[id]/index.vueindex 64ea8b80..72cbc97e 100644--- a/frontend/pages/dashboard/categories/[id]/index.vue+++ b/frontend/pages/dashboard/categories/[id]/index.vue@@ -83,7 +83,7 @@ h1 {.document-card {border-radius: 10px;- box-shadow: 0 4px 6px var(--border-color);+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);overflow: hidden;width: 400px;display: flex;diff --git a/frontend/pages/dashboard/cdn/[id].vue b/frontend/pages/dashboard/cdn/[id]/index.vuesimilarity index 100%rename from frontend/pages/dashboard/cdn/[id].vuerename to frontend/pages/dashboard/cdn/[id]/index.vuediff --git a/frontend/pages/dashboard/cdn/[id]/preview.vue b/frontend/pages/dashboard/cdn/[id]/preview.vuenew file mode 100644index 00000000..4ac91aa5--- /dev/null+++ b/frontend/pages/dashboard/cdn/[id]/preview.vue@@ -0,0 +1,37 @@+<template>+ <div style="padding: 24px; gap: 16px" class="card-component">+ <div v-if="ressource">+ <h2>Preview <tag blue>New</tag></h2>+ Name: <strong>{{ ressource.filename }}</strong>+ <p>+ Type: <strong>{{ ressource.filetype }}</strong>+ </p>+ <p>+ Size: <strong>{{ readableFileSize(ressource.filesize) }}</strong>+ </p>+ </div>+ <div class="preview">+ <img v-if="ressource!.filetype.startsWith('image/')" :src="`${CDN}/${ressource!.author_id}/${ressource!.transformed_path || ressource!.original_path}`" alt="Preview" />+ <iframe v-else-if="ressource!.filetype.startsWith('application/pdf')" :src="`${CDN}/${ressource!.author_id}/${ressource!.transformed_path || ressource!.original_path}`" width="100%" height="500px" frameborder="0" allowfullscreen></iframe>+ <p v-else>Preview not available for this file type.</p>+ </div>+ <div style="display: flex; justify-content: flex-end"></div>+ </div>+</template>++<script setup lang="ts">+const ressource = useRessourcesStore().getById(useRoute().params.id as string);+</script>+<style lang="scss">+.card-component {+ display: block;+ margin: 2px 0;+ width: 100%;+}+.preview {+ display: flex;+ justify-content: center;+ width: 100%;+ height: 100%;+}+</style>diff --git a/frontend/styles/theme.scss b/frontend/styles/theme.scssindex 0f66b4d3..fdbbbfa8 100644--- a/frontend/styles/theme.scss+++ b/frontend/styles/theme.scss@@ -141,7 +141,7 @@ option {font-family: $external-font;&:hover {- box-shadow: 0 0 10px 100px #000 inset;+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);}}