mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-18 04:25:52 +08:00
refac
This commit is contained in:
parent
81a8ad2762
commit
ba0b3a984d
@ -873,7 +873,7 @@ def save_docs_to_vector_db(
|
||||
return True
|
||||
except Exception as e:
|
||||
log.exception(e)
|
||||
return False
|
||||
raise e
|
||||
|
||||
|
||||
class ProcessFileForm(BaseModel):
|
||||
@ -903,7 +903,7 @@ def process_file(
|
||||
|
||||
docs = [
|
||||
Document(
|
||||
page_content=form_data.content,
|
||||
page_content=form_data.content.replace("<br/>", "\n"),
|
||||
metadata={
|
||||
**file.meta,
|
||||
"name": file.filename,
|
||||
|
@ -446,7 +446,13 @@
|
||||
|
||||
const onDragOver = (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
// Check if a file is being draggedOver.
|
||||
if (e.dataTransfer?.types?.includes('Files')) {
|
||||
dragged = true;
|
||||
} else {
|
||||
dragged = false;
|
||||
}
|
||||
};
|
||||
|
||||
const onDragLeave = () => {
|
||||
@ -457,6 +463,7 @@
|
||||
e.preventDefault();
|
||||
dragged = false;
|
||||
|
||||
if (e.dataTransfer?.types?.includes('Files')) {
|
||||
if (e.dataTransfer?.files) {
|
||||
const inputFiles = e.dataTransfer?.files;
|
||||
|
||||
@ -468,6 +475,7 @@
|
||||
toast.error($i18n.t(`File not found.`));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
onMount(async () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user