π 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 settings manager on categories hover
Smaug6739d9b8b06abcb2
diff --git a/frontend/components/Sidebar/SidebarItem.vue b/frontend/components/Sidebar/SidebarItem.vueindex 2918a114..fb48232d 100644--- a/frontend/components/Sidebar/SidebarItem.vue+++ b/frontend/components/Sidebar/SidebarItem.vue@@ -2,7 +2,8 @@<span class="item" @click="onClick" :draggable="draggable" @dragstart="dragStart" @dragover.prevent="dragOver" @drop="drop" @dragleave="dragLeave" :class="{ 'drag-over': isDragOver }" :key="item.id"><Icon :name="getIcon()" /><NuxtLink :to="item.route" style="width: 100%">{{ item.title }} </NuxtLink>- <NuxtLink to="/dashboard/docs/new" class="new" v-if="item.data.type === 'category' && item.parent_id"> <Icon name="plus" fill="var(--font-color)" /> </NuxtLink>+ <NuxtLink v-if="item.data.type === 'category'" :to="`/dashboard/categories/${item.id}/edit`" class="nav"> <Icon name="c_settings" fill="var(--font-color)" /> </NuxtLink>+ <NuxtLink v-if="item.data.type === 'category' && item.parent_id" to="/dashboard/docs/new" class="nav"> <Icon name="plus" fill="var(--font-color)" /> </NuxtLink><slot></slot></span></template>@@ -99,7 +100,7 @@ const drop = async (event: DragEvent) => {font-size: 15.5px;font-weight: 400;&:hover,- &:has(.router-link-exact-active:not(.new)) {+ &:has(.router-link-exact-active:not(.nav)) {background: var(--bg-contrast-2);}@@ -124,13 +125,13 @@ const drop = async (event: DragEvent) => {border-bottom: 2px solid var(--blue);box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);}-.new {+.nav {display: none;&:deep(svg) {fill: inherit !important;}}-.item:hover .new {+.item:hover .nav {display: block;}</style>diff --git a/frontend/composables/icons.ts b/frontend/composables/icons.tsindex 2be683a1..cb7f1ff8 100644--- a/frontend/composables/icons.ts+++ b/frontend/composables/icons.ts@@ -4,6 +4,7 @@ const icons = {backup: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M260-160q-91 0-155.5-63T40-377q0-78 47-139t123-78q17-72 85-137t145-65q33 0 56.5 23.5T520-716v242l64-62 56 56-160 160-160-160 56-56 64 62v-242q-76 14-118 73.5T280-520h-20q-58 0-99 41t-41 99q0 58 41 99t99 41h480q42 0 71-29t29-71q0-42-29-71t-71-29h-60v-80q0-48-22-89.5T600-680v-93q74 35 117 103.5T760-520q69 8 114.5 59.5T920-340q0 75-52.5 127.5T740-160H260Zm220-358Z"/></svg>`,new_page: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-280h80v-160h160v-80H520v-160h-80v160H280v80h160v160ZM200-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-560H200v560Zm0-560v560-560Z"/></svg>`,settings: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M400-480q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47ZM80-160v-112q0-33 17-62t47-44q51-26 115-44t141-18h14q6 0 12 2-8 18-13.5 37.5T404-360h-4q-71 0-127.5 18T180-306q-9 5-14.5 14t-5.5 20v32h252q6 21 16 41.5t22 38.5H80Zm560 40-12-60q-12-5-22.5-10.5T584-204l-58 18-40-68 46-40q-2-14-2-26t2-26l-46-40 40-68 58 18q11-8 21.5-13.5T628-460l12-60h80l12 60q12 5 22.5 11t21.5 15l58-20 40 70-46 40q2 12 2 25t-2 25l46 40-40 68-58-18q-11 8-21.5 13.5T732-180l-12 60h-80Zm40-120q33 0 56.5-23.5T760-320q0-33-23.5-56.5T680-400q-33 0-56.5 23.5T600-320q0 33 23.5 56.5T680-240ZM400-560q33 0 56.5-23.5T480-640q0-33-23.5-56.5T400-720q-33 0-56.5 23.5T320-640q0 33 23.5 56.5T400-560Zm0-80Zm12 400Z"/></svg>`,+ c_settings: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960"><path d="m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"/></svg>`,security: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="m438-338 226-226-57-57-169 169-84-84-57 57 141 141Zm42 258q-139-35-229.5-159.5T160-516v-244l320-120 320 120v244q0 152-90.5 276.5T480-80Zm0-84q104-33 172-132t68-220v-189l-240-90-240 90v189q0 121 68 220t172 132Zm0-316Z"/></svg>`,close: `<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="h-4 w-4"><path d="M18 6 6 18"></path><path d="m6 6 12 12"></path></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>`,@@ -11,7 +12,7 @@ const icons = {plus: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"/></svg>`,users: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path d="M40-160v-112q0-34 17.5-62.5T104-378q62-31 126-46.5T360-440q66 0 130 15.5T616-378q29 15 46.5 43.5T680-272v112H40Zm720 0v-120q0-44-24.5-84.5T666-434q51 6 96 20.5t84 35.5q36 20 55 44.5t19 53.5v120H760ZM360-480q-66 0-113-47t-47-113q0-66 47-113t113-47q66 0 113 47t47 113q0 66-47 113t-113 47Zm400-160q0 66-47 113t-113 47q-11 0-28-2.5t-28-5.5q27-32 41.5-71t14.5-81q0-42-14.5-81T544-792q14-5 28-6.5t28-1.5q66 0 113 47t47 113ZM120-240h480v-32q0-11-5.5-20T580-306q-54-27-109-40.5T360-360q-56 0-111 13.5T140-306q-9 5-14.5 14t-5.5 20v32Zm240-320q33 0 56.5-23.5T440-640q0-33-23.5-56.5T360-720q-33 0-56.5 23.5T280-640q0 33 23.5 56.5T360-560Zm0 320Zm0-400Z"/></svg>`,draft: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--turquoise)" d="M240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>`,- folder: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#5f6368"><path style="fill:var(--yellow)" d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z"/></svg>`,+ folder: `<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960"><path style="fill:var(--yellow)" d="M160-160q-33 0-56.5-23.5T80-240v-480q0-33 23.5-56.5T160-800h240l80 80h320q33 0 56.5 23.5T880-640v400q0 33-23.5 56.5T800-160H160Zm0-80h640v-400H447l-80-80H160v480Zm0 0v-480 480Z"/></svg>`,file: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--red);" d="M320-240h320v-80H320v80Zm0-160h320v-80H320v80ZM240-80q-33 0-56.5-23.5T160-160v-640q0-33 23.5-56.5T240-880h320l240 240v480q0 33-23.5 56.5T720-80H240Zm280-520v-200H240v640h480v-440H520ZM240-800v200-200 640-640Z"/></svg>`,file_parent: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960"><path style="fill:var(--green);" d="M320-320h200v-200H320v200Zm0-280h480v-200H320v200Zm280 280h200v-200H600v200Zm-280 80q-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-240H320ZM160-80q-33 0-56.5-23.5T80-160v-560h80v560h560v80H160Z"/></svg>`,archive: `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="none"><rect x="2.5" y="2.5" width="11" height="11" rx="1.5" fill="var(--grey-bg)" stroke="var(--grey)"/><rect x="6" y="4" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="6" y="8" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="8" y="10" width="2" height="2" rx="0.5" fill="var(--grey)"/><rect x="8" y="6" width="2" height="2" rx="0.5" fill="var(--grey)"/></svg>`,diff --git a/frontend/pages/dashboard/categories/edit.vue b/frontend/pages/dashboard/categories/[id]/edit.vuesimilarity index 86%rename from frontend/pages/dashboard/categories/edit.vuerename to frontend/pages/dashboard/categories/[id]/edit.vueindex b1a0360d..ac899c1b 100644--- a/frontend/pages/dashboard/categories/edit.vue+++ b/frontend/pages/dashboard/categories/[id]/edit.vue@@ -1,7 +1,7 @@<template><div class="category-form-container"><h2>Update category & workspace</h2>- <form @submit.prevent>+ <form @submit.prevent v-if="category"><label>ID</label><input type="text" v-model="category.id" id="id" disabled /><label>Role</label>@@ -16,12 +16,12 @@<label>Workspace (for top categories)</label><select v-model="category.workspace_id"><option :value="null">None</option>- <option v-for="wp in categoriesStore.getAll.filter(a => a.id != categoryId && a.role == 2)" :value="wp.id">{{ wp.name }}</option>+ <option v-for="wp in categoriesStore.getAll.filter(a => a.id != route.params.id && a.role == 2)" :value="wp.id">{{ wp.name }}</option></select><label>Parent</label><select v-model="category.parent_id"><option :value="null">None</option>- <option v-for="cp in categoriesStore.getParents.filter(a => a.id != categoryId && a.role == 1)" :value="cp.id">{{ cp.name }}</option>+ <option v-for="cp in categoriesStore.getParents.filter(a => a.id != route.params.id && a.role == 1)" :value="cp.id">{{ cp.name }}</option></select><label for="order">Order</label><input type="number" v-model.number="category.order" id="order" />@@ -35,8 +35,8 @@<script lang="ts" setup>const categoriesStore = useCategoriesStore();-const categoryId = useRoute().query.category;-const category = computed(() => categoriesStore.getById(categoryId as string) || { id: '', role: 1, name: '', icon: '', workspace_id: '', parent_id: '', order: 0, type: 'category' as const });+const route = useRoute();+const category = computed(() => categoriesStore.getById(route.params.id as string));definePageMeta({ breadcrumb: 'Edit' });diff --git a/frontend/pages/dashboard/categories/[id].vue b/frontend/pages/dashboard/categories/[id]/index.vuesimilarity index 100%rename from frontend/pages/dashboard/categories/[id].vuerename to frontend/pages/dashboard/categories/[id]/index.vuediff --git a/frontend/pages/dashboard/categories/index.vue b/frontend/pages/dashboard/categories/index.vueindex 06f13d4c..7e3ca729 100644--- a/frontend/pages/dashboard/categories/index.vue+++ b/frontend/pages/dashboard/categories/index.vue@@ -7,7 +7,7 @@<div class="category-card main-category">{{ mainCategory.name }}<div class="action-menu">- <NuxtLink :to="'/dashboard/categories/edit?category=' + mainCategory.id">β</NuxtLink>+ <NuxtLink :to="`/dashboard/categories/${mainCategory.id}/edit`">β</NuxtLink></div></div>@@ -16,7 +16,7 @@<div v-for="subCategory in categoriesStore.getChilds(mainCategory.id)" :key="subCategory.id" class="category-card sub-category">{{ subCategory.name }}<div class="action-menu">- <NuxtLink :to="'/dashboard/categories/edit?category=' + subCategory.id">β</NuxtLink>+ <NuxtLink :to="`/dashboard/categories/${subCategory.id}/edit`">β</NuxtLink></div></div></div>