mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-24 15:36:50 +08:00
Feat: Add Webdav storage as data source (#11422)
### What problem does this PR solve? This PR adds webdav storage as data source for data sync service. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
15
web/src/assets/svg/data-source/webdav.svg
Normal file
15
web/src/assets/svg/data-source/webdav.svg
Normal file
@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg"
|
||||
aria-label="NextCloud" role="img"
|
||||
viewBox="0 0 512 512">
|
||||
|
||||
<rect
|
||||
width="512" height="512"
|
||||
rx="15%"
|
||||
fill="#0082c9"/>
|
||||
|
||||
<g stroke="#ffffff" stroke-width="33" fill="none">
|
||||
|
||||
<circle r="40" cy="256" cx="120"/>
|
||||
|
After Width: | Height: | Size: 449 B |
@ -736,6 +736,9 @@ Example: Virtual Hosted Style`,
|
||||
'Sync pages and databases from Notion for knowledge retrieval.',
|
||||
google_driveDescription:
|
||||
'Connect your Google Drive via OAuth and sync specific folders or drives.',
|
||||
webdavDescription: 'Connect to WebDAV servers to sync files.',
|
||||
webdavRemotePathTip:
|
||||
'Optional: Specify a folder path on the WebDAV server (e.g., /Documents). Leave empty to sync from root.',
|
||||
google_driveTokenTip:
|
||||
'Upload the OAuth token JSON generated from the OAuth helper or Google Cloud Console. You may also upload a client_secret JSON from an "installed" or "web" application. If this is your first sync, a browser window will open to complete the OAuth consent. If the JSON already contains a refresh token, it will be reused automatically.',
|
||||
google_drivePrimaryAdminTip:
|
||||
|
||||
@ -12,6 +12,7 @@ export enum DataSourceKey {
|
||||
MOODLE = 'moodle',
|
||||
// GMAIL = 'gmail',
|
||||
JIRA = 'jira',
|
||||
WEBDAV = 'webdav',
|
||||
DROPBOX = 'dropbox',
|
||||
// SHAREPOINT = 'sharepoint',
|
||||
// SLACK = 'slack',
|
||||
@ -54,6 +55,11 @@ export const DataSourceInfo = {
|
||||
description: t(`setting.${DataSourceKey.JIRA}Description`),
|
||||
icon: <SvgIcon name={'data-source/jira'} width={38} />,
|
||||
},
|
||||
[DataSourceKey.WEBDAV]: {
|
||||
name: 'WebDAV',
|
||||
description: t(`setting.${DataSourceKey.WEBDAV}Description`),
|
||||
icon: <SvgIcon name={'data-source/webdav'} width={38} />,
|
||||
},
|
||||
[DataSourceKey.DROPBOX]: {
|
||||
name: 'Dropbox',
|
||||
description: t(`setting.${DataSourceKey.DROPBOX}Description`),
|
||||
@ -429,6 +435,35 @@ export const DataSourceFormFields = {
|
||||
tooltip: t('setting.jiraPasswordTip'),
|
||||
},
|
||||
],
|
||||
[DataSourceKey.WEBDAV]: [
|
||||
{
|
||||
label: 'WebDAV Server URL',
|
||||
name: 'config.base_url',
|
||||
type: FormFieldType.Text,
|
||||
required: true,
|
||||
placeholder: 'https://webdav.example.com',
|
||||
},
|
||||
{
|
||||
label: 'Username',
|
||||
name: 'config.credentials.username',
|
||||
type: FormFieldType.Text,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: 'Password',
|
||||
name: 'config.credentials.password',
|
||||
type: FormFieldType.Password,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
label: 'Remote Path',
|
||||
name: 'config.remote_path',
|
||||
type: FormFieldType.Text,
|
||||
required: false,
|
||||
placeholder: '/',
|
||||
tooltip: t('setting.webdavRemotePathTip'),
|
||||
},
|
||||
],
|
||||
[DataSourceKey.DROPBOX]: [
|
||||
{
|
||||
label: 'Access Token',
|
||||
@ -546,6 +581,18 @@ export const DataSourceFormDefaultValues = {
|
||||
},
|
||||
},
|
||||
},
|
||||
[DataSourceKey.WEBDAV]: {
|
||||
name: '',
|
||||
source: DataSourceKey.WEBDAV,
|
||||
config: {
|
||||
base_url: '',
|
||||
remote_path: '/',
|
||||
credentials: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
[DataSourceKey.DROPBOX]: {
|
||||
name: '',
|
||||
source: DataSourceKey.DROPBOX,
|
||||
|
||||
Reference in New Issue
Block a user