feat: Add Google Drive integration toggle to document settings

This commit is contained in:
Taylor Wilsdon 2024-12-18 13:24:11 -05:00 committed by Taylor Wilsdon (aider)
parent 366158ff04
commit d43ca803ca

View File

@ -56,6 +56,8 @@
let chunkOverlap = 0;
let pdfExtractImages = true;
let enableGoogleDrive = false;
let OpenAIUrl = '';
let OpenAIKey = '';
@ -175,6 +177,7 @@
}
const res = await updateRAGConfig(localStorage.token, {
pdf_extract_images: pdfExtractImages,
enable_google_drive: enableGoogleDrive,
file: {
max_size: fileMaxSize === '' ? null : fileMaxSize,
max_count: fileMaxCount === '' ? null : fileMaxCount
@ -187,7 +190,7 @@
content_extraction: {
engine: contentExtractionEngine,
tika_server_url: tikaServerUrl
}
},
});
await updateQuerySettings(localStorage.token, querySettings);
@ -245,6 +248,8 @@
fileMaxSize = res?.file.max_size ?? '';
fileMaxCount = res?.file.max_count ?? '';
enableGoogleDrive = res.enable_google_drive;
}
});
</script>
@ -571,6 +576,8 @@
</div>
</div>
<hr class=" dark:border-gray-850" />
{#if showTikaServerUrl}
<div class="flex w-full mt-1">
<div class="flex-1 mr-2">
@ -584,6 +591,21 @@
{/if}
</div>
<div class="">
<div class=" space-y-3 overflow-y-scroll scrollbar-hidden h-full">
<div class="text-sm font-medium mb-1">{$i18n.t('Google Drive')}</div>
<div class=" flex gap-1.5">
<div class="my-2">
<div class="flex justify-between items-center text-xs">{$i18n.t('Enable Google Drive')}</div>
<div class="flex justify-between items-center text-xs">
<Switch bind:state={enableGoogleDrive} />
</div>
</div>
</div>
</div>
<hr class=" dark:border-gray-850" />
<div class=" ">