mirror of
https://github.com/open-webui/open-webui
synced 2024-11-16 13:40:55 +00:00
refac: do NOT change default behaviour in a PR
This commit is contained in:
parent
69c4687a53
commit
ef28330c1a
@ -233,8 +233,8 @@
|
||||
tikaServerUrl = res.content_extraction.tika_server_url;
|
||||
showTikaServerUrl = contentExtractionEngine === 'tika';
|
||||
|
||||
fileMaxSize = res.file.file_max_size;
|
||||
fileMaxCount = res.file.file_max_count;
|
||||
fileMaxSize = res.file.max_size;
|
||||
fileMaxCount = res.file.max_count;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
@ -364,7 +364,8 @@
|
||||
multiple
|
||||
on:change={async () => {
|
||||
if (inputFiles && inputFiles.length > 0) {
|
||||
inputFilesHandler(inputFiles);
|
||||
const _inputFiles = Array.from(inputFiles);
|
||||
inputFilesHandler(_inputFiles);
|
||||
} else {
|
||||
toast.error($i18n.t(`File not found.`));
|
||||
}
|
||||
@ -667,19 +668,26 @@
|
||||
}}
|
||||
on:paste={async (e) => {
|
||||
const clipboardData = e.clipboardData || window.clipboardData;
|
||||
try {
|
||||
if (clipboardData && clipboardData.items) {
|
||||
const inputFiles = Array.from(clipboardData.items)
|
||||
.map((item) => item.getAsFile())
|
||||
.filter((file) => file);
|
||||
|
||||
inputFilesHandler(inputFiles);
|
||||
} else {
|
||||
toast.error($i18n.t(`File not found.`));
|
||||
if (clipboardData && clipboardData.items) {
|
||||
for (const item of clipboardData.items) {
|
||||
if (item.type.indexOf('image') !== -1) {
|
||||
const blob = item.getAsFile();
|
||||
const reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
files = [
|
||||
...files,
|
||||
{
|
||||
type: 'image',
|
||||
url: `${e.target.result}`
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
reader.readAsDataURL(blob);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Error processing files:', error);
|
||||
toast.error($i18n.t(`An error occurred while processing files.`));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
Loading…
Reference in New Issue
Block a user