From 99f702cea775118ae7b3f4732537910fc0c2366b Mon Sep 17 00:00:00 2001 From: zhu-mingye <934230207@qq.com> Date: Mon, 21 Aug 2023 09:16:43 +0800 Subject: [PATCH] [refactor] modify some type position (#2245) * modify some type position * modify some type position * formatcode * formatcode * formatcode * delete translate-body --- .github/workflows/issue-rebot.yml | 6 +- dinky-admin/src/main/resources/db/db-h2.sql | 67 +-- dinky-web/.eslintrc.js | 39 ++ dinky-web/.prettierrc.js | 26 +- dinky-web/config/config.ts | 27 +- dinky-web/config/defaultSettings.ts | 12 +- dinky-web/config/proxy.ts | 16 +- dinky-web/config/routes.ts | 98 ++-- dinky-web/jest.config.ts | 10 +- dinky-web/src/access.ts | 8 +- dinky-web/src/app.tsx | 76 +-- .../src/components/Animation/FadeIn/index.tsx | 4 +- .../Animation/FadeInSlideDown/index.tsx | 2 +- .../Animation/FadeInSlideUp/index.tsx | 2 +- .../Animation/GradientBackground/index.tsx | 2 +- .../src/components/Animation/Pop/index.tsx | 2 +- .../src/components/Animation/Scale/index.tsx | 2 +- .../src/components/Animation/Shake/index.tsx | 2 +- .../src/components/Animation/Slide/index.tsx | 2 +- .../Animation/SlideInFromLeft/index.tsx | 2 +- .../Animation/SlowlyAppear/index.tsx | 2 +- .../components/Animation/Transform/index.tsx | 2 +- .../components/CallBackButton/CreateBtn.tsx | 2 +- .../CallBackButton/PopconfirmDeleteBtn.tsx | 8 +- .../src/components/Context/FormContext.tsx | 2 +- .../src/components/CountFormatter/index.tsx | 9 +- .../CustomEditor/CodeEdit/function.tsx | 31 +- .../CustomEditor/CodeEdit/index.tsx | 20 +- .../CustomEditor/CodeShow/index.tsx | 30 +- .../CustomEditor/EditorFloatBtn/index.tsx | 4 +- .../CustomEditor/FullscreenBtn/index.tsx | 8 +- dinky-web/src/components/Footer/index.tsx | 8 +- .../src/components/HeaderDropdown/index.tsx | 17 +- dinky-web/src/components/Icons/AlertIcon.tsx | 158 +++--- .../src/components/Icons/CodeLanguageIcon.tsx | 229 ++++----- .../src/components/Icons/CustomIcons.tsx | 412 ++++++++------- dinky-web/src/components/Icons/DBIcons.tsx | 295 ++++++----- dinky-web/src/components/Icons/HomeIcon.tsx | 485 +++++++++--------- .../src/components/Icons/MetricsIcon.tsx | 100 ++-- dinky-web/src/components/Icons/StudioIcon.tsx | 56 +- .../components/Modal/ErrorModalShow/index.tsx | 12 +- .../RightContent/AvatarDropdown.tsx | 66 +-- .../src/components/RightContent/index.tsx | 42 +- .../components/Scroll/ContentScroll/index.tsx | 4 +- .../Sidebar/MovableSidebar/index.tsx | 18 +- .../src/components/TableTransfer/index.tsx | 30 +- .../src/components/ThemeSvg/ThemeSvg.tsx | 40 +- dinky-web/src/global.less | 6 +- dinky-web/src/global.tsx | 4 +- dinky-web/src/hooks/index.tsx | 59 ++- dinky-web/src/hooks/useAccess.tsx | 16 +- dinky-web/src/hooks/useService.tsx | 6 +- dinky-web/src/locales/en-US.ts | 2 +- dinky-web/src/locales/en-US/global.ts | 5 +- dinky-web/src/locales/en-US/menu.ts | 5 +- dinky-web/src/locales/en-US/pages.ts | 224 +++----- dinky-web/src/locales/en-US/pwa.ts | 5 +- dinky-web/src/locales/en-US/request.ts | 14 +- dinky-web/src/locales/en-US/response.ts | 2 +- dinky-web/src/locales/en-US/shortcutKey.ts | 2 +- dinky-web/src/locales/zh-CN.ts | 2 +- dinky-web/src/locales/zh-CN/global.ts | 2 +- dinky-web/src/locales/zh-CN/menu.ts | 2 +- dinky-web/src/locales/zh-CN/pages.ts | 149 ++---- dinky-web/src/locales/zh-CN/pwa.ts | 2 +- dinky-web/src/locales/zh-CN/request.ts | 2 +- dinky-web/src/locales/zh-CN/response.ts | 2 +- dinky-web/src/locales/zh-CN/shortcutKey.ts | 2 +- .../Menu/components/MenuForm/index.tsx | 69 ++- .../components/MenuList/OpHelper/index.tsx | 8 +- .../Menu/components/MenuList/constants.tsx | 18 +- .../Menu/components/MenuList/index.tsx | 223 ++++---- .../Menu/components/MenuTree/index.tsx | 19 +- .../src/pages/AuthCenter/Menu/function.tsx | 86 +--- .../Role/components/AssignMenu/index.tsx | 128 ++--- .../RoleModalForm/RoleForm/index.tsx | 14 +- .../Role/components/RoleModalForm/index.tsx | 13 +- .../Role/components/RoleProTable/index.tsx | 139 ++--- .../Role/components/RoleUserList/index.tsx | 21 +- .../PermissionsForm/index.tsx | 31 +- .../components/PermissionsModal/index.tsx | 42 +- .../components/PermissionsProTable/index.tsx | 89 ++-- .../TenantModalForm/TenantForm/index.tsx | 12 +- .../components/TenantModalForm/index.tsx | 24 +- .../TenantTransfer/index.tsx | 56 +- .../components/TenantModalTransfer/index.tsx | 15 +- .../components/TenantProTable/index.tsx | 121 ++--- .../components/TenantUserList/index.tsx | 33 +- .../PasswordModal/PasswordForm/index.tsx | 26 +- .../User/components/PasswordModal/index.tsx | 19 +- .../RoleModalTransfer/RoleTransfer/index.tsx | 57 +- .../components/RoleModalTransfer/index.tsx | 15 +- .../UserModalForm/UserForm/index.tsx | 18 +- .../User/components/UserModalForm/index.tsx | 13 +- .../User/components/UserProTable/index.tsx | 200 +++----- .../BottomContainer/Console/index.tsx | 2 +- .../BottomContainer/Result/index.tsx | 92 ++-- .../DataStudio/BottomContainer/index.tsx | 44 +- .../FooterContainer/JobRunningModal/index.tsx | 4 +- .../DataStudio/FooterContainer/index.tsx | 57 +- .../HeaderContainer/Explain/index.tsx | 64 +-- .../HeaderContainer/FlinkGraph/function.tsx | 16 +- .../HeaderContainer/FlinkGraph/index.tsx | 42 +- .../DataStudio/HeaderContainer/function.tsx | 12 +- .../DataStudio/HeaderContainer/index.tsx | 194 +++---- .../LeftContainer/MetaData/index.tsx | 46 +- .../Project/FolderModal/FolderForm/index.tsx | 6 +- .../Project/FolderModal/index.tsx | 6 +- .../LeftContainer/Project/JobModal/index.tsx | 37 +- .../LeftContainer/Project/JobTree/index.tsx | 15 +- .../Project/ProjectTitle/index.tsx | 10 +- .../LeftContainer/Project/constants.tsx | 76 +-- .../LeftContainer/Project/function.tsx | 14 +- .../LeftContainer/Project/index.tsx | 105 ++-- .../pages/DataStudio/LeftContainer/index.tsx | 36 +- .../MiddleContainer/Editor/index.tsx | 17 +- .../MiddleContainer/KeyBoard/constant.tsx | 52 +- .../MiddleContainer/KeyBoard/index.tsx | 12 +- .../MiddleContainer/QuickGuide/constant.tsx | 22 +- .../MiddleContainer/QuickGuide/index.tsx | 10 +- .../DataStudio/MiddleContainer/function.tsx | 4 +- .../DataStudio/MiddleContainer/index.tsx | 89 ++-- .../RightContainer/ExecuteConfig/index.tsx | 31 +- .../RightContainer/HistoryVersion/index.tsx | 53 +- .../RightContainer/JobConfig/function.tsx | 41 +- .../RightContainer/JobConfig/index.tsx | 131 ++--- .../RightContainer/JobInfo/index.tsx | 16 +- .../RightContainer/SavePoints/index.tsx | 22 +- .../pages/DataStudio/RightContainer/index.tsx | 13 +- dinky-web/src/pages/DataStudio/constants.tsx | 16 +- dinky-web/src/pages/DataStudio/function.ts | 43 +- dinky-web/src/pages/DataStudio/index.tsx | 97 ++-- dinky-web/src/pages/DataStudio/model.ts | 189 ++++--- dinky-web/src/pages/DataStudio/route.tsx | 80 ++- .../components/CheckpointTable.tsx | 51 +- .../CheckPointsTab/components/CkDesc.tsx | 72 ++- .../components/SavePointTable.tsx | 30 +- .../DevOps/JobDetail/CheckPointsTab/index.tsx | 6 +- .../DevOps/JobDetail/JobLogs/JobLogsTab.tsx | 8 +- .../JobLogs/components/ExceptionTab.tsx | 16 +- .../JobLogs/components/JobManagerLogsTab.tsx | 10 +- .../JobLogs/components/TaskManagerLogsTab.tsx | 12 +- .../JobDetail/JobOperator/JobOperator.tsx | 42 +- .../JobOverview/components/FlinkTable.tsx | 34 +- .../JobOverview/components/JobDesc.tsx | 57 +- .../JobDetail/JobVersion/JobVersionTab.tsx | 39 +- .../src/pages/DevOps/JobDetail/index.tsx | 40 +- .../JobList/components/JobHistoryList.tsx | 24 +- dinky-web/src/pages/DevOps/JobList/index.tsx | 41 +- dinky-web/src/pages/DevOps/constants.tsx | 4 +- dinky-web/src/pages/DevOps/function.tsx | 32 +- .../BatchStreamProportion/index.tsx | 8 +- .../Home/DevOverView/DevHeatmap/index.tsx | 50 +- .../Home/DevOverView/ResourceView/index.tsx | 20 +- .../DevOverView/TaskDialectRadar/index.tsx | 14 +- .../src/pages/Home/DevOverView/index.tsx | 14 +- .../Home/JobOverView/JobErrorView/index.tsx | 48 +- .../JobOverView/JobFinishedView/index.tsx | 14 +- .../JobOverView/JobOperatorGraph/index.tsx | 2 +- .../JobOverView/JobRecoveryView/index.tsx | 14 +- .../Home/JobOverView/JobRunView/index.tsx | 12 +- .../Home/JobOverView/JobStatusPie/index.tsx | 22 +- .../Home/JobOverView/LoadScoreGauge/index.tsx | 25 +- .../src/pages/Home/JobOverView/index.tsx | 14 +- dinky-web/src/pages/Home/constants.tsx | 6 +- dinky-web/src/pages/Home/index.tsx | 4 +- dinky-web/src/pages/Home/service.ts | 2 +- .../pages/Metrics/Job/FlinkChart/index.tsx | 30 +- dinky-web/src/pages/Metrics/Job/function.tsx | 17 +- dinky-web/src/pages/Metrics/Job/index.tsx | 83 ++- dinky-web/src/pages/Metrics/Job/service.tsx | 4 +- .../src/pages/Metrics/Server/CPU/index.tsx | 6 +- .../Metrics/Server/GlobalFilter/index.tsx | 23 +- .../src/pages/Metrics/Server/Heap/index.tsx | 8 +- .../pages/Metrics/Server/OutHeap/index.tsx | 8 +- .../src/pages/Metrics/Server/Thread/index.tsx | 2 +- .../src/pages/Metrics/Server/constants.tsx | 16 +- .../src/pages/Metrics/Server/function.tsx | 10 +- dinky-web/src/pages/Metrics/Server/index.tsx | 43 +- dinky-web/src/pages/Metrics/index.tsx | 34 +- dinky-web/src/pages/Metrics/service.tsx | 2 +- dinky-web/src/pages/Other/403/index.tsx | 6 +- dinky-web/src/pages/Other/404/index.tsx | 6 +- .../Other/About/components/CommunityRules.tsx | 8 +- .../Other/About/components/Precautions.tsx | 2 +- .../pages/Other/About/components/QRCode.tsx | 26 +- .../Other/About/components/UsingHelp.tsx | 22 +- dinky-web/src/pages/Other/About/index.tsx | 14 +- dinky-web/src/pages/Other/Loading/index.tsx | 6 +- .../Login/ChooseModal/TenantCard/index.tsx | 4 +- .../pages/Other/Login/ChooseModal/index.tsx | 12 +- .../pages/Other/Login/LangSwitch/index.tsx | 12 +- .../Login/LoginForm/MainWithStyle/index.tsx | 5 +- .../src/pages/Other/Login/LoginForm/index.tsx | 36 +- dinky-web/src/pages/Other/Login/index.tsx | 35 +- .../Other/PersonCenter/BaseInfo/index.tsx | 16 +- .../PersonCenter/LoginLogRecord/function.tsx | 15 +- .../PersonCenter/LoginLogRecord/index.tsx | 30 +- .../OperationLogRecord/ResultShow/index.tsx | 2 +- .../PersonCenter/OperationLogRecord/index.tsx | 47 +- .../src/pages/Other/PersonCenter/index.tsx | 48 +- .../components/AlertGroupForm/index.tsx | 50 +- .../RegCenter/Alert/AlertGroup/function.ts | 5 +- .../RegCenter/Alert/AlertGroup/index.tsx | 39 +- .../RegCenter/Alert/AlertGroup/service.ts | 2 +- .../components/AlertInstanceList/index.tsx | 27 +- .../InstanceForm/DingTalk/index.tsx | 65 +-- .../InstanceForm/Email/index.tsx | 89 ++-- .../InstanceForm/FeiShu/index.tsx | 65 +-- .../InstanceForm/Sms/function.tsx | 133 ++--- .../InstanceForm/Sms/index.tsx | 27 +- .../InstanceForm/WeChat/index.tsx | 78 ++- .../AlertTypeChoose/InstanceForm/index.tsx | 18 +- .../components/AlertTypeChoose/index.tsx | 17 +- .../RegCenter/Alert/AlertInstance/constans.ts | 34 +- .../Alert/AlertInstance/function.tsx | 7 +- .../RegCenter/Alert/AlertInstance/index.tsx | 5 +- .../RegCenter/Alert/AlertInstance/model.ts | 12 +- .../RegCenter/Alert/AlertInstance/service.ts | 11 +- .../components/ConfigurationList/index.tsx | 76 +-- .../ConfigurationForm/BaseConfig/index.tsx | 18 +- .../ConfigurationForm/FlinkK8s/contants.tsx | 4 +- .../ConfigurationForm/FlinkK8s/index.tsx | 62 +-- .../ConfigurationForm/YarnConfig/index.tsx | 72 +-- .../ConfigurationForm/index.tsx | 4 +- .../components/ConfigurationModal/index.tsx | 17 +- .../Configuration/components/contants.tsx | 50 +- .../components/InstanceList/index.tsx | 55 +- .../InstanceModal/InstanceForm/index.tsx | 34 +- .../components/InstanceModal/index.tsx | 13 +- .../Cluster/Instance/components/contants.tsx | 10 +- .../Cluster/Instance/components/function.tsx | 4 +- .../src/pages/RegCenter/Cluster/constants.ts | 2 +- .../RightTagsRouter/GenSQL/index.tsx | 26 +- .../SQLConsole/DataList/index.tsx | 2 +- .../SQLConsole/Editor/index.tsx | 6 +- .../RightTagsRouter/SQLConsole/data.ts | 102 ++-- .../RightTagsRouter/SQLConsole/index.tsx | 11 +- .../SQLQuery/QueryForm/index.tsx | 28 +- .../RightTagsRouter/SQLQuery/index.tsx | 41 +- .../SchemaDesc/ColumnInfo/Index.tsx | 40 +- .../SchemaDesc/TableInfo/index.tsx | 28 +- .../RightTagsRouter/SchemaDesc/index.tsx | 5 +- .../RightTagsRouter/index.tsx | 37 +- .../DataSourceDetail/SchemaTree/index.tsx | 5 +- .../components/DataSourceDetail/function.tsx | 4 +- .../components/DataSourceDetail/index.tsx | 59 +-- .../components/DataSourceList/index.tsx | 68 +-- .../DataSourceProForm/index.tsx | 43 +- .../components/DataSourceModal/index.tsx | 28 +- .../DataSource/components/constants.ts | 70 +-- .../DataSource/components/function.tsx | 4 +- .../DocumentDrawer/DocumentDesc/index.tsx | 2 +- .../components/DocumentDrawer/index.tsx | 6 +- .../DocumentModal/DocumentForm/index.tsx | 36 +- .../components/DocumentModal/index.tsx | 11 +- .../components/DocumentProTable/index.tsx | 55 +- .../src/pages/RegCenter/Document/constans.ts | 94 ++-- .../components/BuildSteps/AutoSteps/index.tsx | 4 +- .../BuildSteps/JarShow/JarList/index.tsx | 41 +- .../components/BuildSteps/constants.tsx | 32 +- .../components/BuildSteps/index.tsx | 14 +- .../CodeTreeShow/CodeContent/index.tsx | 23 +- .../CodeTree/CodeTreeShow/index.tsx | 27 +- .../components/CodeTree/function.tsx | 4 +- .../ProjectModal/ProjectForm/index.tsx | 67 +-- .../components/ProjectModal/index.tsx | 20 +- .../components/ProjectProTable/index.tsx | 125 ++--- .../pages/RegCenter/GitProject/constans.tsx | 80 +-- .../GlobalVarDrawer/GlobalVarDesc/index.tsx | 2 +- .../components/GlobalVarDrawer/index.tsx | 6 +- .../GlobalVarModal/GlobalVarForm/index.tsx | 16 +- .../components/GlobalVarModal/index.tsx | 11 +- .../components/GlobalVarProTable/index.tsx | 49 +- .../Resource/components/FileShow/index.tsx | 18 +- .../Resource/components/FileTree/index.tsx | 8 +- .../components/ResourceModal/index.tsx | 31 +- .../components/ResourceOverView/index.tsx | 66 +-- .../components/ResourcesUploadModal/index.tsx | 14 +- .../Resource/components/constants.tsx | 14 +- .../TemplateModal/TemplateProFrom/index.tsx | 47 +- .../UDF/components/TemplateModal/index.tsx | 13 +- .../UDF/components/TemplateTable/index.tsx | 67 +-- .../UDFTemplateDesc/index.tsx | 2 +- .../components/UDFTemplateDrawer/index.tsx | 6 +- .../src/pages/RegCenter/UDF/constants.ts | 36 +- dinky-web/src/pages/SettingCenter/.ignore | 0 .../SettingOverView/GeneralConfig.tsx | 56 +- .../LdapConfig/compontents/LoadUser.tsx | 40 +- .../LdapConfig/compontents/TestLogin.tsx | 31 +- .../SettingOverView/LdapConfig/index.tsx | 12 +- .../SettingOverView/MetricsConfig/index.tsx | 2 +- .../SettingOverView/ResourcesConfig/index.tsx | 8 +- .../SettingOverView/constants.ts | 2 +- .../GlobalSetting/SettingOverView/index.tsx | 37 +- .../SubStepsTable/ShowLog/index.tsx | 4 +- .../ProcessList/SubStepsTable/index.tsx | 36 +- .../components/ProcessList/constants.tsx | 4 +- .../components/ProcessList/function.tsx | 2 +- .../Process/components/ProcessList/index.tsx | 29 +- .../TagInfo/LogList/LogsShow/index.tsx | 19 +- .../SystemLogs/TagInfo/LogList/index.tsx | 16 +- .../SystemLogs/TagInfo/RootLogs/index.tsx | 6 +- .../SystemLogs/TagInfo/index.tsx | 10 +- dinky-web/src/requestErrorConfig.ts | 10 +- dinky-web/src/service-worker.js | 5 +- dinky-web/src/services/BusinessCrud.ts | 64 +-- dinky-web/src/services/api.ts | 51 +- dinky-web/src/services/constants.tsx | 287 +---------- dinky-web/src/services/data.d.ts | 4 - dinky-web/src/services/endpoints.tsx | 254 +++++++++ dinky-web/src/services/index.ts | 2 +- .../src/types/{User => AuthCenter}/data.d.ts | 42 +- dinky-web/src/types/AuthCenter/init.d.ts | 138 +++++ dinky-web/src/types/AuthCenter/state.d.ts | 125 +++++ .../function.tsx => types/DevOps/state.d.ts} | 0 dinky-web/src/types/Home/state.d.ts | 18 + dinky-web/src/types/Public/constants.tsx | 10 +- dinky-web/src/types/Public/data.ts | 6 +- dinky-web/src/types/Public/state.d.ts | 39 ++ dinky-web/src/types/RegCenter/data.d.ts | 16 +- dinky-web/src/types/RegCenter/state.d.ts | 18 + dinky-web/src/types/SettingCenter/state.d.ts | 18 + dinky-web/src/types/Studio/state.d.ts | 18 + dinky-web/src/utils/function.tsx | 41 +- dinky-web/src/utils/hook/useLocalStorage.ts | 5 +- dinky-web/src/utils/messages.tsx | 52 +- dinky-web/src/utils/modals.tsx | 46 +- script/sql/dinky-mysql.sql | 67 +-- script/sql/dinky-pg.sql | 66 +-- .../1.0.0-SNAPSHOT_schema/mysql/dinky_dml.sql | 66 +-- 331 files changed, 5514 insertions(+), 6785 deletions(-) delete mode 100644 dinky-web/src/pages/SettingCenter/.ignore create mode 100644 dinky-web/src/services/endpoints.tsx rename dinky-web/src/types/{User => AuthCenter}/data.d.ts (59%) create mode 100644 dinky-web/src/types/AuthCenter/init.d.ts create mode 100644 dinky-web/src/types/AuthCenter/state.d.ts rename dinky-web/src/{pages/AuthCenter/Role/components/AssignMenu/function.tsx => types/DevOps/state.d.ts} (100%) create mode 100644 dinky-web/src/types/Home/state.d.ts create mode 100644 dinky-web/src/types/Public/state.d.ts create mode 100644 dinky-web/src/types/RegCenter/state.d.ts create mode 100644 dinky-web/src/types/SettingCenter/state.d.ts create mode 100644 dinky-web/src/types/Studio/state.d.ts diff --git a/.github/workflows/issue-rebot.yml b/.github/workflows/issue-rebot.yml index 907e3667cc..057d0d0484 100644 --- a/.github/workflows/issue-rebot.yml +++ b/.github/workflows/issue-rebot.yml @@ -19,7 +19,9 @@ name: issue-robot on: issues: - types: [opened] + types: [ opened ] + pull_request_target: + types: [ opened ] jobs: issueRobot: @@ -35,7 +37,7 @@ jobs: uses: ./.github/actions/translate-on-issue with: translate-title: true - translate-body: true + translate-body: false - name: "Comment in issue" uses: ./.github/actions/comment-on-issue diff --git a/dinky-admin/src/main/resources/db/db-h2.sql b/dinky-admin/src/main/resources/db/db-h2.sql index eadf577cef..22bc91cd4a 100644 --- a/dinky-admin/src/main/resources/db/db-h2.sql +++ b/dinky-admin/src/main/resources/db/db-h2.sql @@ -1735,39 +1735,40 @@ create table `dinky_sys_menu` ( primary key (`id`) using btree ) engine=innodb ; -INSERT INTO `dinky_sys_menu` VALUES (1, -1, '首页', '/home', './Home', null, 'HomeOutlined', 'C', 0, 100000, '2023-08-11 14:06:52', '2023-08-17 15:09:52', null); -INSERT INTO `dinky_sys_menu` VALUES (2, -1, '运维中心', '/devops', null, null, 'ControlOutlined', 'M', 0, 300000, '2023-08-11 14:06:52', '2023-08-17 15:10:10', null); -INSERT INTO `dinky_sys_menu` VALUES (3, -1, '注册中心', '/registration', null, null, 'AppstoreOutlined', 'M', 0, 400000, '2023-08-11 14:06:52', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (4, -1, '认证中心', '/auth', null, null, 'SafetyCertificateOutlined', 'M', 0, 500000, '2023-08-11 14:06:52', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (5, -1, '数据开发', '/datastudio', './DataStudio', null, 'CodeOutlined', 'C', 0, 200000, '2023-08-11 14:06:52', '2023-08-17 15:10:00', null); -INSERT INTO `dinky_sys_menu` VALUES (6, -1, '配置中心', '/settings', null, null, 'SettingOutlined', 'M', 0, 600000, '2023-08-11 14:06:53', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (7, -1, '关于', '/about', './Other/About', null, 'SmileOutlined', 'C', 0, 800000, '2023-08-11 14:06:53', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (8, -1, '监控', '/metrics', './Metrics', null, 'DashboardOutlined', 'C', 0, 700000, '2023-08-11 14:06:53', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (9, 3, 'cluster', '/registration/cluster', null, null, 'GoldOutlined', 'M', 0, 410000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (10, 3, 'database', '/registration/database', './RegCenter/DataSource', null, 'DatabaseOutlined', 'M', 0, 420000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (11, -1, 'center', '/account/center', './Other/PersonCenter', null, 'UserOutlined', 'C', 0, 900000, '2023-08-11 14:06:54', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (12, 3, 'alert', '/registration/alert', null, null, 'AlertOutlined', 'M', 0, 430000, '2023-08-11 14:06:54', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (13, 3, 'document', '/registration/document', './RegCenter/Document', null, 'BookOutlined', 'C', 0, 440000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (14, 3, 'fragment', '/registration/fragment', './RegCenter/GlobalVar', null, 'RocketOutlined', 'C', 0, 450000, '2023-08-11 14:06:54', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (15, 3, 'gitprojects', '/registration/gitprojects', './RegCenter/GitProject', null, 'GithubOutlined', 'C', 0, 460000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (16, 3, 'udf', '/registration/udf', './RegCenter/UDF', null, 'ToolOutlined', 'C', 0, 470000, '2023-08-11 14:06:54', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (17, 2, 'job-detail', '/devops/job-detail', './DevOps/JobDetail', null, null, 'C', 0, 320000, '2023-08-11 14:06:54', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (18, 2, 'job', '/devops/joblist', './DevOps', null, null, 'C', 0, 310000, '2023-08-11 14:06:54', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (19, 3, 'resource', '/registration/resource', './RegCenter/Resource', null, 'FileZipOutlined', 'C', 0, 480000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (20, 4, 'role', '/auth/role', './AuthCenter/Role', null, 'TeamOutlined', 'C', 0, 520000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (21, 4, 'user', '/auth/user', './AuthCenter/User', null, 'UserOutlined', 'C', 0, 510000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (22, 4, '菜单', '/auth/menu', './AuthCenter/Menu', null, 'MenuOutlined', 'C', 0, 530000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (23, 4, 'tenant', '/auth/tenant', './AuthCenter/Tenant', null, 'SecurityScanOutlined', 'C', 0, 540000, '2023-08-11 14:06:54', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (24, 6, 'globalsetting', '/settings/globalsetting', './SettingCenter/GlobalSetting', null, 'SettingOutlined', 'C', 0, 610000, '2023-08-11 14:06:54', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (25, 6, 'systemlog', '/settings/systemlog', './SettingCenter/SystemLogs', null, 'InfoCircleOutlined', 'C', 0, 620000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (26, 6, 'process', '/settings/process', './SettingCenter/Process', null, 'ReconciliationOutlined', 'C', 0, 630000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (27, 4, 'rowpermissions', '/auth/rowpermissions', './AuthCenter/RowPermissions', null, 'SafetyCertificateOutlined', 'C', 0, 550000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (28, 9, 'cluster-instance', '/registration/cluster/instance', './RegCenter/Cluster/Instance', null, null, 'C', 0, 411000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (29, 12, 'group', '/registration/alert/group', './RegCenter/Alert/AlertGroup', null, null, 'C', 0, 432000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (30, 9, 'cluster-config', '/registration/cluster/config', './RegCenter/Cluster/Configuration', null, null, 'C', 0, 412000, '2023-08-11 14:06:55', '2023-08-17 15:12:51', null); -INSERT INTO `dinky_sys_menu` VALUES (31, 12, 'instance', '/registration/alert/instance', './RegCenter/Alert/AlertInstance', null, null, 'C', 0, 431000, '2023-08-11 14:06:55', '2023-08-17 15:12:50', null); -INSERT INTO `dinky_sys_menu` VALUES (32, 1, '作业监控', '/home/jobOverView', 'Row', 'show', 'AntCloudOutlined', 'F', 0, 110000, '2023-08-15 16:52:59', '2023-08-17 15:11:40', null); -INSERT INTO `dinky_sys_menu` VALUES (33, 1, '数据开发', '/home/devOverView', 'DevOverView', 'show', 'AimOutlined', 'F', 0, 120000, '2023-08-15 16:54:47', '2023-08-17 15:11:40', null); +INSERT INTO `dinky_sys_menu` VALUES (1, -1, '首页', '/home', './Home', null, 'HomeOutlined', 'C', 0, 1, '2023-08-11 14:06:52', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (2, -1, '运维中心', '/devops', null, null, 'ControlOutlined', 'M', 0, 5, '2023-08-11 14:06:52', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (3, -1, '注册中心', '/registration', null, null, 'AppstoreOutlined', 'M', 0, 9, '2023-08-11 14:06:52', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (4, -1, '认证中心', '/auth', null, null, 'SafetyCertificateOutlined', 'M', 0, 22, '2023-08-11 14:06:52', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (5, -1, '数据开发', '/datastudio', './DataStudio', null, 'CodeOutlined', 'C', 0, 4, '2023-08-11 14:06:52', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (6, -1, '配置中心', '/settings', null, null, 'SettingOutlined', 'M', 0, 28, '2023-08-11 14:06:53', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (7, -1, '关于', '/about', './Other/About', null, 'SmileOutlined', 'C', 0, 33, '2023-08-11 14:06:53', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (8, -1, '监控', '/metrics', './Metrics', null, 'DashboardOutlined', 'C', 0, 32, '2023-08-11 14:06:53', '2023-08-18 17:09:38', null); +INSERT INTO `dinky_sys_menu` VALUES (9, 3, 'cluster', '/registration/cluster', null, null, 'GoldOutlined', 'M', 0, 10, '2023-08-11 14:06:54', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (10, 3, 'database', '/registration/database', './RegCenter/DataSource', null, 'DatabaseOutlined', 'M', 0, 13, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (11, -1, 'center', '/account/center', './Other/PersonCenter', null, 'UserOutlined', 'C', 0, 34, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (12, 3, 'alert', '/registration/alert', null, null, 'AlertOutlined', 'M', 0, 14, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (13, 3, 'document', '/registration/document', './RegCenter/Document', null, 'BookOutlined', 'C', 0, 17, '2023-08-11 14:06:54', '2023-08-18 17:09:38', null); +INSERT INTO `dinky_sys_menu` VALUES (14, 3, 'fragment', '/registration/fragment', './RegCenter/GlobalVar', null, 'RocketOutlined', 'C', 0, 18, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (15, 3, 'gitprojects', '/registration/gitprojects', './RegCenter/GitProject', null, 'GithubOutlined', 'C', 0, 19, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (16, 3, 'udf', '/registration/udf', './RegCenter/UDF', null, 'ToolOutlined', 'C', 0, 20, '2023-08-11 14:06:54', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (17, 2, 'job-detail', '/devops/job-detail', './DevOps/JobDetail', null, null, 'C', 0, 8, '2023-08-11 14:06:54', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (18, 2, 'job', '/devops/joblist', './DevOps', null, null, 'C', 0, 6, '2023-08-11 14:06:54', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (19, 3, 'resource', '/registration/resource', './RegCenter/Resource', null, 'FileZipOutlined', 'C', 0, 21, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (20, 4, 'role', '/auth/role', './AuthCenter/Role', null, 'TeamOutlined', 'C', 0, 24, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (21, 4, 'user', '/auth/user', './AuthCenter/User', null, 'UserOutlined', 'C', 0, 23, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (22, 4, '菜单', '/auth/menu', './AuthCenter/Menu', null, 'MenuOutlined', 'C', 0, 25, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (23, 4, 'tenant', '/auth/tenant', './AuthCenter/Tenant', null, 'SecurityScanOutlined', 'C', 0, 26, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (24, 6, 'globalsetting', '/settings/globalsetting', './SettingCenter/GlobalSetting', null, 'SettingOutlined', 'C', 0, 29, '2023-08-11 14:06:54', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (25, 6, 'systemlog', '/settings/systemlog', './SettingCenter/SystemLogs', null, 'InfoCircleOutlined', 'C', 0, 30, '2023-08-11 14:06:55', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (26, 6, 'process', '/settings/process', './SettingCenter/Process', null, 'ReconciliationOutlined', 'C', 0, 31, '2023-08-11 14:06:55', '2023-08-18 17:09:38', null); +INSERT INTO `dinky_sys_menu` VALUES (27, 4, 'rowpermissions', '/auth/rowpermissions', './AuthCenter/RowPermissions', null, 'SafetyCertificateOutlined', 'C', 0, 27, '2023-08-11 14:06:55', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (28, 9, 'cluster-instance', '/registration/cluster/instance', './RegCenter/Cluster/Instance', null, null, 'C', 0, 11, '2023-08-11 14:06:55', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (29, 12, 'group', '/registration/alert/group', './RegCenter/Alert/AlertGroup', null, null, 'C', 0, 16, '2023-08-11 14:06:55', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (30, 9, 'cluster-config', '/registration/cluster/config', './RegCenter/Cluster/Configuration', null, null, 'C', 0, 12, '2023-08-11 14:06:55', '2023-08-18 17:09:40', null); +INSERT INTO `dinky_sys_menu` VALUES (31, 12, 'instance', '/registration/alert/instance', './RegCenter/Alert/AlertInstance', null, null, 'C', 0, 15, '2023-08-11 14:06:55', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (32, 1, '作业监控', '/home/jobOverView', 'JobOverView', 'show', 'AntCloudOutlined', 'F', 0, 2, '2023-08-15 16:52:59', '2023-08-18 17:09:39', null); +INSERT INTO `dinky_sys_menu` VALUES (33, 1, '数据开发', '/home/devOverView', 'DevOverView', 'show', 'AimOutlined', 'F', 0, 3, '2023-08-15 16:54:47', '2023-08-18 17:09:39', null); + -- ---------------------------- -- Table structure dinky_sys_role_menu diff --git a/dinky-web/.eslintrc.js b/dinky-web/.eslintrc.js index 060035f620..b7e94ce35a 100644 --- a/dinky-web/.eslintrc.js +++ b/dinky-web/.eslintrc.js @@ -21,4 +21,43 @@ module.exports = { page: true, REACT_APP_ENV: true, }, + rules: { + 'quote-props': 0, + 'dot-notation': 0, + 'consistent-return': 0, + 'no-multiple-empty-lines': 0, + 'prefer-arrow-callback': 0, + 'wrap-iife': 0, + 'no-undef-init': 0, + 'no-new-wrappers': 0, + 'linebreak-style': 0, + 'max-len': [0, 160], + 'lines-between-class-members': 0, + 'prefer-const': 0, + 'no-plusplus': 0, + 'comma-dangle': 0, + 'func-names': 0, + 'space-before-function-paren': 0, + 'prefer-template': 0, + 'no-else-return': 0, + 'object-curly-newline': 0, + 'no-bitwise': 0, + 'max-classes-per-file': 0, + 'class-methods-use-this': 0, + 'no-useless-constructor': 0, + 'no-unused-expressions': 0, + 'no-param-reassign': 0, + 'no-empty-function': 0, + 'no-console': 0, + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-unused-vars': 0, + 'no-underscore-dangle': 0, + 'arrow-body-style': 0, + 'one-var': 0, + 'one-var-declaration-per-line': 0, + 'prefer-promise-reject-errors': 0, + eqeqeq: 0, + camelcase: 0, + 'object-shorthand': 0, + }, }; diff --git a/dinky-web/.prettierrc.js b/dinky-web/.prettierrc.js index 088d35a2b0..e80ab42b78 100644 --- a/dinky-web/.prettierrc.js +++ b/dinky-web/.prettierrc.js @@ -16,11 +16,17 @@ */ module.exports = { - singleQuote: true, - trailingComma: 'all', - printWidth: 100, - proseWrap: 'never', + singleQuote: true, // 使用单引号 + semi: true, // 使用分号 + trailingComma: 'all', // 尾随逗号 + printWidth: 100, // 该选项指定一行最多允许的字符数。当代码中的一行超过该限制时,Prettier会自动将代码进行换行。建议设置为80到100之间的数字。 + proseWrap: 'never', // 该选项指定是否对markdown文件换行,默认为never,即不换行。 endOfLine: 'lf', + tabWidth: 2, // 该选项指定使用几个空格代替一个Tab键。一般建议为2或4个空格。 + jsxSingleQuote: true, // 使用单引号 + // 每个文件格式化的范围是文件的全部内容 + rangeStart: 0, + rangeEnd: Infinity, overrides: [ { files: '.prettierrc', @@ -34,5 +40,17 @@ module.exports = { parser: 'html', }, }, + { + files: '*.tsx', + options: { + trailingComma: 'none', + }, + }, + { + files: '*.ts', + options: { + trailingComma: 'none', + }, + }, ], }; diff --git a/dinky-web/config/config.ts b/dinky-web/config/config.ts index 3b63896e79..2571060781 100644 --- a/dinky-web/config/config.ts +++ b/dinky-web/config/config.ts @@ -45,7 +45,7 @@ export default defineConfig({ hash: true, esbuildMinifyIIFE: true, history: { - type: 'hash', + type: 'hash' }, /** * @name 兼容性设置 @@ -71,7 +71,7 @@ export default defineConfig({ theme: { // 如果不想要 configProvide 动态设置主题需要把这个设置为 default // 只有设置为 variable, 才能使用 configProvide 动态设置主色调 - 'root-entry-name': 'variable', + 'root-entry-name': 'variable' }, /** * @name moment 的国际化配置 @@ -111,7 +111,7 @@ export default defineConfig({ title: 'Dinky', layout: { locale: true, - ...defaultSettings, + ...defaultSettings }, /** * @name moment2dayjs 插件 @@ -120,7 +120,7 @@ export default defineConfig({ */ moment2dayjs: { preset: 'antd', - plugins: ['duration'], + plugins: ['duration'] }, /** * @name 国际化插件 @@ -132,7 +132,7 @@ export default defineConfig({ antd: true, // default true, when it is true, will use `navigator.language` overwrite default baseNavigator: true, - useLocalStorage: true, + useLocalStorage: true }, /** @@ -152,7 +152,7 @@ export default defineConfig({ * @doc https://umijs.org/docs/max/request */ request: { - dataField: 'datas', + dataField: 'datas' }, /** * @name 权限插件 @@ -166,7 +166,7 @@ export default defineConfig({ */ headScripts: [ // 解决首次加载时白屏的问题 - { src: '/scripts/loading.js', async: true }, + { src: '/scripts/loading.js', async: true } ], //================ pro 插件配置 ================= presets: ['umi-presets-pro'], @@ -181,18 +181,17 @@ export default defineConfig({ // 或者使用在线的版本 // schemaPath: "https://gw.alipayobjects.com/os/antfincdn/M%24jrzTTYJN/oneapi.json" schemaPath: join(__dirname, 'oneapi.json'), - mock: false, + mock: false }, { requestLibPath: "import { request } from '@umijs/max'", - schemaPath: - 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json', - projectName: 'swagger', - }, + schemaPath: 'https://gw.alipayobjects.com/os/antfincdn/CA1dOm%2631B/openapi.json', + projectName: 'swagger' + } ], mfsu: { - strategy: 'normal', + strategy: 'normal' }, // requestRecord: {}, - dva: {}, + dva: {} }); diff --git a/dinky-web/config/defaultSettings.ts b/dinky-web/config/defaultSettings.ts index 5d86bef3fa..e6e3b751eb 100644 --- a/dinky-web/config/defaultSettings.ts +++ b/dinky-web/config/defaultSettings.ts @@ -39,7 +39,7 @@ const Settings: ProLayoutProps & { iconfontUrl: '', splitMenus: true, menu: { - locale: true, + locale: true }, token: { // bgLayout: '', //layout 的背景颜色 @@ -54,16 +54,16 @@ const Settings: ProLayoutProps & { colorTextMenuSelected: '#fff', colorBgMenuItemSelected: '#1e252a', colorTextMenuActive: 'rgba(255,255,255,0.85)', - colorTextRightActionsItem: '#dfdfdf', + colorTextRightActionsItem: '#dfdfdf' }, sider: { - colorBgMenuItemSelected: '#3399FF', + colorBgMenuItemSelected: '#3399FF' }, pageContainer: { paddingBlockPageContainerContent: 5, - paddingInlinePageContainerContent: 10, - }, - }, + paddingInlinePageContainerContent: 10 + } + } }; export default Settings; diff --git a/dinky-web/config/proxy.ts b/dinky-web/config/proxy.ts index 1e0cef6f22..96bf7cffd9 100644 --- a/dinky-web/config/proxy.ts +++ b/dinky-web/config/proxy.ts @@ -45,10 +45,10 @@ export default { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache, no-transform', Connection: 'keep-alive', - 'X-Accel-Buffering': 'noe', + 'X-Accel-Buffering': 'noe' }); - }, - }, + } + } }, /** @@ -60,14 +60,14 @@ export default { '/api/': { target: 'https://proapi.azurewebsites.net', changeOrigin: true, - pathRewrite: { '^': '' }, - }, + pathRewrite: { '^': '' } + } }, pre: { '/api/': { target: 'your pre url', changeOrigin: true, - pathRewrite: { '^': '' }, - }, - }, + pathRewrite: { '^': '' } + } + } }; diff --git a/dinky-web/config/routes.ts b/dinky-web/config/routes.ts index 53525a7531..1da897458e 100644 --- a/dinky-web/config/routes.ts +++ b/dinky-web/config/routes.ts @@ -36,27 +36,27 @@ export default [ { name: 'login', path: '/user/login', - component: './Other/Login', - }, - ], + component: './Other/Login' + } + ] }, { path: '/', - redirect: '/home', + redirect: '/home' }, { path: '/home', name: 'home', icon: 'HomeOutlined', footerRender: false, - component: './Home', + component: './Home' }, { path: '/datastudio', name: 'datastudio', icon: 'CodeOutlined', footerRender: false, - component: './DataStudio', + component: './DataStudio' }, { path: '/devops', @@ -66,21 +66,21 @@ export default [ routes: [ { path: '/devops', - redirect: '/devops/joblist', + redirect: '/devops/joblist' }, { path: '/devops/joblist', name: 'job', hideInMenu: true, - component: './DevOps', + component: './DevOps' }, { path: '/devops/job-detail', name: 'job-detail', hideInMenu: true, - component: './DevOps/JobDetail', - }, - ], + component: './DevOps/JobDetail' + } + ] }, { path: '/registration', @@ -90,7 +90,7 @@ export default [ routes: [ { path: '/registration', - redirect: '/registration/cluster/instance', + redirect: '/registration/cluster/instance' }, { path: '/registration/cluster', @@ -100,14 +100,14 @@ export default [ { path: '/registration/cluster/instance', name: 'cluster-instance', - component: './RegCenter/Cluster/Instance', + component: './RegCenter/Cluster/Instance' }, { path: '/registration/cluster/config', name: 'cluster-config', - component: './RegCenter/Cluster/Configuration', - }, - ], + component: './RegCenter/Cluster/Configuration' + } + ] }, { path: '/registration/database', @@ -116,9 +116,9 @@ export default [ component: './RegCenter/DataSource', routes: [ { - path: '/registration/database/detail/:id', - }, - ], + path: '/registration/database/detail/:id' + } + ] }, { path: '/registration/alert', @@ -128,46 +128,46 @@ export default [ { path: '/registration/alert/instance', name: 'instance', - component: './RegCenter/Alert/AlertInstance', + component: './RegCenter/Alert/AlertInstance' }, { path: '/registration/alert/group', name: 'group', - component: './RegCenter/Alert/AlertGroup', - }, - ], + component: './RegCenter/Alert/AlertGroup' + } + ] }, { path: '/registration/document', name: 'document', icon: 'BookOutlined', - component: './RegCenter/Document', + component: './RegCenter/Document' }, { path: '/registration/fragment', name: 'fragment', icon: 'RocketOutlined', - component: './RegCenter/GlobalVar', + component: './RegCenter/GlobalVar' }, { path: '/registration/gitprojects', name: 'gitprojects', icon: 'GithubOutlined', - component: './RegCenter/GitProject', + component: './RegCenter/GitProject' }, { path: '/registration/udf', name: 'udf', icon: 'ToolOutlined', - component: './RegCenter/UDF', + component: './RegCenter/UDF' }, { path: '/registration/resource', name: 'resource', icon: 'FileZipOutlined', - component: './RegCenter/Resource', - }, - ], + component: './RegCenter/Resource' + } + ] }, { name: 'auth', @@ -178,39 +178,39 @@ export default [ routes: [ { path: '/auth', - redirect: '/auth/user', + redirect: '/auth/user' }, { path: '/auth/user', name: 'user', icon: 'UserOutlined', - component: './AuthCenter/User', + component: './AuthCenter/User' }, { path: '/auth/role', name: 'role', icon: 'TeamOutlined', - component: './AuthCenter/Role', + component: './AuthCenter/Role' }, { path: '/auth/menu', name: 'menu', icon: 'MenuOutlined', - component: './AuthCenter/Menu', + component: './AuthCenter/Menu' }, { path: '/auth/rowpermissions', name: 'rowpermissions', icon: 'SafetyCertificateOutlined', - component: './AuthCenter/RowPermissions', + component: './AuthCenter/RowPermissions' }, { path: '/auth/tenant', name: 'tenant', icon: 'SecurityScanOutlined', - component: './AuthCenter/Tenant', - }, - ], + component: './AuthCenter/Tenant' + } + ] }, { @@ -221,51 +221,51 @@ export default [ routes: [ { path: '/settings', - redirect: '/settings/globalsetting', + redirect: '/settings/globalsetting' }, { path: '/settings/globalsetting', name: 'globalsetting', icon: 'SettingOutlined', - component: './SettingCenter/GlobalSetting', + component: './SettingCenter/GlobalSetting' }, { path: '/settings/systemlog', name: 'systemlog', icon: 'InfoCircleOutlined', - component: './SettingCenter/SystemLogs', + component: './SettingCenter/SystemLogs' }, { path: '/settings/process', name: 'process', icon: 'ReconciliationOutlined', - component: './SettingCenter/Process', - }, - ], + component: './SettingCenter/Process' + } + ] }, { path: '/metrics', name: 'metrics', icon: 'DashboardOutlined', footerRender: false, - component: './Metrics', + component: './Metrics' }, { path: '/about', name: 'about', icon: 'SmileOutlined', footerRender: false, - component: './Other/About', + component: './Other/About' }, { path: '/account/center', footerRender: false, name: 'center', hideInMenu: true, - component: './Other/PersonCenter', + component: './Other/PersonCenter' }, { path: '*', - component: './Other/404', - }, + component: './Other/404' + } ]; diff --git a/dinky-web/jest.config.ts b/dinky-web/jest.config.ts index 79192b98fd..5e59cfe47c 100644 --- a/dinky-web/jest.config.ts +++ b/dinky-web/jest.config.ts @@ -20,8 +20,8 @@ import { configUmiAlias, createConfig } from '@umijs/max/test'; export default async () => { const config = await configUmiAlias({ ...createConfig({ - target: 'browser', - }), + target: 'browser' + }) }); console.log(); @@ -29,12 +29,12 @@ export default async () => { ...config, testEnvironmentOptions: { ...(config?.testEnvironmentOptions || {}), - url: 'http://localhost:8000', + url: 'http://localhost:8000' }, setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'], globals: { ...config.globals, - localStorage: null, - }, + localStorage: null + } }; }; diff --git a/dinky-web/src/access.ts b/dinky-web/src/access.ts index 6777921080..598ca8ef35 100644 --- a/dinky-web/src/access.ts +++ b/dinky-web/src/access.ts @@ -20,9 +20,7 @@ import { API } from './services/data'; /** * @see https://umijs.org/zh-CN/plugins/plugin-access * */ -export default function access( - initialState: { currentUser?: API.CurrentUser } | undefined, -) { +export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) { const { currentUser } = initialState ?? {}; return { canAdmin: currentUser && currentUser.user.superAdminFlag, @@ -35,8 +33,8 @@ export default function access( //TODOpath可以是window.location.href、key return currentUser?.menuList?.some?.( - (item) => item?.path?.startsWith(path) || item?.path?.endsWith(path), + (item) => item?.path?.startsWith(path) || item?.path?.endsWith(path) ); - }, + } }; } diff --git a/dinky-web/src/app.tsx b/dinky-web/src/app.tsx index 283ce1d8dd..6df13219d9 100644 --- a/dinky-web/src/app.tsx +++ b/dinky-web/src/app.tsx @@ -20,13 +20,10 @@ import RightContent from '@/components/RightContent'; import { AccessContextProvider } from '@/hooks/useAccess'; import { UnAccessible } from '@/pages/Other/403'; import { API_CONSTANTS } from '@/services/constants'; +import { SysMenu } from '@/types/AuthCenter/data'; import { THEME } from '@/types/Public/data'; -import { SysMenu } from '@/types/RegCenter/data'; import { l } from '@/utils/intl'; -import { - PageLoading, - Settings as LayoutSettings, -} from '@ant-design/pro-components'; +import { PageLoading, Settings as LayoutSettings } from '@ant-design/pro-components'; import type { RunTimeLayoutConfig } from '@umijs/max'; import { history } from '@umijs/max'; import { JSX } from 'react'; @@ -34,10 +31,7 @@ import { Reducer, StoreEnhancer } from 'redux'; import { persistReducer, persistStore } from 'redux-persist'; import storage from 'redux-persist/lib/storage'; import { Navigate } from 'umi'; -import { - default as defaultSettings, - default as Settings, -} from '../config/defaultSettings'; +import { default as defaultSettings, default as Settings } from '../config/defaultSettings'; import { errorConfig } from './requestErrorConfig'; import { getDataByParamsReturnResult } from './services/BusinessCrud'; import { API } from './services/data'; @@ -66,25 +60,18 @@ export function patchRoutes({ routes }: any) { const queryUserInfo = async () => { return getDataByParamsReturnResult(API_CONSTANTS.CURRENT_USER).then( (result) => { - const { - user, - roleList, - tenantList, - currentTenant, - menuList, - saTokenInfo, - } = result.datas; + const { user, roleList, tenantList, currentTenant, menuList, saTokenInfo } = result.datas; extraRoutes = menuList; const currentUser: API.CurrentUser = { user: { ...user, - avatar: user.avatar ?? '/icons/user_avatar.png', + avatar: user.avatar ?? '/icons/user_avatar.png' }, roleList: roleList, tenantList: tenantList, currentTenant: currentTenant, menuList: menuList, - tokenInfo: saTokenInfo, + tokenInfo: saTokenInfo }; return currentUser; }, @@ -92,7 +79,7 @@ const queryUserInfo = async () => { history.push(loginPath); console.log(error); return undefined; - }, + } ); }; @@ -114,12 +101,12 @@ export async function getInitialState(): Promise<{ return { fetchUserInfo, currentUser, - settings: defaultSettings as Partial, + settings: defaultSettings as Partial }; } return { fetchUserInfo, - settings: defaultSettings as Partial, + settings: defaultSettings as Partial }; } @@ -135,9 +122,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { return ( <> {'logo'} - - {Settings.title} - + {Settings.title} ); }, @@ -145,14 +130,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { footerRender: () =>