From e0f09758ae9488e3fd3762463b3e4df5043f8994 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 13:52:04 +0800 Subject: [PATCH 01/15] optimize some image addresses as relative paths --- dinky-web/config/defaultSettings.ts | 2 +- dinky-web/src/components/Footer/index.tsx | 2 +- .../src/pages/Other/Login/LoginForm/MainWithStyle/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dinky-web/config/defaultSettings.ts b/dinky-web/config/defaultSettings.ts index e6e3b751eb..e0fccd0a92 100644 --- a/dinky-web/config/defaultSettings.ts +++ b/dinky-web/config/defaultSettings.ts @@ -35,7 +35,7 @@ const Settings: ProLayoutProps & { // 这里不能删除,需要先设置,否则会导致页面白屏, 然后在 layout 进行重新赋值 title: 'Dinky Real-time Platform ', pwa: true, - logo: '/dinky.svg', + logo: './dinky.svg', iconfontUrl: '', splitMenus: true, menu: { diff --git a/dinky-web/src/components/Footer/index.tsx b/dinky-web/src/components/Footer/index.tsx index a2b6d096c5..314352fd5b 100644 --- a/dinky-web/src/components/Footer/index.tsx +++ b/dinky-web/src/components/Footer/index.tsx @@ -27,7 +27,7 @@ const Footer: React.FC = () => { return ( { const { children } = props; return ( -
+
From ae0adb1d4f565c76b7fabcad07ee2a60d38c0250 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 14:14:45 +0800 Subject: [PATCH 02/15] optimize some image addresses as relative paths --- dinky-web/config/config.ts | 3 ++- dinky-web/src/app.tsx | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dinky-web/config/config.ts b/dinky-web/config/config.ts index 86f20ba35a..0c0c1f063b 100644 --- a/dinky-web/config/config.ts +++ b/dinky-web/config/config.ts @@ -44,6 +44,7 @@ export default defineConfig({ */ hash: true, esbuildMinifyIIFE: true, + publicPath: process.env.NODE_ENV === 'production' ? './' : '/', history: { type: 'hash' }, @@ -166,7 +167,7 @@ export default defineConfig({ */ headScripts: [ // 解决首次加载时白屏的问题 - { src: '/scripts/loading.js', async: true } + { src: './scripts/loading.js', async: true } ], //================ pro 插件配置 ================= presets: ['umi-presets-pro'], diff --git a/dinky-web/src/app.tsx b/dinky-web/src/app.tsx index 141534e6fe..8d3beb8406 100644 --- a/dinky-web/src/app.tsx +++ b/dinky-web/src/app.tsx @@ -65,7 +65,7 @@ const queryUserInfo = async () => { const currentUser: API.CurrentUser = { user: { ...user, - avatar: user.avatar ?? '/icons/user_avatar.png' + avatar: user.avatar ?? './icons/user_avatar.png' }, roleList: roleList, tenantList: tenantList, From 35f10b995fea35ed9f9e24c9d247cd2cc7f751f5 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 14:30:41 +0800 Subject: [PATCH 03/15] optimize some image addresses as relative paths --- dinky-web/src/models/Sse.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dinky-web/src/models/Sse.tsx b/dinky-web/src/models/Sse.tsx index e2372ef42c..7bfd0ae811 100644 --- a/dinky-web/src/models/Sse.tsx +++ b/dinky-web/src/models/Sse.tsx @@ -20,6 +20,7 @@ import { postAll } from '@/services/api'; import { ErrorMessage } from '@/utils/messages'; import { useEffect, useRef, useState } from 'react'; +// @ts-ignore import { v4 as uuidv4 } from 'uuid'; const session_invalid_label = 'SESSION_INVALID'; @@ -51,7 +52,7 @@ export default () => { }; const reconnectSse = () => { uuidRef.current = uuidv4(); - const sseUrl = '/api/sse/connect?sessionKey=' + uuidRef.current; + const sseUrl = 'api/sse/connect?sessionKey=' + uuidRef.current; eventSource?.close(); setEventSource(new EventSource(sseUrl)); }; From 97ca328c2ebeb4749e0f321ce909e1ff965bb701 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 14:31:20 +0800 Subject: [PATCH 04/15] optimize some image addresses as relative paths --- dinky-web/config/config.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dinky-web/config/config.ts b/dinky-web/config/config.ts index 0c0c1f063b..eed511cad2 100644 --- a/dinky-web/config/config.ts +++ b/dinky-web/config/config.ts @@ -24,6 +24,7 @@ import routes from './routes'; const { REACT_APP_ENV = 'dev' } = process.env; +// @ts-ignore export default defineConfig({ /** * tags router: @@ -87,6 +88,7 @@ export default defineConfig({ * @doc 代理介绍 https://umijs.org/docs/guides/proxy * @doc 代理配置 https://umijs.org/docs/api/config#proxy */ + // @ts-ignore proxy: proxy[REACT_APP_ENV as keyof typeof proxy], /** * @name 快速热更新配置 From 0ebee4f31b7ff1b94aa89641b015a7acf8e672e2 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 14:40:06 +0800 Subject: [PATCH 05/15] optimize some image addresses as relative paths --- dinky-web/src/requestErrorConfig.ts | 2 + dinky-web/src/services/endpoints.tsx | 335 ++++++++++++++------------- 2 files changed, 174 insertions(+), 163 deletions(-) diff --git a/dinky-web/src/requestErrorConfig.ts b/dinky-web/src/requestErrorConfig.ts index ee3ee7004f..742c41e9b6 100644 --- a/dinky-web/src/requestErrorConfig.ts +++ b/dinky-web/src/requestErrorConfig.ts @@ -74,6 +74,8 @@ const handleBizError = (result: ResponseStructure) => { * @doc https://umijs.org/docs/max/request#配置 */ export const errorConfig: RequestConfig = { + // 修改为相对请求路径, 避免请求路径出现错误 会自动拼接为完整请求路径 + baseURL: './', // 错误处理: umi@3 的错误处理方案。 errorConfig: { // 错误抛出 diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index b282cfda4f..e4ded86385 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,292 +17,301 @@ * */ + +/** + * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用相对请求路径 , 避免以 / 开头的请求路径, 以免影响接口请求 + * + * 在使用时 import { API_CONSTANTS } from '@/services/endpoints'; 然后使用 API_CONSTANTS.GET_SERVICE_VERSION 这样的方式使用 + * + * 在请求时 会使用 定义的 baseUrl 配置 + 定义的接口请求路径, 为最终的请求路径.发送至后端服务端 + * + */ export enum API_CONSTANTS { - GET_SERVICE_VERSION = '/api/version', + GET_SERVICE_VERSION = 'api/version', // --- user --- // login path - LOGIN_PATH = '/user/login', - TOKEN_INFO = '/api/tokenInfo', - LOGIN_RECORD = '/api/log/loginRecord', - OPERATE_LOG = '/api/log/operateLog', + LOGIN_PATH = 'user/login', + TOKEN_INFO = 'api/tokenInfo', + LOGIN_RECORD = 'api/log/loginRecord', + OPERATE_LOG = 'api/log/operateLog', // user login - LOGIN = '/api/login', + LOGIN = 'api/login', // current user info - CURRENT_USER = '/api/current', + CURRENT_USER = 'api/current', // logout - LOGOUT = '/api/outLogin', + LOGOUT = 'api/outLogin', // choose tenant - CHOOSE_TENANT = '/api/chooseTenant', + CHOOSE_TENANT = 'api/chooseTenant', // user list - USER = '/api/user', - USER_RECOVERY = '/api/user/recovery', - USER_RESET_PASSWORD = '/api/user/resetPassword', + USER = 'api/user', + USER_RECOVERY = 'api/user/recovery', + USER_RESET_PASSWORD = 'api/user/resetPassword', // enable user - USER_ENABLE = '/api/user/enable', + USER_ENABLE = 'api/user/enable', // delete user - USER_DELETE = '/api/user/delete', + USER_DELETE = 'api/user/delete', // user change password - USER_MODIFY_PASSWORD = '/api/user/modifyPassword', + USER_MODIFY_PASSWORD = 'api/user/modifyPassword', // GRANT USER TO role - USER_ASSIGN_ROLE = '/api/user/assignRole', + USER_ASSIGN_ROLE = 'api/user/assignRole', // QUERY roles by userid - GET_ROLES_BY_USERID = '/api/role/getRolesAndIdsByUserId', + GET_ROLES_BY_USERID = 'api/role/getRolesAndIdsByUserId', // --- token --- // token list - TOKEN = '/api/token/list', + TOKEN = 'api/token/list', // token delete - TOKEN_DELETE = '/api/token/delete', + TOKEN_DELETE = 'api/token/delete', // token save or update - TOKEN_SAVE_OR_UPDATE = '/api/token/saveOrUpdateToken', + TOKEN_SAVE_OR_UPDATE = 'api/token/saveOrUpdateToken', // token build - TOKEN_BUILD = '/api/token/buildToken', + TOKEN_BUILD = 'api/token/buildToken', // --- tenant --- // tenant list - TENANT = '/api/tenant', + TENANT = 'api/tenant', // assign user to tenant - ASSIGN_USER_TO_TENANT = '/api/tenant/assignUserToTenant', + ASSIGN_USER_TO_TENANT = 'api/tenant/assignUserToTenant', // delete tenant - TENANT_DELETE = '/api/tenant/delete', + TENANT_DELETE = 'api/tenant/delete', // get user list by tenantId - GET_USER_LIST_BY_TENANTID = '/api/user/getUserListByTenantId', + GET_USER_LIST_BY_TENANTID = 'api/user/getUserListByTenantId', //tenant users - TENANT_USERS = '/api/tenant/getUsersByTenantId', - USER_SET_TENANT_ADMIN = '/api/user/updateUserToTenantAdmin', - TENANT_USER_LIST = '/api/tenant/getTenantListByUserId', + TENANT_USERS = 'api/tenant/getUsersByTenantId', + USER_SET_TENANT_ADMIN = 'api/user/updateUserToTenantAdmin', + TENANT_USER_LIST = 'api/tenant/getTenantListByUserId', // --- role --- // role list - ROLE = '/api/role', - ROLE_ADDED_OR_UPDATE = '/api/role/addedOrUpdateRole', - ROLE_DELETE = '/api/role/delete', - ROLE_ASSIGN_MENU = '/api/roleMenu/assignMenuToRole', - ROLE_MENU_LIST = '/api/menu/roleMenus', - ROLE_USER_LIST = '/api/role/getUserListByRoleId', + ROLE = 'api/role', + ROLE_ADDED_OR_UPDATE = 'api/role/addedOrUpdateRole', + ROLE_DELETE = 'api/role/delete', + ROLE_ASSIGN_MENU = 'api/roleMenu/assignMenuToRole', + ROLE_MENU_LIST = 'api/menu/roleMenus', + ROLE_USER_LIST = 'api/role/getUserListByRoleId', // menu - MENU_ADD_OR_UPDATE = '/api/menu/addOrUpdate', - MENU_DELETE = '/api/menu/delete', - MENU_TREE = '/api/menu/tree', - MENU_LIST = '/api/menu/listMenus', + MENU_ADD_OR_UPDATE = 'api/menu/addOrUpdate', + MENU_DELETE = 'api/menu/delete', + MENU_TREE = 'api/menu/tree', + MENU_LIST = 'api/menu/listMenus', // --- row Permissions --- // row permissions list - ROW_PERMISSIONS = '/api/rowPermissions', + ROW_PERMISSIONS = 'api/rowPermissions', // row permissions delete - ROW_PERMISSIONS_DELETE = '/api/rowPermissions/delete', + ROW_PERMISSIONS_DELETE = 'api/rowPermissions/delete', // --- global variable --- // global variable list - GLOBAL_VARIABLE = '/api/fragment', + GLOBAL_VARIABLE = 'api/fragment', // delete global variable by id - GLOBAL_VARIABLE_DELETE = '/api/fragment/delete', + GLOBAL_VARIABLE_DELETE = 'api/fragment/delete', // global variable enable or disable - GLOBAL_VARIABLE_ENABLE = '/api/fragment/enable', + GLOBAL_VARIABLE_ENABLE = 'api/fragment/enable', // --- registries center --- // ----cluster instance // cluster instance list - CLUSTER_INSTANCE = '/api/cluster', - CLUSTER_INSTANCE_LIST = '/api/cluster/list', - CLUSTER_INSTANCE_ENABLE = '/api/cluster/enable', - CLUSTER_INSTANCE_DELETE = '/api/cluster/delete', - CLUSTER_INSTANCE_KILL = '/api/cluster/killCluster', - CLUSTER_INSTANCE_HEARTBEATS = '/api/cluster/heartbeats', - CLUSTER_INSTANCE_RECYCLE = '/api/cluster/recycle', - CLUSTER_CONFIGURATION_START = '/api/cluster/deploySessionClusterInstance', + CLUSTER_INSTANCE = 'api/cluster', + CLUSTER_INSTANCE_LIST = 'api/cluster/list', + CLUSTER_INSTANCE_ENABLE = 'api/cluster/enable', + CLUSTER_INSTANCE_DELETE = 'api/cluster/delete', + CLUSTER_INSTANCE_KILL = 'api/cluster/killCluster', + CLUSTER_INSTANCE_HEARTBEATS = 'api/cluster/heartbeats', + CLUSTER_INSTANCE_RECYCLE = 'api/cluster/recycle', + CLUSTER_CONFIGURATION_START = 'api/cluster/deploySessionClusterInstance', // cluster configuration list - CLUSTER_CONFIGURATION = '/api/clusterConfiguration/list', - CLUSTER_CONFIGURATION_ADD_OR_UPDATE = '/api/clusterConfiguration/saveOrUpdate', - CLUSTER_CONFIGURATION_DELETE = '/api/clusterConfiguration/delete', - CLUSTER_CONFIGURATION_ENABLE = '/api/clusterConfiguration/enable', - CLUSTER_CONFIGURATION_TEST = '/api/clusterConfiguration/testConnect', + CLUSTER_CONFIGURATION = 'api/clusterConfiguration/list', + CLUSTER_CONFIGURATION_ADD_OR_UPDATE = 'api/clusterConfiguration/saveOrUpdate', + CLUSTER_CONFIGURATION_DELETE = 'api/clusterConfiguration/delete', + CLUSTER_CONFIGURATION_ENABLE = 'api/clusterConfiguration/enable', + CLUSTER_CONFIGURATION_TEST = 'api/clusterConfiguration/testConnect', // datasource registries list - DATASOURCE = '/api/database/list', - DATASOURCE_ADD_OR_UPDATE = '/api/database/saveOrUpdate', + DATASOURCE = 'api/database/list', + DATASOURCE_ADD_OR_UPDATE = 'api/database/saveOrUpdate', // datasource registries delete - DATASOURCE_DELETE = '/api/database/delete', + DATASOURCE_DELETE = 'api/database/delete', // datasource registries enable or disable - DATASOURCE_ENABLE = '/api/database/enable', + DATASOURCE_ENABLE = 'api/database/enable', // datasource registries test - DATASOURCE_TEST = '/api/database/testConnect', + DATASOURCE_TEST = 'api/database/testConnect', // datasource checkHeartBeat By Id - DATASOURCE_CHECK_HEARTBEAT_BY_ID = '/api/database/checkHeartBeatByDataSourceId', + DATASOURCE_CHECK_HEARTBEAT_BY_ID = 'api/database/checkHeartBeatByDataSourceId', // copy datasource - DATASOURCE_COPY = '/api/database/copyDatabase', + DATASOURCE_COPY = 'api/database/copyDatabase', // get schema by datasource id - DATASOURCE_GET_SCHEMA_TABLES = '/api/database/getSchemasAndTables', - DATASOURCE_GET_COLUMNS_BY_TABLE = '/api/database/listColumns', - DATASOURCE_GET_GEN_SQL = '/api/database/getSqlGeneration', - DATASOURCE_QUERY_DATA = '/api/database/queryData', + DATASOURCE_GET_SCHEMA_TABLES = 'api/database/getSchemasAndTables', + DATASOURCE_GET_COLUMNS_BY_TABLE = 'api/database/listColumns', + DATASOURCE_GET_GEN_SQL = 'api/database/getSqlGeneration', + DATASOURCE_QUERY_DATA = 'api/database/queryData', // document list - DOCUMENT = '/api/document', + DOCUMENT = 'api/document', // delete document by id - DOCUMENT_DELETE = '/api/document/delete', + DOCUMENT_DELETE = 'api/document/delete', // document enable or disable - DOCUMENT_ENABLE = '/api/document/enable', + DOCUMENT_ENABLE = 'api/document/enable', // ---- alert instance ---- // alert instance list - ALERT_INSTANCE = '/api/alertInstance/list', - ALERT_INSTANCE_ADD_OR_UPDATE = '/api/alertInstance/saveOrUpdate', + ALERT_INSTANCE = 'api/alertInstance/list', + ALERT_INSTANCE_ADD_OR_UPDATE = 'api/alertInstance/saveOrUpdate', // delete alert instance by id - ALERT_INSTANCE_DELETE = '/api/alertInstance/delete', + ALERT_INSTANCE_DELETE = 'api/alertInstance/delete', // alert instance enable or disable - ALERT_INSTANCE_ENABLE = '/api/alertInstance/enable', + ALERT_INSTANCE_ENABLE = 'api/alertInstance/enable', // alert instance list all - ALERT_INSTANCE_LIST_ENABLE_ALL = '/api/alertInstance/listEnabledAll', + ALERT_INSTANCE_LIST_ENABLE_ALL = 'api/alertInstance/listEnabledAll', // sendTest - ALERT_INSTANCE_SEND_TEST = '/api/alertInstance/sendTest', + ALERT_INSTANCE_SEND_TEST = 'api/alertInstance/sendTest', // ---- alert group ---- - ALERT_GROUP = '/api/alertGroup/list', - ALERT_GROUP_LIST_ENABLE_ALL = '/api/alertGroup/listEnabledAll', - ALERT_GROUP_ADD_OR_UPDATE = '/api/alertGroup/addOrUpdate', + ALERT_GROUP = 'api/alertGroup/list', + ALERT_GROUP_LIST_ENABLE_ALL = 'api/alertGroup/listEnabledAll', + ALERT_GROUP_ADD_OR_UPDATE = 'api/alertGroup/addOrUpdate', // delete alert group by id - ALERT_GROUP_DELETE = '/api/alertGroup/delete', + ALERT_GROUP_DELETE = 'api/alertGroup/delete', // alert group enable or disable - ALERT_GROUP_ENABLE = '/api/alertGroup/enable', + ALERT_GROUP_ENABLE = 'api/alertGroup/enable', - ALERT_RULE_LIST = '/api/alertRule/list', - ALERT_RULE = '/api/alertRule', - ALERT_TEMPLATE = '/api/alertTemplate', + ALERT_RULE_LIST = 'api/alertRule/list', + ALERT_RULE = 'api/alertRule', + ALERT_TEMPLATE = 'api/alertTemplate', // ---- get git project list---- - GIT_PROJECT = '/api/git/getProjectList', + GIT_PROJECT = 'api/git/getProjectList', // ---- saveOrUpdate ---- - GIT_SAVE_UPDATE = '/api/git/saveOrUpdate', + GIT_SAVE_UPDATE = 'api/git/saveOrUpdate', // dragendSortProject - GIT_DRAGEND_SORT_PROJECT = '/api/git/dragendSortProject', + GIT_DRAGEND_SORT_PROJECT = 'api/git/dragendSortProject', // dragendSort jar - GIT_DRAGEND_SORT_JAR = '/api/git/dragendSortJar', + GIT_DRAGEND_SORT_JAR = 'api/git/dragendSortJar', // ---- get git branch ---- - GIT_BRANCH = '/api/git/getBranchList', + GIT_BRANCH = 'api/git/getBranchList', // ---- DELETE project ---- - GIT_PROJECT_DELETE = '/api/git/deleteProject', + GIT_PROJECT_DELETE = 'api/git/deleteProject', // ---- update project State ---- - GIT_PROJECT_ENABLE = '/api/git/updateEnable', + GIT_PROJECT_ENABLE = 'api/git/updateEnable', // ---- get project details by id ---- - GIT_PROJECT_CODE_TREE = '/api/git/getProjectCode', + GIT_PROJECT_CODE_TREE = 'api/git/getProjectCode', // ---- get project build by id ---- - GIT_PROJECT_BUILD = '/api/git/build', + GIT_PROJECT_BUILD = 'api/git/build', // ---- get project build logs by id---- - GIT_PROJECT_BUILD_STEP_LOGS = '/api/git/build-step-logs', + GIT_PROJECT_BUILD_STEP_LOGS = 'api/git/build-step-logs', //UDF Manage - UDF_LIST = '/api/udf/list', - UDF_RESOURCES_LIST = '/api/udf/udfResourcesList', - UDF_ADD = '/api/udf/addOrUpdateByResourceId', - UDF_UPDATE = '/api/udf/update', + UDF_LIST = 'api/udf/list', + UDF_RESOURCES_LIST = 'api/udf/udfResourcesList', + UDF_ADD = 'api/udf/addOrUpdateByResourceId', + UDF_UPDATE = 'api/udf/update', // UDF template - UDF_TEMPLATE = '/api/udf/template/list', + UDF_TEMPLATE = 'api/udf/template/list', // UDF template add or update - UDF_TEMPLATE_ADD_UPDATE = '/api/udf/template', + UDF_TEMPLATE_ADD_UPDATE = 'api/udf/template', // UDF template delete - UDF_TEMPLATE_DELETE = '/api/udf/template/delete', + UDF_TEMPLATE_DELETE = 'api/udf/template/delete', // UDF template enable or disable - UDF_TEMPLATE_ENABLE = '/api/udf/template/enable', - UDF_TEMPLATE_TREE = '/api/udf/template/tree', + UDF_TEMPLATE_ENABLE = 'api/udf/template/enable', + UDF_TEMPLATE_TREE = 'api/udf/template/tree', // system config center // global config list - SYSTEM_GET_ALL_CONFIG = '/api/sysConfig/getAll', - SYSTEM_GET_ONE_TYPE_CONFIG = '/api/sysConfig/getConfigByType', + SYSTEM_GET_ALL_CONFIG = 'api/sysConfig/getAll', + SYSTEM_GET_ONE_TYPE_CONFIG = 'api/sysConfig/getConfigByType', // update global config by key - SYSTEM_MODIFY_CONFIG = '/api/sysConfig/modifyConfig', + SYSTEM_MODIFY_CONFIG = 'api/sysConfig/modifyConfig', //-- system root logs - SYSTEM_ROOT_LOG = '/api/system/getRootLog', + SYSTEM_ROOT_LOG = 'api/system/getRootLog', // -- get logs list - SYSTEM_ROOT_LOG_LIST = '/api/system/listLogDir', + SYSTEM_ROOT_LOG_LIST = 'api/system/listLogDir', // -- READ LOG file - SYSTEM_ROOT_LOG_READ = '/api/system/readFile', + SYSTEM_ROOT_LOG_READ = 'api/system/readFile', // process list - PROCESS_LIST = '/api/process/listAllProcess', - PROCESS_LOG = '/api/process/getProcess', + PROCESS_LIST = 'api/process/listAllProcess', + PROCESS_LOG = 'api/process/getProcess', // ---- devops - JOB_INSTANCE = '/api/jobInstance', - GET_JOB_INSTANCE_BY_TASK_ID = '/api/jobInstance/getJobInstanceByTaskId', - GET_JOB_BY_ID = '/api/jobInstance/getOneById', - GET_LATEST_HISTORY_BY_ID = '/api/history/getLatestHistoryById', - GET_JOB_DETAIL = '/api/jobInstance/getJobInfoDetail', - REFRESH_JOB_DETAIL = '/api/jobInstance/refreshJobInfoDetail', - READ_CHECKPOINT = '/api/flinkConf/readCheckPoint', - GET_JOB_VERSION = '/api/task/version', + JOB_INSTANCE = 'api/jobInstance', + GET_JOB_INSTANCE_BY_TASK_ID = 'api/jobInstance/getJobInstanceByTaskId', + GET_JOB_BY_ID = 'api/jobInstance/getOneById', + GET_LATEST_HISTORY_BY_ID = 'api/history/getLatestHistoryById', + GET_JOB_DETAIL = 'api/jobInstance/getJobInfoDetail', + REFRESH_JOB_DETAIL = 'api/jobInstance/refreshJobInfoDetail', + READ_CHECKPOINT = 'api/flinkConf/readCheckPoint', + GET_JOB_VERSION = 'api/task/version', GET_JOBMANAGER_LOG = 'api/jobInstance/getJobManagerLog', GET_JOBMANAGER_STDOUT = 'api/jobInstance/getJobManagerStdOut', GET_JOBMANAGER_THREAD_DUMP = 'api/jobInstance/getJobManagerThreadDump', GET_TASKMANAGER_LIST = 'api/jobInstance/getTaskManagerList', GET_TASKMANAGER_LOG = 'api/jobInstance/getTaskManagerLog', GET_JOB_METRICS_ITEMS = 'api/jobInstance/getJobMetricsItems', - CANCEL_JOB = '/api/task/cancel', + CANCEL_JOB = 'api/task/cancel', // /api/studio/getLineage - STUDIO_GET_LINEAGE = '/api/studio/getLineage', + STUDIO_GET_LINEAGE = 'api/studio/getLineage', // /api/jobInstance/getLineage - JOB_INSTANCE_GET_LINEAGE = '/api/jobInstance/getLineage', - RESTART_TASK = '/api/task/restartTask', - SAVEPOINT = '/api/task/savepoint', - RESTART_TASK_FROM_CHECKPOINT = '/api/task/selectSavePointRestartTask', - GET_SAVEPOINT_LIST_BY_TASK_ID = '/api/savepoints/listSavepointsByTaskId', - GET_SAVEPOINT_LIST = '/api/savepoints', - ALERT_HISTORY_LIST = '/api/alertHistory/list', - ALERT_HISTORY_DELETE = '/api/alertHistory/delete', + JOB_INSTANCE_GET_LINEAGE = 'api/jobInstance/getLineage', + RESTART_TASK = 'api/task/restartTask', + SAVEPOINT = 'api/task/savepoint', + RESTART_TASK_FROM_CHECKPOINT = 'api/task/selectSavePointRestartTask', + GET_SAVEPOINT_LIST_BY_TASK_ID = 'api/savepoints/listSavepointsByTaskId', + GET_SAVEPOINT_LIST = 'api/savepoints', + ALERT_HISTORY_LIST = 'api/alertHistory/list', + ALERT_HISTORY_DELETE = 'api/alertHistory/delete', // -- LDAP - GET_LDAP_ENABLE = '/api/ldap/ldapEnableStatus', - LDAP_TEST_CONNECT = '/api/ldap/testConnection', - LDAP_TEST_LOGIN = '/api/ldap/testLogin', - LDAP_LIST_USER = '/api/ldap/listUser', - LDAP_IMPORT_USERS = '/api/ldap/importUsers', + GET_LDAP_ENABLE = 'api/ldap/ldapEnableStatus', + LDAP_TEST_CONNECT = 'api/ldap/testConnection', + LDAP_TEST_LOGIN = 'api/ldap/testLogin', + LDAP_LIST_USER = 'api/ldap/listUser', + LDAP_IMPORT_USERS = 'api/ldap/importUsers', // -- home GET_STATUS_COUNT = 'api/jobInstance/getStatusCount', - GET_RESOURCE_OVERVIEW = '/api/home/getResourceOverview', - GET_JOB_STATUS_OVERVIEW = '/api/home/getJobStatusOverview', - GET_JOB_TYPE_OVERVIEW = '/api/home/getJobTypeOverview', - GET_JOB_MODEL_OVERVIEW = '/api/home/getJobModelOverview', + GET_RESOURCE_OVERVIEW = 'api/home/getResourceOverview', + GET_JOB_STATUS_OVERVIEW = 'api/home/getJobStatusOverview', + GET_JOB_TYPE_OVERVIEW = 'api/home/getJobTypeOverview', + GET_JOB_MODEL_OVERVIEW = 'api/home/getJobModelOverview', // monitor - MONITOR_GET_SYSTEM_DATA = '/api/monitor/getSysData', - MONITOR_GET_FLINK_DATA = '/api/monitor/getFlinkData', - MONITOR_GET_LAST_DATA = '/api/monitor/getLastUpdateData', - MONITOR_GET_JVM_INFO = '/api/monitor/getJvmInfo', - METRICS_LAYOUT_GET_BY_NAME = '/api/monitor/getMetricsLayoutByName', - METRICS_LAYOUT_DELETE = '/api/monitor/deleteMetricsLayout', - JOB_METRICS = '/api/monitor/jobMetrics', - SAVE_FLINK_METRICS = '/api/monitor/saveFlinkMetrics/', - GET_METRICS_LAYOUT = '/api/monitor/getMetricsLayout', + MONITOR_GET_SYSTEM_DATA = 'api/monitor/getSysData', + MONITOR_GET_FLINK_DATA = 'api/monitor/getFlinkData', + MONITOR_GET_LAST_DATA = 'api/monitor/getLastUpdateData', + MONITOR_GET_JVM_INFO = 'api/monitor/getJvmInfo', + METRICS_LAYOUT_GET_BY_NAME = 'api/monitor/getMetricsLayoutByName', + METRICS_LAYOUT_DELETE = 'api/monitor/deleteMetricsLayout', + JOB_METRICS = 'api/monitor/jobMetrics', + SAVE_FLINK_METRICS = 'api/monitor/saveFlinkMetrics/', + GET_METRICS_LAYOUT = 'api/monitor/getMetricsLayout', // flink - FLINK_PROXY = '/api/flink', - FLINK_TABLE_DATA = '/api/subscribe/print', + FLINK_PROXY = 'api/flink', + FLINK_TABLE_DATA = 'api/subscribe/print', // resource - RESOURCE_SHOW_TREE = '/api/resource/getResourcesTreeData', - RESOURCE_GET_CONTENT_BY_ID = '/api/resource/getContentByResourceId', - RESOURCE_REMOVE = '/api/resource/remove', - RESOURCE_CREATE_FOLDER = '/api/resource/createFolder', - RESOURCE_RENAME = '/api/resource/rename', - RESOURCE_UPLOAD = '/api/resource/uploadFile', - RESOURCE_SYNC_DATA = '/api/resource/syncRemoteDirectory', + RESOURCE_SHOW_TREE = 'api/resource/getResourcesTreeData', + RESOURCE_GET_CONTENT_BY_ID = 'api/resource/getContentByResourceId', + RESOURCE_REMOVE = 'api/resource/remove', + RESOURCE_CREATE_FOLDER = 'api/resource/createFolder', + RESOURCE_RENAME = 'api/resource/rename', + RESOURCE_UPLOAD = 'api/resource/uploadFile', + RESOURCE_SYNC_DATA = 'api/resource/syncRemoteDirectory', // catalog - DELETE_CATALOGUE_BY_ID_URL = '/api/catalogue/deleteCatalogueById', - SAVE_OR_UPDATE_TASK_URL = '/api/catalogue/saveOrUpdateCatalogueAndTask', - SAVE_OR_UPDATE_CATALOGUE_URL = '/api/catalogue/saveOrUpdateCatalogue', - COPY_TASK_URL = '/api/catalogue/copyTask', - MOVE_CATALOGUE_URL = '/api/catalogue/moveCatalogue', + DELETE_CATALOGUE_BY_ID_URL = 'api/catalogue/deleteCatalogueById', + SAVE_OR_UPDATE_TASK_URL = 'api/catalogue/saveOrUpdateCatalogueAndTask', + SAVE_OR_UPDATE_CATALOGUE_URL = 'api/catalogue/saveOrUpdateCatalogue', + COPY_TASK_URL = 'api/catalogue/copyTask', + MOVE_CATALOGUE_URL = 'api/catalogue/moveCatalogue', //task - TASK = '/api/task', + TASK = 'api/task', // history - HISTORY_LIST = '/api/history/list' + HISTORY_LIST = 'api/history/list' } From b459210ff2b2da2cafd98dea6cb8552a8e65527a Mon Sep 17 00:00:00 2001 From: Zzm0809 Date: Mon, 26 Feb 2024 06:41:56 +0000 Subject: [PATCH 06/15] Spotless Apply --- dinky-web/src/services/endpoints.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index e4ded86385..8d0234af50 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,7 +17,6 @@ * */ - /** * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用相对请求路径 , 避免以 / 开头的请求路径, 以免影响接口请求 * From 9d37db38a97a533530e2f9a6492d230b7c909112 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 14:49:04 +0800 Subject: [PATCH 07/15] optimize some image addresses as relative paths --- dinky-web/src/services/endpoints.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index e4ded86385..47a89d1b5e 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,7 +17,7 @@ * */ - +// ------------------ 以下为接口请求路径常量定义 ------------------------------------ /** * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用相对请求路径 , 避免以 / 开头的请求路径, 以免影响接口请求 * From 996c860dc90052e3257fc58ce902fbad796615fd Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 15:13:31 +0800 Subject: [PATCH 08/15] optimize some image addresses as relative paths --- dinky-web/src/app.tsx | 2 +- dinky-web/src/services/endpoints.tsx | 341 ++++++++++++++------------- 2 files changed, 172 insertions(+), 171 deletions(-) diff --git a/dinky-web/src/app.tsx b/dinky-web/src/app.tsx index 8d3beb8406..58f0d63a8d 100644 --- a/dinky-web/src/app.tsx +++ b/dinky-web/src/app.tsx @@ -41,7 +41,7 @@ import { API } from './services/data'; // const isDev = process.env.NODE_ENV === "development"; const loginPath = API_CONSTANTS.LOGIN_PATH; -const whiteList = ['/user', '/user/login']; +const whiteList = ['/user', loginPath]; let extraRoutes: SysMenu[] = []; let rendered = false; diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 47a89d1b5e..7e8deb8ac5 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -27,291 +27,292 @@ * */ export enum API_CONSTANTS { - GET_SERVICE_VERSION = 'api/version', + BASE_URL = '.', + GET_SERVICE_VERSION = '/api/version', // --- user --- // login path - LOGIN_PATH = 'user/login', - TOKEN_INFO = 'api/tokenInfo', - LOGIN_RECORD = 'api/log/loginRecord', - OPERATE_LOG = 'api/log/operateLog', + LOGIN_PATH = '/user/login', + TOKEN_INFO = '/api/tokenInfo', + LOGIN_RECORD = '/api/log/loginRecord', + OPERATE_LOG = '/api/log/operateLog', // user login - LOGIN = 'api/login', + LOGIN = '/api/login', // current user info - CURRENT_USER = 'api/current', + CURRENT_USER = '/api/current', // logout - LOGOUT = 'api/outLogin', + LOGOUT = '/api/outLogin', // choose tenant - CHOOSE_TENANT = 'api/chooseTenant', + CHOOSE_TENANT = '/api/chooseTenant', // user list - USER = 'api/user', - USER_RECOVERY = 'api/user/recovery', - USER_RESET_PASSWORD = 'api/user/resetPassword', + USER = '/api/user', + USER_RECOVERY = '/api/user/recovery', + USER_RESET_PASSWORD = '/api/user/resetPassword', // enable user - USER_ENABLE = 'api/user/enable', + USER_ENABLE = '/api/user/enable', // delete user - USER_DELETE = 'api/user/delete', + USER_DELETE = '/api/user/delete', // user change password - USER_MODIFY_PASSWORD = 'api/user/modifyPassword', + USER_MODIFY_PASSWORD = '/api/user/modifyPassword', // GRANT USER TO role - USER_ASSIGN_ROLE = 'api/user/assignRole', + USER_ASSIGN_ROLE = '/api/user/assignRole', // QUERY roles by userid - GET_ROLES_BY_USERID = 'api/role/getRolesAndIdsByUserId', + GET_ROLES_BY_USERID = '/api/role/getRolesAndIdsByUserId', // --- token --- // token list - TOKEN = 'api/token/list', + TOKEN = '/api/token/list', // token delete - TOKEN_DELETE = 'api/token/delete', + TOKEN_DELETE = '/api/token/delete', // token save or update - TOKEN_SAVE_OR_UPDATE = 'api/token/saveOrUpdateToken', + TOKEN_SAVE_OR_UPDATE = '/api/token/saveOrUpdateToken', // token build - TOKEN_BUILD = 'api/token/buildToken', + TOKEN_BUILD = '/api/token/buildToken', // --- tenant --- // tenant list - TENANT = 'api/tenant', + TENANT = '/api/tenant', // assign user to tenant - ASSIGN_USER_TO_TENANT = 'api/tenant/assignUserToTenant', + ASSIGN_USER_TO_TENANT = '/api/tenant/assignUserToTenant', // delete tenant - TENANT_DELETE = 'api/tenant/delete', + TENANT_DELETE = '/api/tenant/delete', // get user list by tenantId - GET_USER_LIST_BY_TENANTID = 'api/user/getUserListByTenantId', + GET_USER_LIST_BY_TENANTID = '/api/user/getUserListByTenantId', //tenant users - TENANT_USERS = 'api/tenant/getUsersByTenantId', - USER_SET_TENANT_ADMIN = 'api/user/updateUserToTenantAdmin', - TENANT_USER_LIST = 'api/tenant/getTenantListByUserId', + TENANT_USERS = '/api/tenant/getUsersByTenantId', + USER_SET_TENANT_ADMIN = '/api/user/updateUserToTenantAdmin', + TENANT_USER_LIST = '/api/tenant/getTenantListByUserId', // --- role --- // role list - ROLE = 'api/role', - ROLE_ADDED_OR_UPDATE = 'api/role/addedOrUpdateRole', - ROLE_DELETE = 'api/role/delete', - ROLE_ASSIGN_MENU = 'api/roleMenu/assignMenuToRole', - ROLE_MENU_LIST = 'api/menu/roleMenus', - ROLE_USER_LIST = 'api/role/getUserListByRoleId', + ROLE = '/api/role', + ROLE_ADDED_OR_UPDATE = '/api/role/addedOrUpdateRole', + ROLE_DELETE = '/api/role/delete', + ROLE_ASSIGN_MENU = '/api/roleMenu/assignMenuToRole', + ROLE_MENU_LIST = '/api/menu/roleMenus', + ROLE_USER_LIST = '/api/role/getUserListByRoleId', // menu - MENU_ADD_OR_UPDATE = 'api/menu/addOrUpdate', - MENU_DELETE = 'api/menu/delete', - MENU_TREE = 'api/menu/tree', - MENU_LIST = 'api/menu/listMenus', + MENU_ADD_OR_UPDATE = '/api/menu/addOrUpdate', + MENU_DELETE = '/api/menu/delete', + MENU_TREE = '/api/menu/tree', + MENU_LIST = '/api/menu/listMenus', // --- row Permissions --- // row permissions list - ROW_PERMISSIONS = 'api/rowPermissions', + ROW_PERMISSIONS = '/api/rowPermissions', // row permissions delete - ROW_PERMISSIONS_DELETE = 'api/rowPermissions/delete', + ROW_PERMISSIONS_DELETE = '/api/rowPermissions/delete', // --- global variable --- // global variable list - GLOBAL_VARIABLE = 'api/fragment', + GLOBAL_VARIABLE = '/api/fragment', // delete global variable by id - GLOBAL_VARIABLE_DELETE = 'api/fragment/delete', + GLOBAL_VARIABLE_DELETE = '/api/fragment/delete', // global variable enable or disable - GLOBAL_VARIABLE_ENABLE = 'api/fragment/enable', + GLOBAL_VARIABLE_ENABLE = '/api/fragment/enable', // --- registries center --- // ----cluster instance // cluster instance list - CLUSTER_INSTANCE = 'api/cluster', - CLUSTER_INSTANCE_LIST = 'api/cluster/list', - CLUSTER_INSTANCE_ENABLE = 'api/cluster/enable', - CLUSTER_INSTANCE_DELETE = 'api/cluster/delete', - CLUSTER_INSTANCE_KILL = 'api/cluster/killCluster', - CLUSTER_INSTANCE_HEARTBEATS = 'api/cluster/heartbeats', - CLUSTER_INSTANCE_RECYCLE = 'api/cluster/recycle', - CLUSTER_CONFIGURATION_START = 'api/cluster/deploySessionClusterInstance', + CLUSTER_INSTANCE = '/api/cluster', + CLUSTER_INSTANCE_LIST = '/api/cluster/list', + CLUSTER_INSTANCE_ENABLE = '/api/cluster/enable', + CLUSTER_INSTANCE_DELETE = '/api/cluster/delete', + CLUSTER_INSTANCE_KILL = '/api/cluster/killCluster', + CLUSTER_INSTANCE_HEARTBEATS = '/api/cluster/heartbeats', + CLUSTER_INSTANCE_RECYCLE = '/api/cluster/recycle', + CLUSTER_CONFIGURATION_START = '/api/cluster/deploySessionClusterInstance', // cluster configuration list - CLUSTER_CONFIGURATION = 'api/clusterConfiguration/list', - CLUSTER_CONFIGURATION_ADD_OR_UPDATE = 'api/clusterConfiguration/saveOrUpdate', - CLUSTER_CONFIGURATION_DELETE = 'api/clusterConfiguration/delete', - CLUSTER_CONFIGURATION_ENABLE = 'api/clusterConfiguration/enable', - CLUSTER_CONFIGURATION_TEST = 'api/clusterConfiguration/testConnect', + CLUSTER_CONFIGURATION = '/api/clusterConfiguration/list', + CLUSTER_CONFIGURATION_ADD_OR_UPDATE = '/api/clusterConfiguration/saveOrUpdate', + CLUSTER_CONFIGURATION_DELETE = '/api/clusterConfiguration/delete', + CLUSTER_CONFIGURATION_ENABLE = '/api/clusterConfiguration/enable', + CLUSTER_CONFIGURATION_TEST = '/api/clusterConfiguration/testConnect', // datasource registries list - DATASOURCE = 'api/database/list', - DATASOURCE_ADD_OR_UPDATE = 'api/database/saveOrUpdate', + DATASOURCE = '/api/database/list', + DATASOURCE_ADD_OR_UPDATE = '/api/database/saveOrUpdate', // datasource registries delete - DATASOURCE_DELETE = 'api/database/delete', + DATASOURCE_DELETE = '/api/database/delete', // datasource registries enable or disable - DATASOURCE_ENABLE = 'api/database/enable', + DATASOURCE_ENABLE = '/api/database/enable', // datasource registries test - DATASOURCE_TEST = 'api/database/testConnect', + DATASOURCE_TEST = '/api/database/testConnect', // datasource checkHeartBeat By Id - DATASOURCE_CHECK_HEARTBEAT_BY_ID = 'api/database/checkHeartBeatByDataSourceId', + DATASOURCE_CHECK_HEARTBEAT_BY_ID = '/api/database/checkHeartBeatByDataSourceId', // copy datasource - DATASOURCE_COPY = 'api/database/copyDatabase', + DATASOURCE_COPY = '/api/database/copyDatabase', // get schema by datasource id - DATASOURCE_GET_SCHEMA_TABLES = 'api/database/getSchemasAndTables', - DATASOURCE_GET_COLUMNS_BY_TABLE = 'api/database/listColumns', - DATASOURCE_GET_GEN_SQL = 'api/database/getSqlGeneration', - DATASOURCE_QUERY_DATA = 'api/database/queryData', + DATASOURCE_GET_SCHEMA_TABLES = '/api/database/getSchemasAndTables', + DATASOURCE_GET_COLUMNS_BY_TABLE = '/api/database/listColumns', + DATASOURCE_GET_GEN_SQL = '/api/database/getSqlGeneration', + DATASOURCE_QUERY_DATA = '/api/database/queryData', // document list - DOCUMENT = 'api/document', + DOCUMENT = '/api/document', // delete document by id - DOCUMENT_DELETE = 'api/document/delete', + DOCUMENT_DELETE = '/api/document/delete', // document enable or disable - DOCUMENT_ENABLE = 'api/document/enable', + DOCUMENT_ENABLE = '/api/document/enable', // ---- alert instance ---- // alert instance list - ALERT_INSTANCE = 'api/alertInstance/list', - ALERT_INSTANCE_ADD_OR_UPDATE = 'api/alertInstance/saveOrUpdate', + ALERT_INSTANCE = '/api/alertInstance/list', + ALERT_INSTANCE_ADD_OR_UPDATE = '/api/alertInstance/saveOrUpdate', // delete alert instance by id - ALERT_INSTANCE_DELETE = 'api/alertInstance/delete', + ALERT_INSTANCE_DELETE = '/api/alertInstance/delete', // alert instance enable or disable - ALERT_INSTANCE_ENABLE = 'api/alertInstance/enable', + ALERT_INSTANCE_ENABLE = '/api/alertInstance/enable', // alert instance list all - ALERT_INSTANCE_LIST_ENABLE_ALL = 'api/alertInstance/listEnabledAll', + ALERT_INSTANCE_LIST_ENABLE_ALL = '/api/alertInstance/listEnabledAll', // sendTest - ALERT_INSTANCE_SEND_TEST = 'api/alertInstance/sendTest', + ALERT_INSTANCE_SEND_TEST = '/api/alertInstance/sendTest', // ---- alert group ---- - ALERT_GROUP = 'api/alertGroup/list', - ALERT_GROUP_LIST_ENABLE_ALL = 'api/alertGroup/listEnabledAll', - ALERT_GROUP_ADD_OR_UPDATE = 'api/alertGroup/addOrUpdate', + ALERT_GROUP = '/api/alertGroup/list', + ALERT_GROUP_LIST_ENABLE_ALL = '/api/alertGroup/listEnabledAll', + ALERT_GROUP_ADD_OR_UPDATE = '/api/alertGroup/addOrUpdate', // delete alert group by id - ALERT_GROUP_DELETE = 'api/alertGroup/delete', + ALERT_GROUP_DELETE = '/api/alertGroup/delete', // alert group enable or disable - ALERT_GROUP_ENABLE = 'api/alertGroup/enable', + ALERT_GROUP_ENABLE = '/api/alertGroup/enable', - ALERT_RULE_LIST = 'api/alertRule/list', - ALERT_RULE = 'api/alertRule', - ALERT_TEMPLATE = 'api/alertTemplate', + ALERT_RULE_LIST = '/api/alertRule/list', + ALERT_RULE = '/api/alertRule', + ALERT_TEMPLATE = '/api/alertTemplate', // ---- get git project list---- - GIT_PROJECT = 'api/git/getProjectList', + GIT_PROJECT = '/api/git/getProjectList', // ---- saveOrUpdate ---- - GIT_SAVE_UPDATE = 'api/git/saveOrUpdate', + GIT_SAVE_UPDATE = '/api/git/saveOrUpdate', // dragendSortProject - GIT_DRAGEND_SORT_PROJECT = 'api/git/dragendSortProject', + GIT_DRAGEND_SORT_PROJECT = '/api/git/dragendSortProject', // dragendSort jar - GIT_DRAGEND_SORT_JAR = 'api/git/dragendSortJar', + GIT_DRAGEND_SORT_JAR = '/api/git/dragendSortJar', // ---- get git branch ---- - GIT_BRANCH = 'api/git/getBranchList', + GIT_BRANCH = '/api/git/getBranchList', // ---- DELETE project ---- - GIT_PROJECT_DELETE = 'api/git/deleteProject', + GIT_PROJECT_DELETE = '/api/git/deleteProject', // ---- update project State ---- - GIT_PROJECT_ENABLE = 'api/git/updateEnable', + GIT_PROJECT_ENABLE = '/api/git/updateEnable', // ---- get project details by id ---- - GIT_PROJECT_CODE_TREE = 'api/git/getProjectCode', + GIT_PROJECT_CODE_TREE = '/api/git/getProjectCode', // ---- get project build by id ---- - GIT_PROJECT_BUILD = 'api/git/build', + GIT_PROJECT_BUILD = '/api/git/build', // ---- get project build logs by id---- - GIT_PROJECT_BUILD_STEP_LOGS = 'api/git/build-step-logs', + GIT_PROJECT_BUILD_STEP_LOGS = '/api/git/build-step-logs', //UDF Manage - UDF_LIST = 'api/udf/list', - UDF_RESOURCES_LIST = 'api/udf/udfResourcesList', - UDF_ADD = 'api/udf/addOrUpdateByResourceId', - UDF_UPDATE = 'api/udf/update', + UDF_LIST = '/api/udf/list', + UDF_RESOURCES_LIST = '/api/udf/udfResourcesList', + UDF_ADD = '/api/udf/addOrUpdateByResourceId', + UDF_UPDATE = '/api/udf/update', // UDF template - UDF_TEMPLATE = 'api/udf/template/list', + UDF_TEMPLATE = '/api/udf/template/list', // UDF template add or update - UDF_TEMPLATE_ADD_UPDATE = 'api/udf/template', + UDF_TEMPLATE_ADD_UPDATE = '/api/udf/template', // UDF template delete - UDF_TEMPLATE_DELETE = 'api/udf/template/delete', + UDF_TEMPLATE_DELETE = '/api/udf/template/delete', // UDF template enable or disable - UDF_TEMPLATE_ENABLE = 'api/udf/template/enable', - UDF_TEMPLATE_TREE = 'api/udf/template/tree', + UDF_TEMPLATE_ENABLE = '/api/udf/template/enable', + UDF_TEMPLATE_TREE = '/api/udf/template/tree', // system config center // global config list - SYSTEM_GET_ALL_CONFIG = 'api/sysConfig/getAll', - SYSTEM_GET_ONE_TYPE_CONFIG = 'api/sysConfig/getConfigByType', + SYSTEM_GET_ALL_CONFIG = '/api/sysConfig/getAll', + SYSTEM_GET_ONE_TYPE_CONFIG = '/api/sysConfig/getConfigByType', // update global config by key - SYSTEM_MODIFY_CONFIG = 'api/sysConfig/modifyConfig', + SYSTEM_MODIFY_CONFIG = '/api/sysConfig/modifyConfig', //-- system root logs - SYSTEM_ROOT_LOG = 'api/system/getRootLog', + SYSTEM_ROOT_LOG = '/api/system/getRootLog', // -- get logs list - SYSTEM_ROOT_LOG_LIST = 'api/system/listLogDir', + SYSTEM_ROOT_LOG_LIST = '/api/system/listLogDir', // -- READ LOG file - SYSTEM_ROOT_LOG_READ = 'api/system/readFile', + SYSTEM_ROOT_LOG_READ = '/api/system/readFile', // process list - PROCESS_LIST = 'api/process/listAllProcess', - PROCESS_LOG = 'api/process/getProcess', + PROCESS_LIST = '/api/process/listAllProcess', + PROCESS_LOG = '/api/process/getProcess', // ---- devops - JOB_INSTANCE = 'api/jobInstance', - GET_JOB_INSTANCE_BY_TASK_ID = 'api/jobInstance/getJobInstanceByTaskId', - GET_JOB_BY_ID = 'api/jobInstance/getOneById', - GET_LATEST_HISTORY_BY_ID = 'api/history/getLatestHistoryById', - GET_JOB_DETAIL = 'api/jobInstance/getJobInfoDetail', - REFRESH_JOB_DETAIL = 'api/jobInstance/refreshJobInfoDetail', - READ_CHECKPOINT = 'api/flinkConf/readCheckPoint', - GET_JOB_VERSION = 'api/task/version', - GET_JOBMANAGER_LOG = 'api/jobInstance/getJobManagerLog', - GET_JOBMANAGER_STDOUT = 'api/jobInstance/getJobManagerStdOut', - GET_JOBMANAGER_THREAD_DUMP = 'api/jobInstance/getJobManagerThreadDump', - GET_TASKMANAGER_LIST = 'api/jobInstance/getTaskManagerList', - GET_TASKMANAGER_LOG = 'api/jobInstance/getTaskManagerLog', - GET_JOB_METRICS_ITEMS = 'api/jobInstance/getJobMetricsItems', - CANCEL_JOB = 'api/task/cancel', + JOB_INSTANCE = '/api/jobInstance', + GET_JOB_INSTANCE_BY_TASK_ID = '/api/jobInstance/getJobInstanceByTaskId', + GET_JOB_BY_ID = '/api/jobInstance/getOneById', + GET_LATEST_HISTORY_BY_ID = '/api/history/getLatestHistoryById', + GET_JOB_DETAIL = '/api/jobInstance/getJobInfoDetail', + REFRESH_JOB_DETAIL = '/api/jobInstance/refreshJobInfoDetail', + READ_CHECKPOINT = '/api/flinkConf/readCheckPoint', + GET_JOB_VERSION = '/api/task/version', + GET_JOBMANAGER_LOG = '/api/jobInstance/getJobManagerLog', + GET_JOBMANAGER_STDOUT = '/api/jobInstance/getJobManagerStdOut', + GET_JOBMANAGER_THREAD_DUMP = '/api/jobInstance/getJobManagerThreadDump', + GET_TASKMANAGER_LIST = '/api/jobInstance/getTaskManagerList', + GET_TASKMANAGER_LOG = '/api/jobInstance/getTaskManagerLog', + GET_JOB_METRICS_ITEMS = '/api/jobInstance/getJobMetricsItems', + CANCEL_JOB = '/api/task/cancel', // /api/studio/getLineage - STUDIO_GET_LINEAGE = 'api/studio/getLineage', + STUDIO_GET_LINEAGE = '/api/studio/getLineage', // /api/jobInstance/getLineage - JOB_INSTANCE_GET_LINEAGE = 'api/jobInstance/getLineage', - RESTART_TASK = 'api/task/restartTask', - SAVEPOINT = 'api/task/savepoint', - RESTART_TASK_FROM_CHECKPOINT = 'api/task/selectSavePointRestartTask', - GET_SAVEPOINT_LIST_BY_TASK_ID = 'api/savepoints/listSavepointsByTaskId', - GET_SAVEPOINT_LIST = 'api/savepoints', - ALERT_HISTORY_LIST = 'api/alertHistory/list', - ALERT_HISTORY_DELETE = 'api/alertHistory/delete', + JOB_INSTANCE_GET_LINEAGE = '/api/jobInstance/getLineage', + RESTART_TASK = '/api/task/restartTask', + SAVEPOINT = '/api/task/savepoint', + RESTART_TASK_FROM_CHECKPOINT = '/api/task/selectSavePointRestartTask', + GET_SAVEPOINT_LIST_BY_TASK_ID = '/api/savepoints/listSavepointsByTaskId', + GET_SAVEPOINT_LIST = '/api/savepoints', + ALERT_HISTORY_LIST = '/api/alertHistory/list', + ALERT_HISTORY_DELETE = '/api/alertHistory/delete', // -- LDAP - GET_LDAP_ENABLE = 'api/ldap/ldapEnableStatus', - LDAP_TEST_CONNECT = 'api/ldap/testConnection', - LDAP_TEST_LOGIN = 'api/ldap/testLogin', - LDAP_LIST_USER = 'api/ldap/listUser', - LDAP_IMPORT_USERS = 'api/ldap/importUsers', + GET_LDAP_ENABLE = '/api/ldap/ldapEnableStatus', + LDAP_TEST_CONNECT = '/api/ldap/testConnection', + LDAP_TEST_LOGIN = '/api/ldap/testLogin', + LDAP_LIST_USER = '/api/ldap/listUser', + LDAP_IMPORT_USERS = '/api/ldap/importUsers', // -- home - GET_STATUS_COUNT = 'api/jobInstance/getStatusCount', - GET_RESOURCE_OVERVIEW = 'api/home/getResourceOverview', - GET_JOB_STATUS_OVERVIEW = 'api/home/getJobStatusOverview', - GET_JOB_TYPE_OVERVIEW = 'api/home/getJobTypeOverview', - GET_JOB_MODEL_OVERVIEW = 'api/home/getJobModelOverview', + GET_STATUS_COUNT = '/api/jobInstance/getStatusCount', + GET_RESOURCE_OVERVIEW = '/api/home/getResourceOverview', + GET_JOB_STATUS_OVERVIEW = '/api/home/getJobStatusOverview', + GET_JOB_TYPE_OVERVIEW = '/api/home/getJobTypeOverview', + GET_JOB_MODEL_OVERVIEW = '/api/home/getJobModelOverview', // monitor - MONITOR_GET_SYSTEM_DATA = 'api/monitor/getSysData', - MONITOR_GET_FLINK_DATA = 'api/monitor/getFlinkData', - MONITOR_GET_LAST_DATA = 'api/monitor/getLastUpdateData', - MONITOR_GET_JVM_INFO = 'api/monitor/getJvmInfo', - METRICS_LAYOUT_GET_BY_NAME = 'api/monitor/getMetricsLayoutByName', - METRICS_LAYOUT_DELETE = 'api/monitor/deleteMetricsLayout', - JOB_METRICS = 'api/monitor/jobMetrics', - SAVE_FLINK_METRICS = 'api/monitor/saveFlinkMetrics/', - GET_METRICS_LAYOUT = 'api/monitor/getMetricsLayout', + MONITOR_GET_SYSTEM_DATA = '/api/monitor/getSysData', + MONITOR_GET_FLINK_DATA = '/api/monitor/getFlinkData', + MONITOR_GET_LAST_DATA = '/api/monitor/getLastUpdateData', + MONITOR_GET_JVM_INFO = '/api/monitor/getJvmInfo', + METRICS_LAYOUT_GET_BY_NAME = '/api/monitor/getMetricsLayoutByName', + METRICS_LAYOUT_DELETE = '/api/monitor/deleteMetricsLayout', + JOB_METRICS = '/api/monitor/jobMetrics', + SAVE_FLINK_METRICS = '/api/monitor/saveFlinkMetrics/', + GET_METRICS_LAYOUT = '/api/monitor/getMetricsLayout', // flink - FLINK_PROXY = 'api/flink', - FLINK_TABLE_DATA = 'api/subscribe/print', + FLINK_PROXY = '/api/flink', + FLINK_TABLE_DATA = '/api/subscribe/print', // resource - RESOURCE_SHOW_TREE = 'api/resource/getResourcesTreeData', - RESOURCE_GET_CONTENT_BY_ID = 'api/resource/getContentByResourceId', - RESOURCE_REMOVE = 'api/resource/remove', - RESOURCE_CREATE_FOLDER = 'api/resource/createFolder', - RESOURCE_RENAME = 'api/resource/rename', - RESOURCE_UPLOAD = 'api/resource/uploadFile', - RESOURCE_SYNC_DATA = 'api/resource/syncRemoteDirectory', + RESOURCE_SHOW_TREE = '/api/resource/getResourcesTreeData', + RESOURCE_GET_CONTENT_BY_ID = '/api/resource/getContentByResourceId', + RESOURCE_REMOVE = '/api/resource/remove', + RESOURCE_CREATE_FOLDER = '/api/resource/createFolder', + RESOURCE_RENAME = '/api/resource/rename', + RESOURCE_UPLOAD = '/api/resource/uploadFile', + RESOURCE_SYNC_DATA = '/api/resource/syncRemoteDirectory', // catalog - DELETE_CATALOGUE_BY_ID_URL = 'api/catalogue/deleteCatalogueById', - SAVE_OR_UPDATE_TASK_URL = 'api/catalogue/saveOrUpdateCatalogueAndTask', - SAVE_OR_UPDATE_CATALOGUE_URL = 'api/catalogue/saveOrUpdateCatalogue', - COPY_TASK_URL = 'api/catalogue/copyTask', - MOVE_CATALOGUE_URL = 'api/catalogue/moveCatalogue', + DELETE_CATALOGUE_BY_ID_URL = '/api/catalogue/deleteCatalogueById', + SAVE_OR_UPDATE_TASK_URL = '/api/catalogue/saveOrUpdateCatalogueAndTask', + SAVE_OR_UPDATE_CATALOGUE_URL = '/api/catalogue/saveOrUpdateCatalogue', + COPY_TASK_URL = '/api/catalogue/copyTask', + MOVE_CATALOGUE_URL = '/api/catalogue/moveCatalogue', //task - TASK = 'api/task', + TASK = '/api/task', // history - HISTORY_LIST = 'api/history/list' + HISTORY_LIST = '/api/history/list' } From 1562755e882b610dde0979a92d70561f54f4244c Mon Sep 17 00:00:00 2001 From: Zzm0809 Date: Mon, 26 Feb 2024 07:15:09 +0000 Subject: [PATCH 09/15] Spotless Apply --- dinky-web/src/services/endpoints.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 7e8deb8ac5..54211150ba 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -28,7 +28,7 @@ */ export enum API_CONSTANTS { BASE_URL = '.', - GET_SERVICE_VERSION = '/api/version', + GET_SERVICE_VERSION = '/api/version', // --- user --- // login path From 636c1d37069f79b87a7fecbc7258a687ac6d0769 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 15:15:34 +0800 Subject: [PATCH 10/15] optimize some image addresses as relative paths --- dinky-web/src/requestErrorConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-web/src/requestErrorConfig.ts b/dinky-web/src/requestErrorConfig.ts index 742c41e9b6..3f95cda9fb 100644 --- a/dinky-web/src/requestErrorConfig.ts +++ b/dinky-web/src/requestErrorConfig.ts @@ -75,7 +75,7 @@ const handleBizError = (result: ResponseStructure) => { */ export const errorConfig: RequestConfig = { // 修改为相对请求路径, 避免请求路径出现错误 会自动拼接为完整请求路径 - baseURL: './', + baseURL: API_CONSTANTS.BASE_URL, // 错误处理: umi@3 的错误处理方案。 errorConfig: { // 错误抛出 From 52efe44bbe6c107d0fcc4d4ad2df1985ff95100a Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 15:19:37 +0800 Subject: [PATCH 11/15] optimize some image addresses as relative paths --- dinky-admin/src/main/resources/application-h2.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dinky-admin/src/main/resources/application-h2.yml b/dinky-admin/src/main/resources/application-h2.yml index 5059a516df..955eda1e6f 100644 --- a/dinky-admin/src/main/resources/application-h2.yml +++ b/dinky-admin/src/main/resources/application-h2.yml @@ -27,7 +27,7 @@ spring: h2: console: enabled: true - path: /h2 + path: /api/h2 sql: init: schema-locations: classpath:db/db-h2-ddl.sql From 919c7cf9140fb6e98df1f308bf46b9b2b1732241 Mon Sep 17 00:00:00 2001 From: Zzm0809 Date: Mon, 26 Feb 2024 07:21:51 +0000 Subject: [PATCH 12/15] Spotless Apply --- dinky-web/src/services/endpoints.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 54211150ba..3499051673 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,15 +17,6 @@ * */ -// ------------------ 以下为接口请求路径常量定义 ------------------------------------ -/** - * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用相对请求路径 , 避免以 / 开头的请求路径, 以免影响接口请求 - * - * 在使用时 import { API_CONSTANTS } from '@/services/endpoints'; 然后使用 API_CONSTANTS.GET_SERVICE_VERSION 这样的方式使用 - * - * 在请求时 会使用 定义的 baseUrl 配置 + 定义的接口请求路径, 为最终的请求路径.发送至后端服务端 - * - */ export enum API_CONSTANTS { BASE_URL = '.', GET_SERVICE_VERSION = '/api/version', From 003e5b743e4af2be702f7cc5e7e038f576211cab Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 15:37:00 +0800 Subject: [PATCH 13/15] optimize some image addresses as relative paths --- dinky-web/src/app.tsx | 4 +++- dinky-web/src/requestErrorConfig.ts | 2 -- dinky-web/src/services/endpoints.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dinky-web/src/app.tsx b/dinky-web/src/app.tsx index 58f0d63a8d..f69152d713 100644 --- a/dinky-web/src/app.tsx +++ b/dinky-web/src/app.tsx @@ -183,7 +183,9 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { * @doc https://umijs.org/docs/max/request#配置 */ export const request = { - ...errorConfig + ...errorConfig, + // 修改为相对请求路径, 避免请求路径出现错误 会自动拼接为完整请求路径 + baseURL: API_CONSTANTS.BASE_URL, }; // 这个是redux-persist 的配置 diff --git a/dinky-web/src/requestErrorConfig.ts b/dinky-web/src/requestErrorConfig.ts index 3f95cda9fb..ee3ee7004f 100644 --- a/dinky-web/src/requestErrorConfig.ts +++ b/dinky-web/src/requestErrorConfig.ts @@ -74,8 +74,6 @@ const handleBizError = (result: ResponseStructure) => { * @doc https://umijs.org/docs/max/request#配置 */ export const errorConfig: RequestConfig = { - // 修改为相对请求路径, 避免请求路径出现错误 会自动拼接为完整请求路径 - baseURL: API_CONSTANTS.BASE_URL, // 错误处理: umi@3 的错误处理方案。 errorConfig: { // 错误抛出 diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 54211150ba..1b0dfd3e39 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -19,7 +19,7 @@ // ------------------ 以下为接口请求路径常量定义 ------------------------------------ /** - * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用相对请求路径 , 避免以 / 开头的请求路径, 以免影响接口请求 + * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用 / 开头 * * 在使用时 import { API_CONSTANTS } from '@/services/endpoints'; 然后使用 API_CONSTANTS.GET_SERVICE_VERSION 这样的方式使用 * From 168e71e0812892870c97fed427e8c218fe1cf747 Mon Sep 17 00:00:00 2001 From: Zzm0809 Date: Mon, 26 Feb 2024 07:40:24 +0000 Subject: [PATCH 14/15] Spotless Apply --- dinky-web/src/app.tsx | 2 +- dinky-web/src/services/endpoints.tsx | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/dinky-web/src/app.tsx b/dinky-web/src/app.tsx index f69152d713..8a63de351c 100644 --- a/dinky-web/src/app.tsx +++ b/dinky-web/src/app.tsx @@ -185,7 +185,7 @@ export const layout: RunTimeLayoutConfig = ({ initialState }) => { export const request = { ...errorConfig, // 修改为相对请求路径, 避免请求路径出现错误 会自动拼接为完整请求路径 - baseURL: API_CONSTANTS.BASE_URL, + baseURL: API_CONSTANTS.BASE_URL }; // 这个是redux-persist 的配置 diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 1b0dfd3e39..3499051673 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,15 +17,6 @@ * */ -// ------------------ 以下为接口请求路径常量定义 ------------------------------------ -/** - * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用 / 开头 - * - * 在使用时 import { API_CONSTANTS } from '@/services/endpoints'; 然后使用 API_CONSTANTS.GET_SERVICE_VERSION 这样的方式使用 - * - * 在请求时 会使用 定义的 baseUrl 配置 + 定义的接口请求路径, 为最终的请求路径.发送至后端服务端 - * - */ export enum API_CONSTANTS { BASE_URL = '.', GET_SERVICE_VERSION = '/api/version', From acc44e176db227075cef75da71e35234f6a50372 Mon Sep 17 00:00:00 2001 From: Zzm0809 <934230207@qq.com> Date: Mon, 26 Feb 2024 15:41:07 +0800 Subject: [PATCH 15/15] optimize some image addresses as relative paths --- dinky-web/src/services/endpoints.tsx | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dinky-web/src/services/endpoints.tsx b/dinky-web/src/services/endpoints.tsx index 1b0dfd3e39..3499051673 100644 --- a/dinky-web/src/services/endpoints.tsx +++ b/dinky-web/src/services/endpoints.tsx @@ -17,15 +17,6 @@ * */ -// ------------------ 以下为接口请求路径常量定义 ------------------------------------ -/** - * Note: 定义接口请求路径常量, 用于统一管理接口请求路径, 必须使用 / 开头 - * - * 在使用时 import { API_CONSTANTS } from '@/services/endpoints'; 然后使用 API_CONSTANTS.GET_SERVICE_VERSION 这样的方式使用 - * - * 在请求时 会使用 定义的 baseUrl 配置 + 定义的接口请求路径, 为最终的请求路径.发送至后端服务端 - * - */ export enum API_CONSTANTS { BASE_URL = '.', GET_SERVICE_VERSION = '/api/version',