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
878d12da
Unverified
Commit
878d12da
authored
Jul 17, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jul 17, 2024
Browse files
Merge pull request #3946 from open-webui/dev
fix
parents
6668d795
c1dfafcc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
27 deletions
+2
-27
src/lib/components/documents/AddDocModal.svelte
src/lib/components/documents/AddDocModal.svelte
+1
-26
src/lib/components/workspace/Documents.svelte
src/lib/components/workspace/Documents.svelte
+1
-1
No files found.
src/lib/components/documents/AddDocModal.svelte
View file @
878d12da
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
const i18n = getContext('i18n');
const i18n = getContext('i18n');
export let show = false;
export let show = false;
export let uploadDoc: Function;
let uploadDocInputElement: HTMLInputElement;
let uploadDocInputElement: HTMLInputElement;
let inputFiles;
let inputFiles;
let tags = [];
let tags = [];
...
@@ -26,32 +27,6 @@
...
@@ -26,32 +27,6 @@
content: null
content: null
};
};
const uploadDoc = async (file) => {
const res = await uploadDocToVectorDB(localStorage.token, '', file).catch((error) => {
toast.error(error);
return null;
});
if (res) {
await createNewDoc(
localStorage.token,
res.collection_name,
res.filename,
transformFileName(res.filename),
res.filename,
tags.length > 0
? {
tags: tags
}
: null
).catch((error) => {
toast.error(error);
return null;
});
await documents.set(await getDocs(localStorage.token));
}
};
const submitHandler = async () => {
const submitHandler = async () => {
if (inputFiles && inputFiles.length > 0) {
if (inputFiles && inputFiles.length > 0) {
for (const file of inputFiles) {
for (const file of inputFiles) {
...
...
src/lib/components/workspace/Documents.svelte
View file @
878d12da
...
@@ -205,7 +205,7 @@
...
@@ -205,7 +205,7 @@
<EditDocModal bind:show={showEditDocModal} {selectedDoc} />
<EditDocModal bind:show={showEditDocModal} {selectedDoc} />
{/key}
{/key}
<AddDocModal bind:show={showAddDocModal} />
<AddDocModal bind:show={showAddDocModal}
{uploadDoc}
/>
<div class="mb-3">
<div class="mb-3">
<div class="flex justify-between items-center">
<div class="flex justify-between items-center">
...
...
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