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: () =>