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
c5f13cfd
Commit
c5f13cfd
authored
May 19, 2024
by
Yanyutin753
Browse files
⭐
Expend upload image file types
parent
22d23afb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
5 deletions
+5
-5
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+2
-2
src/lib/components/chat/Settings/Account.svelte
src/lib/components/chat/Settings/Account.svelte
+1
-1
src/routes/(app)/workspace/modelfiles/create/+page.svelte
src/routes/(app)/workspace/modelfiles/create/+page.svelte
+1
-1
src/routes/(app)/workspace/modelfiles/edit/+page.svelte
src/routes/(app)/workspace/modelfiles/edit/+page.svelte
+1
-1
No files found.
src/lib/components/chat/MessageInput.svelte
View file @
c5f13cfd
...
@@ -357,7 +357,7 @@
...
@@ -357,7 +357,7 @@
if (inputFiles && inputFiles.length > 0) {
if (inputFiles && inputFiles.length > 0) {
inputFiles.forEach((file) => {
inputFiles.forEach((file) => {
console.log(file, file.name.split('.').at(-1));
console.log(file, file.name.split('.').at(-1));
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
if (['image/gif',
'image/webp',
'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader();
let reader = new FileReader();
reader.onload = (event) => {
reader.onload = (event) => {
files = [
files = [
...
@@ -547,7 +547,7 @@
...
@@ -547,7 +547,7 @@
if (inputFiles && inputFiles.length > 0) {
if (inputFiles && inputFiles.length > 0) {
const _inputFiles = Array.from(inputFiles);
const _inputFiles = Array.from(inputFiles);
_inputFiles.forEach((file) => {
_inputFiles.forEach((file) => {
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
if (['image/gif',
'image/webp',
'image/jpeg', 'image/png'].includes(file['type'])) {
let reader = new FileReader();
let reader = new FileReader();
reader.onload = (event) => {
reader.onload = (event) => {
files = [
files = [
...
...
src/lib/components/chat/Settings/Account.svelte
View file @
c5f13cfd
...
@@ -127,7 +127,7 @@
...
@@ -127,7 +127,7 @@
if (
if (
files.length > 0 &&
files.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(files[0]['type'])
['image/gif',
'image/webp',
'image/jpeg', 'image/png'].includes(files[0]['type'])
) {
) {
reader.readAsDataURL(files[0]);
reader.readAsDataURL(files[0]);
}
}
...
...
src/routes/(app)/workspace/modelfiles/create/+page.svelte
View file @
c5f13cfd
...
@@ -339,7 +339,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
...
@@ -339,7 +339,7 @@ SYSTEM """${system}"""`.replace(/^\s*\n/gm, '');
if (
if (
inputFiles &&
inputFiles &&
inputFiles.length > 0 &&
inputFiles.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
['image/gif',
'image/webp',
'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
) {
) {
reader.readAsDataURL(inputFiles[0]);
reader.readAsDataURL(inputFiles[0]);
} else {
} else {
...
...
src/routes/(app)/workspace/modelfiles/edit/+page.svelte
View file @
c5f13cfd
...
@@ -238,7 +238,7 @@
...
@@ -238,7 +238,7 @@
if (
if (
inputFiles &&
inputFiles &&
inputFiles.length > 0 &&
inputFiles.length > 0 &&
['image/gif', 'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
['image/gif',
'image/webp',
'image/jpeg', 'image/png'].includes(inputFiles[0]['type'])
) {
) {
reader.readAsDataURL(inputFiles[0]);
reader.readAsDataURL(inputFiles[0]);
} else {
} else {
...
...
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