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