From 42865868b9c29afb154976a5c6d65684570681b7 Mon Sep 17 00:00:00 2001 From: hetao92 <18328704+hetao92@users.noreply.github.com> Date: Thu, 9 Mar 2023 08:57:24 +0000 Subject: [PATCH 01/11] feat: add datasource in import --- app/app.less | 1 - app/config/locale/en-US.json | 15 ++- app/config/locale/zh-CN.json | 15 ++- app/interfaces/import.ts | 13 +++ .../PreviewFileModal/index.module.less | 0 .../LocalFileList}/PreviewFileModal/index.tsx | 0 .../UploadConfigModal/index.module.less | 0 .../UploadConfigModal/index.tsx | 0 .../LocalFileList}/index.module.less | 0 .../LocalFileList}/index.tsx | 2 +- .../RemoteList/index.module.less | 35 ++++++ .../DataSourceList/RemoteList/index.tsx | 102 ++++++++++++++++++ .../Import/DataSourceList/index.module.less | 9 ++ app/pages/Import/DataSourceList/index.tsx | 36 +++++++ .../Import/TaskList/TemplateModal/index.tsx | 2 +- app/pages/Import/TaskList/index.module.less | 3 +- app/pages/Import/index.tsx | 12 +-- app/pages/MainPage/routes.tsx | 2 +- .../Schema/SchemaConfig/index.module.less | 3 + app/pages/Welcome/index.tsx | 2 +- 20 files changed, 238 insertions(+), 14 deletions(-) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/PreviewFileModal/index.module.less (100%) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/PreviewFileModal/index.tsx (100%) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/UploadConfigModal/index.module.less (100%) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/UploadConfigModal/index.tsx (100%) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/index.module.less (100%) rename app/pages/Import/{FileList => DataSourceList/LocalFileList}/index.tsx (99%) create mode 100644 app/pages/Import/DataSourceList/RemoteList/index.module.less create mode 100644 app/pages/Import/DataSourceList/RemoteList/index.tsx create mode 100644 app/pages/Import/DataSourceList/index.module.less create mode 100644 app/pages/Import/DataSourceList/index.tsx diff --git a/app/app.less b/app/app.less index c463b20b..b1e9e025 100644 --- a/app/app.less +++ b/app/app.less @@ -43,7 +43,6 @@ display: flex; justify-content: center; padding-bottom: 16px; - border-bottom: 1px solid @gray; } .ant-radio-group.studioTabGroup { diff --git a/app/config/locale/en-US.json b/app/config/locale/en-US.json index a8fb7149..68c1effc 100644 --- a/app/config/locale/en-US.json +++ b/app/config/locale/en-US.json @@ -153,6 +153,7 @@ }, "import": { "uploadFile": "Upload Files", + "dataSourceManagement": "Data Source Management", "importData": "Import Data", "createTask": "New Import", "uploadTemp": "Import Template", @@ -250,7 +251,19 @@ "deleteFiles": "Delete select files", "fileRepeatTip": "These files are already exists, continuing to upload will overwrite the original file", "filePreview": "Preview file {name}", - "uploadConfirm": "Upload Confirm" + "uploadConfirm": "Upload Confirm", + "localFiles": "Local files", + "cloudStorage": "Cloud storage", + "sftp": "SFTP", + "newDataSource": "New Data Source", + "deleteDataSource": "Delete Data Source", + "dataSourceList": "{type} list", + "ipAddress": "IP Address:Port", + "bucketName": "Bucket Name", + "accessKeyId": "AccessKeyId", + "region": "Region", + "addDate": "Add Date", + "account": "Account" }, "schema": { "spaceList": "Graph Space List", diff --git a/app/config/locale/zh-CN.json b/app/config/locale/zh-CN.json index 21991f22..8d5b22c1 100644 --- a/app/config/locale/zh-CN.json +++ b/app/config/locale/zh-CN.json @@ -153,6 +153,7 @@ }, "import": { "uploadFile": "上传文件", + "dataSourceManagement": "数据源管理", "importData": "导入数据", "createTask": "创建导入任务", "uploadTemp": "导入模板", @@ -250,7 +251,19 @@ "deleteFiles": "删除选中文件", "fileRepeatTip": "上述文件已存在,继续上传将覆盖原文件", "filePreview": "预览文件 {name}", - "uploadConfirm": "上传文件确认" + "uploadConfirm": "上传文件确认", + "localFiles": "本地文件", + "cloudStorage": "云存储", + "sftp": "SFTP", + "newDataSource": "新建数据源", + "deleteDataSource": "删除数据源", + "dataSourceList": "{type}列表", + "ipAddress": "IP 地址:端口", + "bucketName": "Bucket 名称", + "accessKeyId": "AccessKeyId", + "region": "区域", + "addDate": "添加日期", + "account": "账号" }, "schema": { "spaceList": "图空间列表", diff --git a/app/interfaces/import.ts b/app/interfaces/import.ts index 7201e3a7..b17114f5 100644 --- a/app/interfaces/import.ts +++ b/app/interfaces/import.ts @@ -69,4 +69,17 @@ export interface StudioFile extends RcFile { delimiter?: string; sample?: string; content?: any[]; +} + +export enum IRemoteType { + 'Cloud' = 'cloudStorage', + 'Sftp' = 'sftp', +} + +export interface ICloudStorage { + ipAddress: string; + bucketName: string; + accessKeyId: string; + region: string; + addDate: number; } \ No newline at end of file diff --git a/app/pages/Import/FileList/PreviewFileModal/index.module.less b/app/pages/Import/DataSourceList/LocalFileList/PreviewFileModal/index.module.less similarity index 100% rename from app/pages/Import/FileList/PreviewFileModal/index.module.less rename to app/pages/Import/DataSourceList/LocalFileList/PreviewFileModal/index.module.less diff --git a/app/pages/Import/FileList/PreviewFileModal/index.tsx b/app/pages/Import/DataSourceList/LocalFileList/PreviewFileModal/index.tsx similarity index 100% rename from app/pages/Import/FileList/PreviewFileModal/index.tsx rename to app/pages/Import/DataSourceList/LocalFileList/PreviewFileModal/index.tsx diff --git a/app/pages/Import/FileList/UploadConfigModal/index.module.less b/app/pages/Import/DataSourceList/LocalFileList/UploadConfigModal/index.module.less similarity index 100% rename from app/pages/Import/FileList/UploadConfigModal/index.module.less rename to app/pages/Import/DataSourceList/LocalFileList/UploadConfigModal/index.module.less diff --git a/app/pages/Import/FileList/UploadConfigModal/index.tsx b/app/pages/Import/DataSourceList/LocalFileList/UploadConfigModal/index.tsx similarity index 100% rename from app/pages/Import/FileList/UploadConfigModal/index.tsx rename to app/pages/Import/DataSourceList/LocalFileList/UploadConfigModal/index.tsx diff --git a/app/pages/Import/FileList/index.module.less b/app/pages/Import/DataSourceList/LocalFileList/index.module.less similarity index 100% rename from app/pages/Import/FileList/index.module.less rename to app/pages/Import/DataSourceList/LocalFileList/index.module.less diff --git a/app/pages/Import/FileList/index.tsx b/app/pages/Import/DataSourceList/LocalFileList/index.tsx similarity index 99% rename from app/pages/Import/FileList/index.tsx rename to app/pages/Import/DataSourceList/LocalFileList/index.tsx index 12374e4d..62ed2819 100644 --- a/app/pages/Import/FileList/index.tsx +++ b/app/pages/Import/DataSourceList/LocalFileList/index.tsx @@ -102,7 +102,7 @@ const FileList = () => { }, [selectFiles]); useEffect(() => { getFileList(); - trackPageView('/import/files'); + trackPageView('/import/dataSources'); }, []); return (