mirror of
https://github.com/open-webui/open-webui
synced 2025-03-03 19:07:21 +00:00
feat: Add comprehensive logging for Google Drive file upload process
This commit is contained in:
parent
9b939e99f2
commit
434241149b
src/lib/components/chat
@ -350,7 +350,14 @@
|
||||
// File upload functions
|
||||
|
||||
const uploadGoogleDriveFile = async (fileData) => {
|
||||
console.log('Uploading Google Drive file:', fileData);
|
||||
console.log('Starting uploadGoogleDriveFile with:', {
|
||||
id: fileData.id,
|
||||
name: fileData.name,
|
||||
url: fileData.url,
|
||||
headers: {
|
||||
Authorization: 'Bearer [REDACTED]'
|
||||
}
|
||||
});
|
||||
const tempItemId = uuidv4();
|
||||
const fileItem = {
|
||||
type: 'file',
|
||||
@ -374,12 +381,20 @@
|
||||
'Accept': 'application/json'
|
||||
};
|
||||
|
||||
console.log('Calling processWeb with:', {
|
||||
url: fileData.url,
|
||||
headers: {
|
||||
Authorization: 'Bearer [REDACTED]',
|
||||
Accept: 'application/json'
|
||||
}
|
||||
});
|
||||
const res = await processWeb(
|
||||
localStorage.token,
|
||||
'',
|
||||
fileData.url,
|
||||
headers
|
||||
);
|
||||
console.log('processWeb response:', res);
|
||||
|
||||
if (res && res.collection_name) {
|
||||
console.log('File processed successfully:', res);
|
||||
|
@ -526,13 +526,23 @@
|
||||
const fileData = await createPicker();
|
||||
console.log('Picker returned file data:', fileData);
|
||||
if (fileData) {
|
||||
console.log('Dispatching upload event with file data');
|
||||
dispatch('upload', {
|
||||
type: 'google-drive',
|
||||
data: fileData // fileData now includes token
|
||||
console.log('Preparing to dispatch upload event with:', {
|
||||
id: fileData.id,
|
||||
name: fileData.name,
|
||||
url: fileData.url,
|
||||
headers: {
|
||||
Authorization: 'Bearer [REDACTED]'
|
||||
}
|
||||
});
|
||||
const uploadEvent = {
|
||||
type: 'google-drive',
|
||||
data: fileData
|
||||
};
|
||||
console.log('Dispatching upload event:', uploadEvent);
|
||||
dispatch('upload', uploadEvent);
|
||||
console.log('Upload event dispatched');
|
||||
} else {
|
||||
console.log('No file was selected');
|
||||
console.log('No file was selected from Google Drive');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Google Drive Error:', error);
|
||||
|
Loading…
Reference in New Issue
Block a user