mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-13 04:45:19 +00:00
feat: Add Google Drive picker button to MessageInput component
This commit is contained in:
parent
61b1a8fdab
commit
f566c5940a
2 changed files with 12 additions and 0 deletions
|
|
@ -2316,6 +2316,8 @@
|
|||
await uploadWeb(data);
|
||||
} else if (type === 'youtube') {
|
||||
await uploadYoutubeTranscription(data);
|
||||
} else if (type === 'google-drive') {
|
||||
await uploadGoogleDriveFile(data);
|
||||
}
|
||||
}}
|
||||
on:submit={async (e) => {
|
||||
|
|
|
|||
|
|
@ -496,6 +496,16 @@
|
|||
uploadFilesHandler={() => {
|
||||
filesInputElement.click();
|
||||
}}
|
||||
uploadGoogleDriveHandler={async () => {
|
||||
try {
|
||||
const fileData = await createPicker();
|
||||
if (fileData) {
|
||||
dispatch('upload', { type: 'google-drive', data: fileData });
|
||||
}
|
||||
} catch (error) {
|
||||
toast.error('Error accessing Google Drive: ' + error.message);
|
||||
}
|
||||
}}
|
||||
onClose={async () => {
|
||||
await tick();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue