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
3cb74ab6
Unverified
Commit
3cb74ab6
authored
Jan 17, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jan 17, 2024
Browse files
Merge pull request #503 from nitrodude/fix-md-rag-ui
Fix: ".md" documents upload only works for drag n. drop in message.
parents
55ba5e62
7f144795
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
5 deletions
+14
-5
src/lib/components/chat/MessageInput.svelte
src/lib/components/chat/MessageInput.svelte
+6
-3
src/routes/(app)/documents/+page.svelte
src/routes/(app)/documents/+page.svelte
+8
-2
No files found.
src/lib/components/chat/MessageInput.svelte
View file @
3cb74ab6
...
...
@@ -301,7 +301,10 @@
const file = inputFiles[0];
if (['image/gif', 'image/jpeg', 'image/png'].includes(file['type'])) {
reader.readAsDataURL(file);
} else if (SUPPORTED_FILE_TYPE.includes(file['type'])) {
} else if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
['md'].includes(file.name.split('.').at(-1))
) {
uploadDoc(file);
filesInputElement.value = '';
} else {
...
...
@@ -461,8 +464,8 @@
placeholder={chatInputPlaceholder !== ''
? chatInputPlaceholder
: speechRecognitionListening
? 'Listening...'
: 'Send a message'}
? 'Listening...'
: 'Send a message'}
bind:value={prompt}
on:keypress={(e) => {
if (e.keyCode == 13 && !e.shiftKey) {
...
...
src/routes/(app)/documents/+page.svelte
View file @
3cb74ab6
...
...
@@ -67,7 +67,10 @@
if (inputFiles && inputFiles.length > 0) {
const file = inputFiles[0];
if (SUPPORTED_FILE_TYPE.includes(file['type'])) {
if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
['md'].includes(file.name.split('.').at(-1))
) {
uploadDoc(file);
} else {
toast.error(`Unsupported File Type '${file['type']}'.`);
...
...
@@ -144,7 +147,10 @@
on:change={async (e) => {
if (inputFiles && inputFiles.length > 0) {
const file = inputFiles[0];
if (SUPPORTED_FILE_TYPE.includes(file['type'])) {
if (
SUPPORTED_FILE_TYPE.includes(file['type']) ||
['md'].includes(file.name.split('.').at(-1))
) {
uploadDoc(file);
} else {
toast.error(`Unsupported File Type '${file['type']}'.`);
...
...
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