From 7339f451935d5c41cb9de7a172e00be1d85ef3de Mon Sep 17 00:00:00 2001 From: TsMask <340112800@qq.com> Date: Wed, 6 Mar 2024 16:04:44 +0800 Subject: [PATCH] =?UTF-8?q?style:=20=E7=BC=93=E5=AD=98=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=87=E9=A2=98=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/locales/en-US.ts | 1 + src/i18n/locales/zh-CN.ts | 1 + src/views/monitor/cache/info.vue | 17 +++++++++++++---- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/i18n/locales/en-US.ts b/src/i18n/locales/en-US.ts index c0821f7c..6619fcbd 100644 --- a/src/i18n/locales/en-US.ts +++ b/src/i18n/locales/en-US.ts @@ -1186,6 +1186,7 @@ export default { keyContent: "Cached content", }, cacheInfo: { + baseInfo: "Basic Info", version: "Service Versions", mode: "Perating Mode", modeStandalone: "stand-alone", diff --git a/src/i18n/locales/zh-CN.ts b/src/i18n/locales/zh-CN.ts index 921e5b91..1921b3fc 100644 --- a/src/i18n/locales/zh-CN.ts +++ b/src/i18n/locales/zh-CN.ts @@ -1186,6 +1186,7 @@ export default { keyContent: "缓存内容", }, cacheInfo: { + baseInfo: "基本信息", version: "服务版本", mode: "运行模式", modeStandalone: "单机", diff --git a/src/views/monitor/cache/info.vue b/src/views/monitor/cache/info.vue index cde68888..d51bd284 100644 --- a/src/views/monitor/cache/info.vue +++ b/src/views/monitor/cache/info.vue @@ -126,9 +126,15 @@ function commandStatsChart() { ], }; commandStatsEchart.setOption(option); - window.addEventListener('resize', function () { - commandStatsEchart.resize(); + + // 创建 ResizeObserver 实例 + var observer = new ResizeObserver(entries => { + if (commandStatsEchart) { + commandStatsEchart.resize(); + } }); + // 监听元素大小变化 + observer.observe(commandStatsDom); } onMounted(() => { @@ -152,7 +158,7 @@ onMounted(() => {