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
376b2d02
Unverified
Commit
376b2d02
authored
Jul 18, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jul 18, 2024
Browse files
Merge pull request #3972 from jonathan-rohde/fix/missing-tags-add-doc-modal
fix: missing tags add doc modal
parents
8dc73fdb
7e036244
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
src/lib/components/documents/AddDocModal.svelte
src/lib/components/documents/AddDocModal.svelte
+2
-2
src/lib/components/workspace/Documents.svelte
src/lib/components/workspace/Documents.svelte
+7
-2
No files found.
src/lib/components/documents/AddDocModal.svelte
View file @
376b2d02
...
@@ -35,12 +35,12 @@
...
@@ -35,12 +35,12 @@
SUPPORTED_FILE_TYPE.includes(file['type']) ||
SUPPORTED_FILE_TYPE.includes(file['type']) ||
SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
SUPPORTED_FILE_EXTENSIONS.includes(file.name.split('.').at(-1))
) {
) {
uploadDoc(file);
uploadDoc(file
, tags
);
} else {
} else {
toast.error(
toast.error(
`Unknown File Type '${file['type']}', but accepting and treating as plain text`
`Unknown File Type '${file['type']}', but accepting and treating as plain text`
);
);
uploadDoc(file);
uploadDoc(file
, tags
);
}
}
}
}
...
...
src/lib/components/workspace/Documents.svelte
View file @
376b2d02
...
@@ -51,7 +51,7 @@
...
@@ -51,7 +51,7 @@
await documents.set(await getDocs(localStorage.token));
await documents.set(await getDocs(localStorage.token));
};
};
const uploadDoc = async (file) => {
const uploadDoc = async (file
, tags?: object
) => {
console.log(file);
console.log(file);
// Check if the file is an audio file and transcribe/convert it to text file
// Check if the file is an audio file and transcribe/convert it to text file
if (['audio/mpeg', 'audio/wav'].includes(file['type'])) {
if (['audio/mpeg', 'audio/wav'].includes(file['type'])) {
...
@@ -84,7 +84,12 @@
...
@@ -84,7 +84,12 @@
res.collection_name,
res.collection_name,
res.filename,
res.filename,
transformFileName(res.filename),
transformFileName(res.filename),
res.filename
res.filename,
tags?.length > 0
? {
tags: tags
}
: null
).catch((error) => {
).catch((error) => {
toast.error(error);
toast.error(error);
return null;
return null;
...
...
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