From 7980fc4a5fe58482b59810f967299386c9bf7a40 Mon Sep 17 00:00:00 2001 From: yaojiping Date: Tue, 10 Dec 2024 10:01:05 +0800 Subject: [PATCH 1/2] fix: lose data after changed filters in `Overview` --- web/config/router.config.js | 14 +++++++------- web/src/components/Licence/index.js | 2 +- web/src/components/Overview/index.tsx | 1 + web/src/pages/Platform/Overview/index.js | 18 +++++++++--------- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/web/config/router.config.js b/web/config/router.config.js index ecb03802..f9b58490 100644 --- a/web/config/router.config.js +++ b/web/config/router.config.js @@ -57,12 +57,12 @@ export default [ component: "./Platform/Overview/Cluster/Monitor/index", hideInMenu: true, }, - { - path: "/cluster/monitor/hosts/:host_id", - name: "monitoring_overview_hosts", - component: "./Platform/Overview/Host/Monitor/index", - hideInMenu: true, - }, + // { + // path: "/cluster/monitor/hosts/:host_id", + // name: "monitoring_overview_hosts", + // component: "./Platform/Overview/Host/Monitor/index", + // hideInMenu: true, + // }, { path: "/cluster/monitor/:cluster_id/nodes/:node_id", name: "monitoring_overview_nodes", @@ -456,7 +456,7 @@ export default [ }, { path: "/system/audit", - name: "audit", + name: "audit_logs", component: "./System/Audit/index", authority: ["system.audit_logs:all", "system.audit_logs:read"], }, diff --git a/web/src/components/Licence/index.js b/web/src/components/Licence/index.js index c8ffae11..a2f9066d 100644 --- a/web/src/components/Licence/index.js +++ b/web/src/components/Licence/index.js @@ -45,7 +45,7 @@ export default forwardRef((props, ref) => { const onClose = () => { setVisible(); - if (tabRef.current.resetCode) tabRef.current.resetCode(); + if (tabRef.current?.resetCode) tabRef.current.resetCode(); }; return ( diff --git a/web/src/components/Overview/index.tsx b/web/src/components/Overview/index.tsx index b553ec6c..1becc9c3 100644 --- a/web/src/components/Overview/index.tsx +++ b/web/src/components/Overview/index.tsx @@ -212,6 +212,7 @@ export default forwardRef((props: IProps, ref: any) => { filters, }); } + dispatch({ type: "pagination", value: 1 }) }; useEffect(() => { diff --git a/web/src/pages/Platform/Overview/index.js b/web/src/pages/Platform/Overview/index.js index c8df74f2..bbe810cc 100644 --- a/web/src/pages/Platform/Overview/index.js +++ b/web/src/pages/Platform/Overview/index.js @@ -46,15 +46,15 @@ const panes = [ return ; }, }, - { - title: "Hosts", - component: Host, - key: "hosts", - count: 0, - icon: () => { - return ; - }, - }, + // { + // title: "Hosts", + // component: Host, + // key: "hosts", + // count: 0, + // icon: () => { + // return ; + // }, + // }, ]; const NewOverview = (props) => { From ade58f23efb34474de2cc4fa381f5ecaf82412b7 Mon Sep 17 00:00:00 2001 From: yaojiping Date: Tue, 10 Dec 2024 10:03:04 +0800 Subject: [PATCH 2/2] chore: add locales for `Audit` --- web/src/locales/en-US.js | 2 +- web/src/locales/zh-CN.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/locales/en-US.js b/web/src/locales/en-US.js index 2869de7e..7f72a61a 100644 --- a/web/src/locales/en-US.js +++ b/web/src/locales/en-US.js @@ -254,7 +254,7 @@ export default { "menu.system.security.users": "USERS", "menu.system.security.certs": "CERTS", - "menu.system.audit": "AUDIT", + "menu.system.audit_logs": "AUDIT", "menu.system.logs": "LOGS", "menu.system.logs.overview": "OVERVIEW", diff --git a/web/src/locales/zh-CN.js b/web/src/locales/zh-CN.js index a8a93a3f..1414a2ce 100644 --- a/web/src/locales/zh-CN.js +++ b/web/src/locales/zh-CN.js @@ -259,7 +259,7 @@ export default { "menu.system.security.users": "用户管理", "menu.system.security.certs": "证书管理", - "menu.system.audit": "审计日志", + "menu.system.audit_logs": "审计日志", "menu.system.logs": "系统日志", "menu.system.logs.overview": "日志概要",