diff --git a/src/routes/(app)/documents/+page.svelte b/src/routes/(app)/documents/+page.svelte
index dbba885132..898c5f5f06 100644
--- a/src/routes/(app)/documents/+page.svelte
+++ b/src/routes/(app)/documents/+page.svelte
@@ -18,6 +18,8 @@
let inputFiles = '';
let query = '';
+ let tags = [];
+
let showEditDocModal = false;
let selectedDoc;
@@ -50,6 +52,11 @@
};
onMount(() => {
+ documents.subscribe((docs) => {
+ tags = docs.reduce((a, e, i, arr) => {
+ return [...new Set([...a, ...(e?.content?.tags ?? []).map((tag) => tag.name)])];
+ }, []);
+ });
const dropZone = document.querySelector('body');
const onDragOver = (e) => {
@@ -141,6 +148,34 @@
{/key}
+ {
+ if (inputFiles && inputFiles.length > 0) {
+ const file = inputFiles[0];
+ if (
+ SUPPORTED_FILE_TYPE.includes(file['type']) ||
+ SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
+ ) {
+ uploadDoc(file);
+ } else {
+ toast.error(
+ `Unknown File Type '${file['type']}', but accepting and treating as plain text`
+ );
+ uploadDoc(file);
+ }
+
+ inputFiles = null;
+ e.target.value = '';
+ } else {
+ toast.error(`File not found.`);
+ }
+ }}
+/>
+
+
-
{
- if (inputFiles && inputFiles.length > 0) {
- const file = inputFiles[0];
- if (
- SUPPORTED_FILE_TYPE.includes(file['type']) ||
- SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
- ) {
- uploadDoc(file);
- } else {
- toast.error(
- `Unknown File Type '${file['type']}', but accepting and treating as plain text`
- );
- uploadDoc(file);
- }
-
- inputFiles = null;
- e.target.value = '';
- } else {
- toast.error(`File not found.`);
- }
- }}
- />
+ {#if tags.length > 0}
+
+
+ {#each tags as tag}
+
+ {/each}
+
+ {/if}
{#each $documents.filter((p) => query === '' || p.name.includes(query)) as doc}
-
-