fix: i18n for data source internal configuration fields (#17217)

This commit is contained in:
euvre
2026-07-22 16:13:20 +08:00
committed by GitHub
parent dabe426c36
commit 21e5f00a53
10 changed files with 849 additions and 321 deletions

View File

@@ -18,6 +18,8 @@ export default {
rename: 'Rename',
name: 'Name',
save: 'Save',
stop: 'Stop',
resume: 'Resume',
namePlaceholder: 'Please input name',
descriptionPlaceholder: 'Enter description',
next: 'Next',
@@ -1268,6 +1270,231 @@ This auto-tagging feature enhances retrieval by adding another layer of domain-s
configureModelTitle: 'Configure model',
connectorNameTip: 'A descriptive name for the connector',
syncDeletedFiles: 'Sync deleted files',
// Data source form field labels
dataSourceFieldName: 'Name',
dataSourceFieldSource: 'Source',
dataSourceFieldTenantId: 'Tenant ID',
dataSourceFieldClientId: 'Client ID',
dataSourceFieldClientSecret: 'Client Secret',
dataSourceFieldFolderPathOptional: 'Folder Path (optional)',
dataSourceFieldBatchSize: 'Batch Size',
dataSourceFieldMailFolder: 'Mail Folder',
dataSourceFieldMailboxUserIds: 'Mailbox User IDs (optional)',
dataSourceFieldInstanceUrl: 'Instance URL',
dataSourceFieldObjects: 'Objects',
dataSourceFieldApiVersion: 'API Version',
dataSourceFieldAuthMode: 'Auth Mode',
dataSourceFieldAccountName: 'Account Name',
dataSourceFieldAccountKey: 'Account Key',
dataSourceFieldConnectionString: 'Connection String',
dataSourceFieldContainerUrl: 'Container URL',
dataSourceFieldSasToken: 'SAS Token',
dataSourceFieldContainerName: 'Container Name',
dataSourceFieldPrefixOptional: 'Prefix (optional)',
dataSourceFieldFeedUrl: 'Feed URL',
dataSourceFieldGcsAccessKeyId: 'GCS Access Key ID',
dataSourceFieldGcsSecretAccessKey: 'GCS Secret Access Key',
dataSourceFieldBucketName: 'Bucket Name',
dataSourceFieldOciNamespace: 'OCI Namespace',
dataSourceFieldOciRegion: 'OCI Region',
dataSourceFieldOciAccessKeyId: 'OCI Access Key ID',
dataSourceFieldOciSecretAccessKey: 'OCI Secret Access Key',
dataSourceFieldR2AccountId: 'R2 Account ID',
dataSourceFieldR2AccessKeyId: 'R2 Access Key ID',
dataSourceFieldR2SecretAccessKey: 'R2 Secret Access Key',
dataSourceFieldNotionIntegrationToken: 'Notion Integration Token',
dataSourceFieldRootPageId: 'Root Page Id',
dataSourceFieldDiscordBotToken: 'Discord Bot Token',
dataSourceFieldServerIds: 'Server IDs',
dataSourceFieldChannels: 'Channels',
dataSourceFieldPrimaryAdminEmail: 'Primary Admin Email',
dataSourceFieldOauthTokenJson: 'OAuth Token JSON',
dataSourceFieldMyDriveEmails: 'My Drive Emails',
dataSourceFieldSharedFolderUrls: 'Shared Folder URLs',
dataSourceFieldMoodleUrl: 'Moodle URL',
dataSourceFieldApiToken: 'API Token',
dataSourceFieldSlackBotToken: 'Slack Bot Token',
dataSourceFieldSiteUrl: 'Site URL',
dataSourceFieldWebdavServerUrl: 'WebDAV Server URL',
dataSourceFieldUsername: 'Username',
dataSourceFieldPassword: 'Password',
dataSourceFieldRemotePath: 'Remote Path',
dataSourceFieldAccessToken: 'Access Token',
dataSourceFieldBoxOauthConfiguration: 'Box OAuth Configuration',
dataSourceFieldFolderId: 'Folder ID',
dataSourceFieldBaseId: 'Base ID',
dataSourceFieldTableNameOrId: 'Table Name OR ID',
dataSourceFieldOperatorId: 'Operator ID',
dataSourceFieldProjectOwner: 'Project Owner',
dataSourceFieldProjectName: 'Project Name',
dataSourceFieldGitlabPersonalAccessToken: 'GitLab Personal Access Token',
dataSourceFieldGitlabUrl: 'GitLab URL',
dataSourceFieldIncludeIssues: 'Include Issues',
dataSourceFieldWorkspaceId: 'Workspace ID',
dataSourceFieldProjectIds: 'Project IDs',
dataSourceFieldTeamId: 'Team ID',
dataSourceFieldRepositoryOwner: 'Repository Owner',
dataSourceFieldRepositoryName: 'Repository Name',
dataSourceFieldGithubAccessToken: 'GitHub Access Token',
dataSourceFieldHost: 'Host',
dataSourceFieldPort: 'Port',
dataSourceFieldMailboxes: 'Mailboxes',
dataSourceFieldPollRange: 'Poll Range',
dataSourceFieldZendeskDomain: 'Zendesk Domain',
dataSourceFieldZendeskEmail: 'Zendesk Email',
dataSourceFieldZendeskToken: 'Zendesk Token',
dataSourceFieldContent: 'Content',
dataSourceFieldDatabase: 'Database',
dataSourceFieldSqlQuery: 'SQL Query',
dataSourceFieldContentColumns: 'Content Columns',
dataSourceFieldMetadataColumns: 'Metadata Columns',
dataSourceFieldIdColumn: 'ID Column',
dataSourceFieldTimestampColumn: 'Timestamp Column',
dataSourceFieldProjectId: 'Project ID',
dataSourceFieldLocation: 'Location',
dataSourceFieldServiceAccountJson: 'Service Account JSON',
dataSourceFieldDatasetId: 'Dataset ID',
dataSourceFieldTableId: 'Table ID',
dataSourceFieldMaxBytesBilled: 'Max Bytes Billed',
dataSourceFieldJobTimeout: 'Job Timeout (ms)',
dataSourceFieldPageSize: 'Page Size',
dataSourceFieldUseQueryCache: 'Use Query Cache',
dataSourceFieldBaseUrl: 'Base URL',
dataSourceFieldHttpMethod: 'HTTP Method',
dataSourceFieldQueryParameters: 'Query Parameters',
dataSourceFieldItemsPath: 'Items Path',
dataSourceFieldIdField: 'ID Field',
dataSourceFieldAuthType: 'Auth Type',
dataSourceFieldApiKeyHeaderName: 'API Key Header Name',
dataSourceFieldApiKeyValue: 'API Key Value',
dataSourceFieldBearerToken: 'Bearer Token',
dataSourceFieldContentFields: 'Content Fields',
dataSourceFieldMetadataFields: 'Metadata Fields',
dataSourceFieldPaginationType: 'Pagination Type',
dataSourceFieldStartPage: 'Start Page',
dataSourceFieldOffsetParam: 'Offset Param',
dataSourceFieldStartOffset: 'Start Offset',
dataSourceFieldCursorParam: 'Cursor Param',
dataSourceFieldNextCursorJsonpath: 'Next Cursor JSONPath',
dataSourceFieldAdvancedSettings: 'Advanced Settings',
dataSourceFieldCustomHeaders: 'Custom Headers (JSON)',
dataSourceFieldLimitParam: 'Limit Param',
dataSourceFieldInitialCursor: 'Initial Cursor',
dataSourceFieldMaxPages: 'Max Pages',
dataSourceFieldRequestDelay: 'Request Delay (seconds)',
dataSourceFieldPollTimestampField: 'Poll Timestamp Field',
dataSourceFieldRequestBody: 'Request Body (POST) JSON',
dataSourceFieldConfluenceUsername: 'Confluence Username',
dataSourceFieldConfluenceAccessToken: 'Confluence Access Token',
dataSourceFieldWikiBaseUrl: 'Wiki Base URL',
dataSourceFieldIsCloud: 'Is Cloud',
dataSourceFieldIndexMode: 'Index Mode',
dataSourceFieldPageId: 'Page ID',
dataSourceFieldSpaceKey: 'Space Key',
dataSourceFieldIndexRecursively: 'Index Recursively',
dataSourceFieldJiraUserEmail: 'Jira User Email',
dataSourceFieldJiraUsername: 'Jira Username',
dataSourceFieldJiraBaseUrl: 'Jira Base URL',
dataSourceFieldProjectKey: 'Project Key',
dataSourceFieldCustomJql: 'Custom JQL',
dataSourceFieldAttachmentSizeLimit: 'Attachment Size Limit (bytes)',
dataSourceFieldLabelsToSkip: 'Labels to Skip',
dataSourceFieldCommentEmailBlacklist: 'Comment Email Blacklist',
dataSourceFieldIncludeComments: 'Include Comments',
dataSourceFieldIncludeAttachments: 'Include Attachments',
dataSourceFieldMode: 'Mode',
dataSourceFieldJiraApiToken: 'Jira API Token',
dataSourceFieldJiraPassword: 'Jira Password',
dataSourceFieldUseScopedToken: 'Use Scoped Token',
dataSourceFieldRegion: 'Region',
dataSourceFieldPrefix: 'Prefix',
dataSourceFieldAuthentication: 'Authentication',
dataSourceFieldAwsAccessKeyId: 'AWS Access Key ID',
dataSourceFieldAwsSecretAccessKey: 'AWS Secret Access Key',
dataSourceFieldRoleArn: 'Role ARN',
dataSourceFieldAddressingStyle: 'Addressing Style',
dataSourceFieldEndpointUrl: 'Endpoint URL',
dataSourceFieldSeafileServerUrl: 'SeaFile Server URL',
dataSourceFieldSyncScope: 'Sync Scope',
dataSourceFieldAccountApiToken: 'Account API Token',
dataSourceFieldIncludeSharedLibraries: 'Include Shared Libraries',
dataSourceFieldLibraryToken: 'Library Token',
dataSourceFieldLibraryId: 'Library ID',
dataSourceFieldDirectoryPath: 'Directory Path',
dataSourceFieldBitbucketAccountEmail: 'Bitbucket Account Email',
dataSourceFieldBitbucketApiToken: 'Bitbucket API Token',
dataSourceFieldWorkspace: 'Workspace',
dataSourceFieldRepositorySlugs: 'Repository Slugs',
dataSourceFieldProjects: 'Projects',
dataSourceIncludePullRequests: 'Include Pull Requests',
dataSourceIncludeMergeRequests: 'Include Merge Requests',
dataSourceIncludeIssues: 'Include Issues',
dataSourceIncludeCodeFiles: 'Include Code Files',
// Data source form options
dataSourceOptionAccountKey: 'Account Key',
dataSourceOptionConnectionString: 'Connection String',
dataSourceOptionSasToken: 'SAS Token',
dataSourceOptionArticles: 'Articles',
dataSourceOptionTickets: 'Tickets',
dataSourceOptionNone: 'None',
dataSourceOptionApiKeyHeader: 'API Key (Header)',
dataSourceOptionBearerToken: 'Bearer Token',
dataSourceOptionBasicAuth: 'Basic Auth',
dataSourceOptionPage: 'Page',
dataSourceOptionOffset: 'Offset',
dataSourceOptionCursor: 'Cursor',
dataSourceOptionEverything: 'Everything',
dataSourceOptionSpace: 'Space',
dataSourceOptionCloud: 'Cloud',
dataSourceOptionServer: 'Server',
dataSourceOptionS3Compatible: 'S3 Compatible',
dataSourceOptionAccessKey: 'Access Key',
dataSourceOptionIamRole: 'IAM Role',
dataSourceOptionAssumeRole: 'Assume Role',
dataSourceOptionVirtualHostedStyle: 'Virtual Hosted Style',
dataSourceOptionPathStyle: 'Path Style',
dataSourceOptionEntireAccount: 'Entire Account',
dataSourceOptionSingleLibrary: 'Single Library',
dataSourceOptionSpecificDirectory: 'Specific Directory',
dataSourceOptionRepositories: 'Repositories',
dataSourceOptionProjects: 'Projects',
dataSourceOptionWorkspace: 'Workspace',
// Data source validation messages
dataSourceValidationFieldRequired: '{{label}} is required',
dataSourceValidationMinOne: '{{label}} must be at least 1',
dataSourceConfluenceEverythingTip:
'This choice will index all pages the provided credentials have access to.',
dataSourceS3AssumeRoleTip:
'No credentials required. Uses the default environment role.',
dataSourceS3RoleArnTip:
'The role will be assumed by the runtime environment.',
dataSourceS3RegionRequired: 'Region is required when using access key',
dataSourceAzureAccountNameRequired:
'Account name is required for account key auth',
dataSourceAzureAccountKeyRequired:
'Account key is required for account key auth',
dataSourceAzureConnectionStringRequired:
'Connection string is required for connection string auth',
dataSourceAzureContainerUrlRequired:
'Container URL is required for SAS token auth',
dataSourceAzureSasTokenRequired:
'SAS token is required for SAS token auth',
dataSourceAzureContainerNameRequired:
'Container name is required for this auth mode',
dataSourceBigqueryDatasetIdRequired:
'Dataset ID is required when not using a custom SQL Query',
dataSourceBigqueryTableIdRequired:
'Table ID is required when not using a custom SQL Query',
dataSourceBigqueryQueryRequired:
'Provide a SQL Query, or both Dataset ID and Table ID',
dataSourceSalesforceInstanceUrlInvalid:
'Must be a valid Salesforce domain (https://...salesforce.com)',
dataSourceSalesforceApiVersionInvalid:
'API version must match format like v59.0',
// Data source detail page labels
dataSourcePruneFreq: 'Prune Freq',
dataSourceRefreshFreq: 'Refresh Freq',
dataSourceTimeoutSecs: 'Timeout Secs',
confluenceIsCloudTip:
'Check if this is a Confluence Cloud instance, uncheck for Confluence Server/Data Center',
confluenceWikiBaseUrlTip:

View File

@@ -18,6 +18,8 @@ export default {
rename: '重命名',
name: '名称',
save: '保存',
stop: '停止',
resume: '恢复',
namePlaceholder: '请输入名称',
descriptionPlaceholder: '请输入描述',
next: '下一步',
@@ -1259,6 +1261,225 @@ NER使用 spaCy NER 和基于规则的关键词提取来抽取实体和关系
'用英文逗号分隔的仓库 slug例如repo-one,repo-two',
connectorNameTip: '为连接器命名',
syncDeletedFiles: '同步删除文件',
// Data source form field labels
dataSourceFieldName: '名称',
dataSourceFieldSource: '数据源',
dataSourceFieldTenantId: '租户 ID',
dataSourceFieldClientId: '客户端 ID',
dataSourceFieldClientSecret: '客户端密钥',
dataSourceFieldFolderPathOptional: '文件夹路径(可选)',
dataSourceFieldBatchSize: '批量大小',
dataSourceFieldMailFolder: '邮件文件夹',
dataSourceFieldMailboxUserIds: '邮箱用户 ID可选',
dataSourceFieldInstanceUrl: '实例 URL',
dataSourceFieldObjects: '对象',
dataSourceFieldApiVersion: 'API 版本',
dataSourceFieldAuthMode: '认证模式',
dataSourceFieldAccountName: '账户名称',
dataSourceFieldAccountKey: '账户密钥',
dataSourceFieldConnectionString: '连接字符串',
dataSourceFieldContainerUrl: '容器 URL',
dataSourceFieldSasToken: 'SAS 令牌',
dataSourceFieldContainerName: '容器名称',
dataSourceFieldPrefixOptional: '前缀(可选)',
dataSourceFieldFeedUrl: '订阅源 URL',
dataSourceFieldGcsAccessKeyId: 'GCS 访问密钥 ID',
dataSourceFieldGcsSecretAccessKey: 'GCS 访问密钥',
dataSourceFieldBucketName: '存储桶名称',
dataSourceFieldOciNamespace: 'OCI 命名空间',
dataSourceFieldOciRegion: 'OCI 区域',
dataSourceFieldOciAccessKeyId: 'OCI 访问密钥 ID',
dataSourceFieldOciSecretAccessKey: 'OCI 访问密钥',
dataSourceFieldR2AccountId: 'R2 账户 ID',
dataSourceFieldR2AccessKeyId: 'R2 访问密钥 ID',
dataSourceFieldR2SecretAccessKey: 'R2 访问密钥',
dataSourceFieldNotionIntegrationToken: 'Notion 集成令牌',
dataSourceFieldRootPageId: '根页面 ID',
dataSourceFieldDiscordBotToken: 'Discord 机器人令牌',
dataSourceFieldServerIds: '服务器 ID',
dataSourceFieldChannels: '频道',
dataSourceFieldPrimaryAdminEmail: '主管理员邮箱',
dataSourceFieldOauthTokenJson: 'OAuth 令牌 JSON',
dataSourceFieldMyDriveEmails: '我的云端硬盘邮箱',
dataSourceFieldSharedFolderUrls: '共享文件夹 URL',
dataSourceFieldMoodleUrl: 'Moodle URL',
dataSourceFieldApiToken: 'API 令牌',
dataSourceFieldSlackBotToken: 'Slack 机器人令牌',
dataSourceFieldSiteUrl: '站点 URL',
dataSourceFieldWebdavServerUrl: 'WebDAV 服务器 URL',
dataSourceFieldUsername: '用户名',
dataSourceFieldPassword: '密码',
dataSourceFieldRemotePath: '远程路径',
dataSourceFieldAccessToken: '访问令牌',
dataSourceFieldBoxOauthConfiguration: 'Box OAuth 配置',
dataSourceFieldFolderId: '文件夹 ID',
dataSourceFieldBaseId: 'Base ID',
dataSourceFieldTableNameOrId: '表名称或 ID',
dataSourceFieldOperatorId: '操作员 ID',
dataSourceFieldProjectOwner: '项目所有者',
dataSourceFieldProjectName: '项目名称',
dataSourceFieldGitlabPersonalAccessToken: 'GitLab 个人访问令牌',
dataSourceFieldGitlabUrl: 'GitLab URL',
dataSourceFieldIncludeIssues: '包含 Issues',
dataSourceFieldWorkspaceId: '工作区 ID',
dataSourceFieldProjectIds: '项目 ID',
dataSourceFieldTeamId: '团队 ID',
dataSourceFieldRepositoryOwner: '仓库所有者',
dataSourceFieldRepositoryName: '仓库名称',
dataSourceFieldGithubAccessToken: 'GitHub 访问令牌',
dataSourceFieldHost: '主机',
dataSourceFieldPort: '端口',
dataSourceFieldMailboxes: '邮箱',
dataSourceFieldPollRange: '轮询范围',
dataSourceFieldZendeskDomain: 'Zendesk 域名',
dataSourceFieldZendeskEmail: 'Zendesk 邮箱',
dataSourceFieldZendeskToken: 'Zendesk 令牌',
dataSourceFieldContent: '内容',
dataSourceFieldDatabase: '数据库',
dataSourceFieldSqlQuery: 'SQL 查询',
dataSourceFieldContentColumns: '内容列',
dataSourceFieldMetadataColumns: '元数据列',
dataSourceFieldIdColumn: 'ID 列',
dataSourceFieldTimestampColumn: '时间戳列',
dataSourceFieldProjectId: '项目 ID',
dataSourceFieldLocation: '位置',
dataSourceFieldServiceAccountJson: '服务账号 JSON',
dataSourceFieldDatasetId: '数据集 ID',
dataSourceFieldTableId: '表 ID',
dataSourceFieldMaxBytesBilled: '最大计费字节数',
dataSourceFieldJobTimeout: '作业超时时间(毫秒)',
dataSourceFieldPageSize: '每页大小',
dataSourceFieldUseQueryCache: '使用查询缓存',
dataSourceFieldBaseUrl: '基础 URL',
dataSourceFieldHttpMethod: 'HTTP 方法',
dataSourceFieldQueryParameters: '查询参数',
dataSourceFieldItemsPath: '数据项路径',
dataSourceFieldIdField: 'ID 字段',
dataSourceFieldAuthType: '认证类型',
dataSourceFieldApiKeyHeaderName: 'API Key 请求头名称',
dataSourceFieldApiKeyValue: 'API Key 值',
dataSourceFieldBearerToken: 'Bearer 令牌',
dataSourceFieldContentFields: '内容字段',
dataSourceFieldMetadataFields: '元数据字段',
dataSourceFieldPaginationType: '分页类型',
dataSourceFieldStartPage: '起始页',
dataSourceFieldOffsetParam: 'Offset 参数',
dataSourceFieldStartOffset: '起始偏移量',
dataSourceFieldCursorParam: '游标参数',
dataSourceFieldNextCursorJsonpath: '下一游标 JSONPath',
dataSourceFieldAdvancedSettings: '高级设置',
dataSourceFieldCustomHeaders: '自定义请求头JSON',
dataSourceFieldLimitParam: 'Limit 参数',
dataSourceFieldInitialCursor: '初始游标',
dataSourceFieldMaxPages: '最大页数',
dataSourceFieldRequestDelay: '请求延迟(秒)',
dataSourceFieldPollTimestampField: '轮询时间戳字段',
dataSourceFieldRequestBody: '请求体POSTJSON',
dataSourceFieldConfluenceUsername: 'Confluence 用户名',
dataSourceFieldConfluenceAccessToken: 'Confluence 访问令牌',
dataSourceFieldWikiBaseUrl: 'Wiki 基础 URL',
dataSourceFieldIsCloud: '是否为云版本',
dataSourceFieldIndexMode: '索引模式',
dataSourceFieldPageId: '页面 ID',
dataSourceFieldSpaceKey: '空间标识Space Key',
dataSourceFieldIndexRecursively: '递归索引',
dataSourceFieldJiraUserEmail: 'Jira 用户邮箱',
dataSourceFieldJiraUsername: 'Jira 用户名',
dataSourceFieldJiraBaseUrl: 'Jira 基础 URL',
dataSourceFieldProjectKey: '项目标识Project Key',
dataSourceFieldCustomJql: '自定义 JQL',
dataSourceFieldAttachmentSizeLimit: '附件大小限制(字节)',
dataSourceFieldLabelsToSkip: '跳过的标签',
dataSourceFieldCommentEmailBlacklist: '评论邮箱黑名单',
dataSourceFieldIncludeComments: '包含评论',
dataSourceFieldIncludeAttachments: '包含附件',
dataSourceFieldMode: '模式',
dataSourceFieldJiraApiToken: 'Jira API 令牌',
dataSourceFieldJiraPassword: 'Jira 密码',
dataSourceFieldUseScopedToken: '使用受限令牌Scoped Token',
dataSourceFieldRegion: '区域',
dataSourceFieldPrefix: '前缀',
dataSourceFieldAuthentication: '认证方式',
dataSourceFieldAwsAccessKeyId: 'AWS Access Key ID',
dataSourceFieldAwsSecretAccessKey: 'AWS Secret Access Key',
dataSourceFieldRoleArn: 'Role ARN',
dataSourceFieldAddressingStyle: '寻址方式',
dataSourceFieldEndpointUrl: 'Endpoint URL',
dataSourceFieldSeafileServerUrl: 'SeaFile 服务器 URL',
dataSourceFieldSyncScope: '同步范围',
dataSourceFieldAccountApiToken: '账户 API 令牌',
dataSourceFieldIncludeSharedLibraries: '包含共享资料库',
dataSourceFieldLibraryToken: '资料库令牌',
dataSourceFieldLibraryId: '资料库 ID',
dataSourceFieldDirectoryPath: '目录路径',
dataSourceFieldBitbucketAccountEmail: 'Bitbucket 账户邮箱',
dataSourceFieldBitbucketApiToken: 'Bitbucket API 令牌',
dataSourceFieldWorkspace: '工作区',
dataSourceFieldRepositorySlugs: '仓库 Slugs',
dataSourceFieldProjects: '项目',
dataSourceIncludePullRequests: '包含 Pull Requests',
dataSourceIncludeMergeRequests: '包含合并请求MR',
dataSourceIncludeIssues: '包含 Issues',
dataSourceIncludeCodeFiles: '包含代码文件',
// Data source form options
dataSourceOptionAccountKey: '账户密钥',
dataSourceOptionConnectionString: '连接字符串',
dataSourceOptionSasToken: 'SAS 令牌',
dataSourceOptionArticles: '文章',
dataSourceOptionTickets: '工单',
dataSourceOptionNone: '无',
dataSourceOptionApiKeyHeader: 'API Key请求头',
dataSourceOptionBearerToken: 'Bearer 令牌',
dataSourceOptionBasicAuth: 'Basic 认证',
dataSourceOptionPage: '页码',
dataSourceOptionOffset: '偏移量',
dataSourceOptionCursor: '游标',
dataSourceOptionEverything: '全部',
dataSourceOptionSpace: '空间',
dataSourceOptionCloud: '云版本',
dataSourceOptionServer: '服务器版',
dataSourceOptionS3Compatible: 'S3 兼容',
dataSourceOptionAccessKey: '访问密钥',
dataSourceOptionIamRole: 'IAM 角色',
dataSourceOptionAssumeRole: 'Assume Role',
dataSourceOptionVirtualHostedStyle: '虚拟主机方式',
dataSourceOptionPathStyle: '路径方式',
dataSourceOptionEntireAccount: '整个账户',
dataSourceOptionSingleLibrary: '单个资料库',
dataSourceOptionSpecificDirectory: '指定目录',
dataSourceOptionRepositories: '仓库',
dataSourceOptionProjects: '项目',
dataSourceOptionWorkspace: '工作区',
// Data source validation messages
dataSourceValidationFieldRequired: '{{label}}为必填项',
dataSourceValidationMinOne: '{{label}}至少为 1',
dataSourceConfluenceEverythingTip:
'该选项将索引所提供凭据有权访问的所有页面。',
dataSourceS3AssumeRoleTip: '无需提供凭据,将使用运行环境的默认角色。',
dataSourceS3RoleArnTip: '该角色将由运行环境扮演。',
dataSourceS3RegionRequired: '使用访问密钥时区域为必填项',
dataSourceAzureAccountNameRequired:
'使用账户密钥认证时,账户名称为必填项',
dataSourceAzureAccountKeyRequired: '使用账户密钥认证时,账户密钥为必填项',
dataSourceAzureConnectionStringRequired:
'使用连接字符串认证时,连接字符串为必填项',
dataSourceAzureContainerUrlRequired:
'使用 SAS 令牌认证时,容器 URL 为必填项',
dataSourceAzureSasTokenRequired: '使用 SAS 令牌认证时SAS 令牌为必填项',
dataSourceAzureContainerNameRequired: '在此认证模式下,容器名称为必填项',
dataSourceBigqueryDatasetIdRequired:
'未使用自定义 SQL 查询时,数据集 ID 为必填项',
dataSourceBigqueryTableIdRequired:
'未使用自定义 SQL 查询时,表 ID 为必填项',
dataSourceBigqueryQueryRequired:
'请提供 SQL 查询,或同时提供数据集 ID 和表 ID',
dataSourceSalesforceInstanceUrlInvalid:
'必须为合法的 Salesforce 域名 (https://...salesforce.com)',
dataSourceSalesforceApiVersionInvalid: 'API 版本格式必须如 v59.0',
// Data source detail page labels
dataSourcePruneFreq: '清理间隔',
dataSourceRefreshFreq: '刷新间隔',
dataSourceTimeoutSecs: '超时时间(秒)',
githubDescription:
'连接 GitHub可同步 Pull Request 与 Issue 内容用于检索。',
airtableDescription: '连接 Airtable同步指定工作区下指定表格中的文件。',

View File

@@ -5,9 +5,9 @@ import { useEffect, useState } from 'react';
import { FieldValues } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import {
DataSourceFormBaseFields,
DataSourceFormDefaultValues,
getCommonExtraDefaultValues,
getDataSourceFormBaseFields,
getDataSourceFieldsWithExtras,
mergeDataSourceFormValues,
} from './constant';
@@ -26,11 +26,11 @@ const AddDataSourceModal = ({
useEffect(() => {
if (sourceData) {
setFields([
...DataSourceFormBaseFields,
...getDataSourceFieldsWithExtras(sourceData.id as any),
...getDataSourceFormBaseFields(t),
...getDataSourceFieldsWithExtras(t, sourceData.id as any),
] as FormFieldConfig[]);
}
}, [sourceData]);
}, [sourceData, t]);
const handleOk = async (values?: FieldValues) => {
await onOk?.(values);

View File

@@ -3,42 +3,47 @@ import { TFunction } from 'i18next';
export const bitbucketConstant = (t: TFunction) => [
{
label: 'Bitbucket Account Email',
label: t('setting.dataSourceFieldBitbucketAccountEmail'),
name: 'config.credentials.bitbucket_account_email',
type: FormFieldType.Email,
required: true,
},
{
label: 'Bitbucket API Token',
label: t('setting.dataSourceFieldBitbucketApiToken'),
name: 'config.credentials.bitbucket_api_token',
type: FormFieldType.Password,
required: true,
},
{
label: 'Workspace',
label: t('setting.dataSourceFieldWorkspace'),
name: 'config.workspace',
type: FormFieldType.Text,
required: true,
tooltip: t('setting.bitbucketTopWorkspaceTip'),
},
{
label: 'Index Mode',
label: t('setting.dataSourceFieldIndexMode'),
name: 'config.index_mode',
type: FormFieldType.Segmented,
options: [
{ label: 'Repositories', value: 'repositories' },
{ label: 'Project(s)', value: 'projects' },
{ label: 'Workspace', value: 'workspace' },
{
label: t('setting.dataSourceOptionRepositories'),
value: 'repositories',
},
{ label: t('setting.dataSourceOptionProjects'), value: 'projects' },
{ label: t('setting.dataSourceOptionWorkspace'), value: 'workspace' },
],
},
{
label: 'Repository Slugs',
label: t('setting.dataSourceFieldRepositorySlugs'),
name: 'config.repository_slugs',
type: FormFieldType.Text,
customValidate: (val: string, formValues: any) => {
const index_mode = formValues?.config?.index_mode;
if (!val && index_mode === 'repositories') {
return 'Repository Slugs is required';
return t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldRepositorySlugs'),
});
}
return true;
},
@@ -49,13 +54,15 @@ export const bitbucketConstant = (t: TFunction) => [
tooltip: t('setting.bitbucketRepositorySlugsTip'),
},
{
label: 'Projects',
label: t('setting.dataSourceFieldProjects'),
name: 'config.projects',
type: FormFieldType.Text,
customValidate: (val: string, formValues: any) => {
const index_mode = formValues?.config?.index_mode;
if (!val && index_mode === 'projects') {
return 'Projects is required';
return t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldProjects'),
});
}
return true;
},

View File

@@ -3,50 +3,52 @@ import { TFunction } from 'i18next';
export const confluenceConstant = (t: TFunction) => [
{
label: 'Confluence Username',
label: t('setting.dataSourceFieldConfluenceUsername'),
name: 'config.credentials.confluence_username',
type: FormFieldType.Text,
required: true,
},
{
label: 'Confluence Access Token',
label: t('setting.dataSourceFieldConfluenceAccessToken'),
name: 'config.credentials.confluence_access_token',
type: FormFieldType.Password,
required: true,
},
{
label: 'Wiki Base URL',
label: t('setting.dataSourceFieldWikiBaseUrl'),
name: 'config.wiki_base',
type: FormFieldType.Text,
required: false,
tooltip: t('setting.confluenceWikiBaseUrlTip'),
},
{
label: 'Is Cloud',
label: t('setting.dataSourceFieldIsCloud'),
name: 'config.is_cloud',
type: FormFieldType.Checkbox,
required: false,
tooltip: t('setting.confluenceIsCloudTip'),
},
{
label: 'Index Mode',
label: t('setting.dataSourceFieldIndexMode'),
name: 'config.index_mode',
type: FormFieldType.Segmented,
options: [
{ label: 'Everything', value: 'everything' },
{ label: 'Space', value: 'space' },
{ label: 'Page', value: 'page' },
{ label: t('setting.dataSourceOptionEverything'), value: 'everything' },
{ label: t('setting.dataSourceOptionSpace'), value: 'space' },
{ label: t('setting.dataSourceOptionPage'), value: 'page' },
],
},
{
name: 'config.page_id',
label: 'Page ID',
label: t('setting.dataSourceFieldPageId'),
type: FormFieldType.Text,
customValidate: (val: string, formValues: any) => {
const index_mode = formValues?.config?.index_mode;
console.log('index_mode', index_mode, val);
if (!val && index_mode === 'page') {
return 'Page ID is required';
return t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldPageId'),
});
}
return true;
},
@@ -57,12 +59,14 @@ export const confluenceConstant = (t: TFunction) => [
},
{
name: 'config.space',
label: 'Space Key',
label: t('setting.dataSourceFieldSpaceKey'),
type: FormFieldType.Text,
customValidate: (val: string, formValues: any) => {
const index_mode = formValues?.config?.index_mode;
if (!val && index_mode === 'space') {
return 'Space Key is required';
return t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldSpaceKey'),
});
}
return true;
},
@@ -73,7 +77,7 @@ export const confluenceConstant = (t: TFunction) => [
},
{
name: 'config.index_recursively',
label: 'Index Recursively',
label: t('setting.dataSourceFieldIndexRecursively'),
type: FormFieldType.Checkbox,
shouldRender: (formValues: any) => {
const index_mode = formValues?.config?.index_mode;
@@ -90,28 +94,26 @@ export const confluenceConstant = (t: TFunction) => [
},
render: () => (
<div className="text-sm text-text-secondary bg-bg-card border border-border-button rounded-md px-3 py-2">
{
'This choice will index all pages the provided credentials have access to.'
}
{t('setting.dataSourceConfluenceEverythingTip')}
</div>
),
},
{
label: 'Space Key',
label: t('setting.dataSourceFieldSpaceKey'),
name: 'config.space',
type: FormFieldType.Text,
required: false,
hidden: true,
},
{
label: 'Page ID',
label: t('setting.dataSourceFieldPageId'),
name: 'config.page_id',
type: FormFieldType.Text,
required: false,
hidden: true,
},
{
label: 'Index Recursively',
label: t('setting.dataSourceFieldIndexRecursively'),
name: 'config.index_recursively',
type: FormFieldType.Checkbox,
required: false,

File diff suppressed because it is too large Load Diff

View File

@@ -3,7 +3,7 @@ import { TFunction } from 'i18next';
export const jiraConstant = (t: TFunction) => [
{
label: 'Jira User Email',
label: t('setting.dataSourceFieldJiraUserEmail'),
name: 'config.credentials.jira_user_email',
type: FormFieldType.Text,
required: true,
@@ -12,13 +12,18 @@ export const jiraConstant = (t: TFunction) => [
shouldRender: (formValues: any) => formValues?.config?.is_cloud !== false,
customValidate: (val: string, formValues: any) => {
if (formValues?.config?.is_cloud !== false) {
return Boolean(val) || 'Jira User Email is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldJiraUserEmail'),
})
);
}
return true;
},
},
{
label: 'Jira Username',
label: t('setting.dataSourceFieldJiraUsername'),
name: 'config.credentials.jira_username',
type: FormFieldType.Text,
required: true,
@@ -26,13 +31,18 @@ export const jiraConstant = (t: TFunction) => [
shouldRender: (formValues: any) => formValues?.config?.is_cloud === false,
customValidate: (val: string, formValues: any) => {
if (formValues?.config?.is_cloud === false) {
return Boolean(val) || 'Jira Username is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldJiraUsername'),
})
);
}
return true;
},
},
{
label: 'Jira Base URL',
label: t('setting.dataSourceFieldJiraBaseUrl'),
name: 'config.base_url',
type: FormFieldType.Text,
required: true,
@@ -40,7 +50,7 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraBaseUrlTip'),
},
{
label: 'Project Key',
label: t('setting.dataSourceFieldProjectKey'),
name: 'config.project_key',
type: FormFieldType.Text,
required: false,
@@ -48,7 +58,7 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraProjectKeyTip'),
},
{
label: 'Custom JQL',
label: t('setting.dataSourceFieldCustomJql'),
name: 'config.jql_query',
type: FormFieldType.Textarea,
required: false,
@@ -56,14 +66,14 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraJqlTip'),
},
{
label: 'Batch Size',
label: t('setting.dataSourceFieldBatchSize'),
name: 'config.batch_size',
type: FormFieldType.Number,
required: false,
tooltip: t('setting.jiraBatchSizeTip'),
},
{
label: 'Attachment Size Limit (bytes)',
label: t('setting.dataSourceFieldAttachmentSizeLimit'),
name: 'config.attachment_size_limit',
type: FormFieldType.Number,
required: false,
@@ -71,21 +81,21 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraAttachmentSizeTip'),
},
{
label: 'Labels to Skip',
label: t('setting.dataSourceFieldLabelsToSkip'),
name: 'config.labels_to_skip',
type: FormFieldType.Tag,
required: false,
tooltip: t('setting.jiraLabelsTip'),
},
{
label: 'Comment Email Blacklist',
label: t('setting.dataSourceFieldCommentEmailBlacklist'),
name: 'config.comment_email_blacklist',
type: FormFieldType.Tag,
required: false,
tooltip: t('setting.jiraBlacklistTip'),
},
{
label: 'Include Comments',
label: t('setting.dataSourceFieldIncludeComments'),
name: 'config.include_comments',
type: FormFieldType.Checkbox,
required: false,
@@ -93,7 +103,7 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraCommentsTip'),
},
{
label: 'Include Attachments',
label: t('setting.dataSourceFieldIncludeAttachments'),
name: 'config.include_attachments',
type: FormFieldType.Checkbox,
required: false,
@@ -101,17 +111,17 @@ export const jiraConstant = (t: TFunction) => [
tooltip: t('setting.jiraAttachmentsTip'),
},
{
label: 'Mode',
label: t('setting.dataSourceFieldMode'),
name: 'config.is_cloud',
type: FormFieldType.Segmented,
options: [
{ label: 'Cloud', value: true },
{ label: 'Server', value: false },
{ label: t('setting.dataSourceOptionCloud'), value: true },
{ label: t('setting.dataSourceOptionServer'), value: false },
],
defaultValue: true,
},
{
label: 'Jira API Token',
label: t('setting.dataSourceFieldJiraApiToken'),
name: 'config.credentials.jira_api_token',
type: FormFieldType.Password,
required: false,
@@ -119,13 +129,18 @@ export const jiraConstant = (t: TFunction) => [
shouldRender: (formValues: any) => formValues?.config?.is_cloud !== false,
customValidate: (val: string, formValues: any) => {
if (formValues?.config?.is_cloud !== false) {
return Boolean(val) || 'Jira API Token is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldJiraApiToken'),
})
);
}
return true;
},
},
{
label: 'Jira Password',
label: t('setting.dataSourceFieldJiraPassword'),
name: 'config.credentials.jira_password',
type: FormFieldType.Password,
required: false,
@@ -133,13 +148,18 @@ export const jiraConstant = (t: TFunction) => [
shouldRender: (formValues: any) => formValues?.config?.is_cloud === false,
customValidate: (val: string, formValues: any) => {
if (formValues?.config?.is_cloud === false) {
return Boolean(val) || 'Jira Password is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldJiraPassword'),
})
);
}
return true;
},
},
{
label: 'Use Scoped Token',
label: t('setting.dataSourceFieldUseScopedToken'),
name: 'config.scoped_token',
type: FormFieldType.Checkbox,
required: false,

View File

@@ -8,13 +8,13 @@ const awsRegionOptions = BedrockRegionList.map((r) => ({
}));
export const S3Constant = (t: TFunction) => [
{
label: 'Bucket Name',
label: t('setting.dataSourceFieldBucketName'),
name: 'config.bucket_name',
type: FormFieldType.Text,
required: true,
},
{
label: 'Region',
label: t('setting.dataSourceFieldRegion'),
name: 'config.credentials.region',
type: FormFieldType.Select,
required: false,
@@ -27,13 +27,13 @@ export const S3Constant = (t: TFunction) => [
credentials.aws_access_key_id || credentials.aws_secret_access_key,
);
if (bucketType === 's3' && hasAccessKey) {
return Boolean(val) || 'Region is required when using access key';
return Boolean(val) || t('setting.dataSourceS3RegionRequired');
}
return true;
},
},
{
label: 'Prefix',
label: t('setting.dataSourceFieldPrefix'),
name: 'config.prefix',
type: FormFieldType.Text,
required: false,
@@ -41,22 +41,25 @@ export const S3Constant = (t: TFunction) => [
},
{
label: 'Mode',
label: t('setting.dataSourceFieldMode'),
name: 'config.bucket_type',
type: FormFieldType.Segmented,
options: [
{ label: 'S3', value: 's3' },
{ label: 'S3 Compatible', value: 's3_compatible' },
{
label: t('setting.dataSourceOptionS3Compatible'),
value: 's3_compatible',
},
],
},
{
label: 'Authentication',
label: t('setting.dataSourceFieldAuthentication'),
name: 'config.credentials.authentication_method',
type: FormFieldType.Segmented,
options: [
{ label: 'Access Key', value: 'access_key' },
{ label: 'IAM Role', value: 'iam_role' },
{ label: 'Assume Role', value: 'assume_role' },
{ label: t('setting.dataSourceOptionAccessKey'), value: 'access_key' },
{ label: t('setting.dataSourceOptionIamRole'), value: 'iam_role' },
{ label: t('setting.dataSourceOptionAssumeRole'), value: 'assume_role' },
],
shouldRender: (formValues: any) => {
const bucketType = formValues?.config?.bucket_type;
@@ -65,7 +68,7 @@ export const S3Constant = (t: TFunction) => [
},
{
name: 'config.credentials.aws_access_key_id',
label: 'AWS Access Key ID',
label: t('setting.dataSourceFieldAwsAccessKeyId'),
type: FormFieldType.Text,
customValidate: (val: string, formValues: any) => {
const authMode = formValues?.config?.credentials?.authentication_method;
@@ -75,7 +78,9 @@ export const S3Constant = (t: TFunction) => [
!val &&
(authMode === 'access_key' || bucketType === 's3_compatible')
) {
return 'AWS Access Key ID is required';
return t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldAwsAccessKeyId'),
});
}
return true;
},
@@ -87,13 +92,18 @@ export const S3Constant = (t: TFunction) => [
},
{
name: 'config.credentials.aws_secret_access_key',
label: 'AWS Secret Access Key',
label: t('setting.dataSourceFieldAwsSecretAccessKey'),
type: FormFieldType.Password,
customValidate: (val: string, formValues: any) => {
const authMode = formValues?.config?.credentials?.authentication_method;
const bucketType = formValues?.config?.bucket_type;
if (authMode === 'access_key' || bucketType === 's3_compatible') {
return Boolean(val) || '"AWS Secret Access Key" is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldAwsSecretAccessKey'),
})
);
}
return true;
},
@@ -105,15 +115,20 @@ export const S3Constant = (t: TFunction) => [
},
{
name: 'config.credentials.aws_role_arn',
label: 'Role ARN',
tooltip: 'The role will be assumed by the runtime environment.',
label: t('setting.dataSourceFieldRoleArn'),
tooltip: t('setting.dataSourceS3RoleArnTip'),
type: FormFieldType.Text,
placeholder: 'arn:aws:iam::123456789012:role/YourRole',
customValidate: (val: string, formValues: any) => {
const authMode = formValues?.config?.credentials?.authentication_method;
const bucketType = formValues?.config?.bucket_type;
if (authMode === 'iam_role' || bucketType === 's3') {
return Boolean(val) || '"AWS Secret Access Key" is required';
return (
Boolean(val) ||
t('setting.dataSourceValidationFieldRequired', {
label: t('setting.dataSourceFieldAwsSecretAccessKey'),
})
);
}
return true;
},
@@ -134,20 +149,23 @@ export const S3Constant = (t: TFunction) => [
},
render: () => (
<div className="text-sm text-text-secondary bg-bg-card border border-border-button rounded-md px-3 py-2">
{'No credentials required. Uses the default environment role.'}
{t('setting.dataSourceS3AssumeRoleTip')}
</div>
),
},
{
name: 'config.credentials.addressing_style',
label: 'Addressing Style',
label: t('setting.dataSourceFieldAddressingStyle'),
tooltip: t('setting.S3CompatibleAddressingStyleTip'),
required: false,
type: FormFieldType.Select,
defaultValue: 'virtual',
options: [
{ label: 'Virtual Hosted Style', value: 'virtual' },
{ label: 'Path Style', value: 'path' },
{
label: t('setting.dataSourceOptionVirtualHostedStyle'),
value: 'virtual',
},
{ label: t('setting.dataSourceOptionPathStyle'), value: 'path' },
],
shouldRender: (formValues: any) => {
// const authMode = formValues?.config?.authMode;
@@ -157,7 +175,7 @@ export const S3Constant = (t: TFunction) => [
},
{
name: 'config.credentials.endpoint_url',
label: 'Endpoint URL',
label: t('setting.dataSourceFieldEndpointUrl'),
tooltip: t('setting.S3CompatibleEndpointUrlTip'),
placeholder: 'https://fsn1.your-objectstorage.com',
required: false,

View File

@@ -3,7 +3,7 @@ import { TFunction } from 'i18next';
export const seafileConstant = (t: TFunction) => [
{
label: 'SeaFile Server URL',
label: t('setting.dataSourceFieldSeafileServerUrl'),
name: 'config.seafile_url',
type: FormFieldType.Text,
required: true,
@@ -11,13 +11,16 @@ export const seafileConstant = (t: TFunction) => [
tooltip: t('setting.seafileUrlTip'),
},
{
label: 'Sync Scope',
label: t('setting.dataSourceFieldSyncScope'),
name: 'config.sync_scope',
type: FormFieldType.Segmented,
options: [
{ label: 'Entire Account', value: 'account' },
{ label: 'Single Library', value: 'library' },
{ label: 'Specific Directory', value: 'directory' },
{ label: t('setting.dataSourceOptionEntireAccount'), value: 'account' },
{ label: t('setting.dataSourceOptionSingleLibrary'), value: 'library' },
{
label: t('setting.dataSourceOptionSpecificDirectory'),
value: 'directory',
},
],
tooltip: t('setting.seafileSyncScopeTip'),
},
@@ -37,7 +40,7 @@ export const seafileConstant = (t: TFunction) => [
),
},
{
label: 'Account API Token',
label: t('setting.dataSourceFieldAccountApiToken'),
name: 'config.credentials.seafile_token',
type: FormFieldType.Password,
required: false,
@@ -56,7 +59,7 @@ export const seafileConstant = (t: TFunction) => [
},
},
{
label: 'Include Shared Libraries',
label: t('setting.dataSourceFieldIncludeSharedLibraries'),
name: 'config.include_shared',
type: FormFieldType.Checkbox,
required: false,
@@ -84,11 +87,15 @@ export const seafileConstant = (t: TFunction) => [
</p>
<ul className="list-disc list-inside space-y-0.5">
<li>
<span className="font-medium">Account API Token</span>
<span className="font-medium">
{t('setting.dataSourceFieldAccountApiToken')}
</span>
{' ' + t('setting.seafileTokenPanelAccountBullet')}
</li>
<li>
<span className="font-medium">Library Token</span>
<span className="font-medium">
{t('setting.dataSourceFieldLibraryToken')}
</span>
{' ' + t('setting.seafileTokenPanelLibraryBullet')}
</li>
</ul>
@@ -96,7 +103,7 @@ export const seafileConstant = (t: TFunction) => [
),
},
{
label: 'Account API Token',
label: t('setting.dataSourceFieldAccountApiToken'),
name: 'config.credentials.seafile_token',
type: FormFieldType.Password,
required: false,
@@ -107,7 +114,7 @@ export const seafileConstant = (t: TFunction) => [
},
},
{
label: 'Library Token',
label: t('setting.dataSourceFieldLibraryToken'),
name: 'config.credentials.repo_token',
type: FormFieldType.Password,
required: false,
@@ -130,7 +137,7 @@ export const seafileConstant = (t: TFunction) => [
},
},
{
label: 'Library ID',
label: t('setting.dataSourceFieldLibraryId'),
name: 'config.repo_id',
type: FormFieldType.Text,
required: false,
@@ -150,7 +157,7 @@ export const seafileConstant = (t: TFunction) => [
},
{
label: 'Directory Path',
label: t('setting.dataSourceFieldDirectoryPath'),
name: 'config.sync_path',
type: FormFieldType.Text,
required: false,
@@ -168,7 +175,7 @@ export const seafileConstant = (t: TFunction) => [
},
{
label: 'Batch Size',
label: t('setting.dataSourceFieldBatchSize'),
name: 'config.batch_size',
type: FormFieldType.Number,
required: false,
@@ -177,35 +184,35 @@ export const seafileConstant = (t: TFunction) => [
},
{
label: 'Account API Token',
label: t('setting.dataSourceFieldAccountApiToken'),
name: 'config.credentials.seafile_token',
type: FormFieldType.Password,
required: false,
hidden: true,
},
{
label: 'Library Token',
label: t('setting.dataSourceFieldLibraryToken'),
name: 'config.credentials.repo_token',
type: FormFieldType.Password,
required: false,
hidden: true,
},
{
label: 'Library ID',
label: t('setting.dataSourceFieldLibraryId'),
name: 'config.repo_id',
type: FormFieldType.Text,
required: false,
hidden: true,
},
{
label: 'Directory Path',
label: t('setting.dataSourceFieldDirectoryPath'),
name: 'config.sync_path',
type: FormFieldType.Text,
required: false,
hidden: true,
},
{
label: 'Include Shared Libraries',
label: t('setting.dataSourceFieldIncludeSharedLibraries'),
name: 'config.include_shared',
type: FormFieldType.Checkbox,
required: false,

View File

@@ -9,15 +9,15 @@ import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
import { Input } from '@/components/ui/input';
import { Separator } from '@/components/ui/separator';
import { RunningStatus, RunningStatusOld } from '@/constants/knowledge';
import { t } from 'i18next';
import { isEqual } from 'lodash';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { FieldValues } from 'react-hook-form';
import { useTranslation } from 'react-i18next';
import {
DataSourceFormBaseFields,
DataSourceFormDefaultValues,
DataSourceKey,
getCommonExtraDefaultValues,
getDataSourceFormBaseFields,
getDataSourceFieldsWithExtras,
mergeDataSourceFormValues,
useDataSourceInfo,
@@ -31,6 +31,7 @@ import {
import { DataSourceLogsTable } from './log-table';
const SourceDetailPage = () => {
const { t } = useTranslation();
const formRef = useRef<DynamicFormRef>(null);
const { data: detail } = useFetchDataSourceDetail();
@@ -54,7 +55,7 @@ const SourceDetailPage = () => {
const customFields = useMemo(() => {
return [
{
label: 'Prune Freq',
label: t('setting.dataSourcePruneFreq'),
name: 'prune_freq',
type: FormFieldType.Number,
required: false,
@@ -74,7 +75,7 @@ const SourceDetailPage = () => {
},
},
{
label: 'Refresh Freq',
label: t('setting.dataSourceRefreshFreq'),
name: 'refresh_freq',
type: FormFieldType.Number,
required: false,
@@ -91,7 +92,7 @@ const SourceDetailPage = () => {
),
},
{
label: 'Timeout Secs',
label: t('setting.dataSourceTimeoutSecs'),
name: 'timeout_secs',
type: FormFieldType.Number,
required: false,
@@ -112,7 +113,7 @@ const SourceDetailPage = () => {
),
},
];
}, []);
}, [t]);
const { addLoading, handleAddOk } = useAddDataSource({ isEdit: true });
const { loading: testLoading, handleTest } = useTestDataSource();
@@ -164,13 +165,13 @@ const SourceDetailPage = () => {
}, [actionMode, onSubmit, updateStatus]);
const primaryActionLabel = useMemo(() => {
if (actionMode === 'stop') return 'Stop';
if (actionMode === 'resume') return 'Resume';
return 'Save';
}, [actionMode]);
if (actionMode === 'stop') return t('common.stop');
if (actionMode === 'resume') return t('common.resume');
return t('common.save');
}, [actionMode, t]);
useEffect(() => {
const baseFields = DataSourceFormBaseFields.map((field) => {
const baseFields = getDataSourceFormBaseFields(t).map((field) => {
if (field.name === 'name') {
return {
...field,
@@ -185,7 +186,7 @@ const SourceDetailPage = () => {
if (detail) {
const fields = [
...baseFields,
...getDataSourceFieldsWithExtras(detail.source as any),
...getDataSourceFieldsWithExtras(t, detail.source as any),
...customFields,
] as FormFieldConfig[];
@@ -210,7 +211,7 @@ const SourceDetailPage = () => {
setDefaultValues(defaultValueTemp);
setIsDirty(false);
}
}, [detail, customFields, onSubmit]);
}, [detail, customFields, onSubmit, t]);
useEffect(() => {
const instance = formRef.current;