Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
f448a4b3
Commit
f448a4b3
authored
Feb 03, 2024
by
Timothy J. Baek
Browse files
feat: doc filter by tag
parent
f538c9a1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/routes/(app)/documents/+page.svelte
src/routes/(app)/documents/+page.svelte
+6
-1
No files found.
src/routes/(app)/documents/+page.svelte
View file @
f448a4b3
...
...
@@ -22,6 +22,7 @@
let showEditDocModal = false;
let selectedDoc;
let selectedTag = '';
let dragged = false;
...
...
@@ -233,6 +234,7 @@
<button
class="px-2 py-0.5 space-x-1 flex h-fit items-center rounded-full transition border dark:border-gray-600 dark:text-white"
on:click={async () => {
selectedTag = '';
// await chats.set(await getChatListByTagName(localStorage.token, tag.name));
}}
>
...
...
@@ -242,6 +244,7 @@
<button
class="px-2 py-0.5 space-x-1 flex h-fit items-center rounded-full transition border dark:border-gray-600 dark:text-white"
on:click={async () => {
selectedTag = tag;
// await chats.set(await getChatListByTagName(localStorage.token, tag.name));
}}
>
...
...
@@ -272,7 +275,9 @@
</div>
</div> -->
{#each $documents.filter((p) => query === '' || p.name.includes(query)) as doc}
{#each $documents.filter((doc) => (selectedTag === '' || (doc?.content?.tags ?? [])
.map((tag) => tag.name)
.includes(selectedTag)) && (query === '' || doc.name.includes(query))) as doc}
<div class=" flex space-x-4 cursor-pointer w-full mt-3 mb-3">
<div class=" flex flex-1 space-x-4 cursor-pointer w-full">
<div class=" flex items-center space-x-3">
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment