mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Feat: add datasource Dropbox (#11488)
### What problem does this PR solve? Add datasource Dropbox. ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -12,6 +12,7 @@ export enum DataSourceKey {
|
||||
MOODLE = 'moodle',
|
||||
// GMAIL = 'gmail',
|
||||
JIRA = 'jira',
|
||||
DROPBOX = 'dropbox',
|
||||
// SHAREPOINT = 'sharepoint',
|
||||
// SLACK = 'slack',
|
||||
// TEAMS = 'teams',
|
||||
@ -53,6 +54,11 @@ export const DataSourceInfo = {
|
||||
description: t(`setting.${DataSourceKey.JIRA}Description`),
|
||||
icon: <SvgIcon name={'data-source/jira'} width={38} />,
|
||||
},
|
||||
[DataSourceKey.DROPBOX]: {
|
||||
name: 'Dropbox',
|
||||
description: t(`setting.${DataSourceKey.DROPBOX}Description`),
|
||||
icon: <SvgIcon name={'data-source/dropbox'} width={38} />,
|
||||
},
|
||||
};
|
||||
|
||||
export const DataSourceFormBaseFields = [
|
||||
@ -408,6 +414,22 @@ export const DataSourceFormFields = {
|
||||
tooltip: t('setting.jiraPasswordTip'),
|
||||
},
|
||||
],
|
||||
[DataSourceKey.DROPBOX]: [
|
||||
{
|
||||
label: 'Access Token',
|
||||
name: 'config.credentials.dropbox_access_token',
|
||||
type: FormFieldType.Password,
|
||||
required: true,
|
||||
tooltip: t('setting.dropboxAccessTokenTip'),
|
||||
},
|
||||
{
|
||||
label: 'Batch Size',
|
||||
name: 'config.batch_size',
|
||||
type: FormFieldType.Number,
|
||||
required: false,
|
||||
placeholder: 'Defaults to 2',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export const DataSourceFormDefaultValues = {
|
||||
@ -508,4 +530,14 @@ export const DataSourceFormDefaultValues = {
|
||||
},
|
||||
},
|
||||
},
|
||||
[DataSourceKey.DROPBOX]: {
|
||||
name: '',
|
||||
source: DataSourceKey.DROPBOX,
|
||||
config: {
|
||||
batch_size: 2,
|
||||
credentials: {
|
||||
dropbox_access_token: '',
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
@ -56,6 +56,12 @@ const dataSourceTemplates = [
|
||||
description: DataSourceInfo[DataSourceKey.JIRA].description,
|
||||
icon: DataSourceInfo[DataSourceKey.JIRA].icon,
|
||||
},
|
||||
{
|
||||
id: DataSourceKey.DROPBOX,
|
||||
name: DataSourceInfo[DataSourceKey.DROPBOX].name,
|
||||
description: DataSourceInfo[DataSourceKey.DROPBOX].description,
|
||||
icon: DataSourceInfo[DataSourceKey.DROPBOX].icon,
|
||||
},
|
||||
];
|
||||
const DataSource = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
Reference in New Issue
Block a user