From 1925a1cd31704fa47faebb831bb7abd012e23b69 Mon Sep 17 00:00:00 2001 From: hi2hi Date: Fri, 28 Mar 2025 17:23:55 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=9B=B4=E6=96=B0=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E9=85=8D=E7=BD=AE=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BC=A0=E6=84=9F=E5=99=A8=E5=92=8C=E6=A0=B8=E5=BF=83=E7=9A=84?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=A1=B9=EF=BC=9B=E4=BC=98=E5=8C=96=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E4=BF=A1=E6=81=AF=E6=A1=86=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=B8=A9=E5=BA=A6=E6=95=B0=E6=8D=AE=E5=B1=95=E7=A4=BA=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E6=94=AF=E6=8C=81acpitz=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E7=9A=84=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/i18n/en.js | 2 ++ src/config/i18n/zh-cn.js | 2 ++ .../server-detail/server-info-box.vue | 19 +++++++++++++------ 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/src/config/i18n/en.js b/src/config/i18n/en.js index d36cdd0..bb56116 100644 --- a/src/config/i18n/en.js +++ b/src/config/i18n/en.js @@ -73,6 +73,8 @@ export default { coretempPackage: 'CPU Temp', coretempCore: 'Core Average', coretempMaxCore: 'Hottest Core', + sensor: 'Sensor', + core: 'Core', // System Status systemOS: 'Sys', diff --git a/src/config/i18n/zh-cn.js b/src/config/i18n/zh-cn.js index dccb8a0..0f59744 100644 --- a/src/config/i18n/zh-cn.js +++ b/src/config/i18n/zh-cn.js @@ -72,6 +72,8 @@ export default { coretempPackage: 'CPU温度', coretempCore: '核心平均', coretempMaxCore: '最热核心', + sensor: '传感器', + core: '核心', // 系统状态 systemOS: '系统', diff --git a/src/views/components/server-detail/server-info-box.vue b/src/views/components/server-detail/server-info-box.vue index 64fcb1b..f410282 100644 --- a/src/views/components/server-detail/server-info-box.vue +++ b/src/views/components/server-detail/server-info-box.vue @@ -92,7 +92,7 @@ class="ri-hard-drive-3-line" /> { }); return; } - if (name.includes('motherboard') || name.includes('mainboard') || name.includes('board')) { + if ( + name.includes('motherboard') + || name.includes('mainboard') + || name.includes('board') + || name.includes('acpitz') + ) { other.push({ - label: '主板', + label: i18n.t('acpitz'), value: temp, - type: 'motherboard', + type: 'acpitz', }); return; } @@ -422,7 +427,7 @@ const temperatureData = computed(() => { data.push({ label: i18n.t('acpitz'), value: `${acpitzMean}℃`, - title: acpitz.map((i, index) => `传感器${index + 1}: ${parseFloat(i).toFixed(1)}℃`).join('\n'), + title: acpitz.map((i, index) => `${i18n.t('sensor')}${index + 1}: ${parseFloat(i).toFixed(1)}℃`).join('\n'), type: 'acpitz', }); } @@ -443,7 +448,9 @@ const temperatureData = computed(() => { if (coretemp_core.length) { const coreMean = (coretemp_core.reduce((a, b) => a + b.value, 0) / coretemp_core.length).toFixed(1); temps.push(`${parseFloat(coreMean).toFixed(1)}℃`); - details.push(...coretemp_core.map((i) => `核心${i.index + 1}: ${parseFloat(i.value).toFixed(1)}℃`)); + details.push( + ...coretemp_core.map((i) => `${i18n.t('core')}${i.index + 1}: ${parseFloat(i.value).toFixed(1)}℃`), + ); } data.push({