From c9a2397789a9e00ef2ebddb0906e6207fb8bae56 Mon Sep 17 00:00:00 2001 From: hillaliy Date: Tue, 27 Feb 2024 06:14:07 +0200 Subject: [PATCH] Fix all --- .../locales/en/modules/health-monitoring.json | 29 ++++++++++--------- .../health-monitoring/HealthMonitoringCpu.tsx | 11 ++----- .../HealthMonitoringFileSystem.tsx | 6 ++-- .../HealthMonitoringMemory.tsx | 13 ++------- 4 files changed, 24 insertions(+), 35 deletions(-) diff --git a/public/locales/en/modules/health-monitoring.json b/public/locales/en/modules/health-monitoring.json index 284c721be35..3689284147d 100644 --- a/public/locales/en/modules/health-monitoring.json +++ b/public/locales/en/modules/health-monitoring.json @@ -6,25 +6,26 @@ "title": "System Health Monitoring", "fahrenheit": { "label": "Fahrenheit" - }, - "cpu": { - "label": "CPU" - }, - "memory": { - "label": "Memory" - }, - "fileSystem": { - "label": "File System" - }, } + } + }, + "cpu": { + "label": "CPU", + "load": "Load Avg" + }, + "memory": { + "label": "Memory", + "totalMem": "Total memory: {{total}}GB", + "available": "Available: {{available}}GB - {{percentage}}%" + }, + "fileSystem": { + "label": "File System", + "available": "Available: {{available}} - {{percentage}}%" }, "info": { "uptime": "Uptime", "updates": "Updates", - "reboot": "Reboot", - "load": "Load Avg", - "totalMem": "Total memory", - "available": "Available", + "reboot": "Reboot" }, "errors": { "general": { diff --git a/src/widgets/health-monitoring/HealthMonitoringCpu.tsx b/src/widgets/health-monitoring/HealthMonitoringCpu.tsx index affb8149b4e..757627743c5 100644 --- a/src/widgets/health-monitoring/HealthMonitoringCpu.tsx +++ b/src/widgets/health-monitoring/HealthMonitoringCpu.tsx @@ -51,7 +51,7 @@ const HealthMonitoringCpu = ({ info, cpuTemp, fahrenheit }: any) => { - {t('info.load')} + {t('cpu.load')} { sections={[ { value: cpuTemp.cputemp, - color: - cpuTemp.cputemp < 35 - ? 'green' - : cpuTemp.cputemp > 35 && cpuTemp.cputemp < 60 - ? 'yellow' - : cpuTemp.cputemp > 60 && cpuTemp.cputemp < 70 - ? 'orange' - : 'red', + color: cpuTemp.cputemp < 60 ? 'green' : 'red', }, ]} /> diff --git a/src/widgets/health-monitoring/HealthMonitoringFileSystem.tsx b/src/widgets/health-monitoring/HealthMonitoringFileSystem.tsx index ac7b0b56263..d6e62cc7345 100644 --- a/src/widgets/health-monitoring/HealthMonitoringFileSystem.tsx +++ b/src/widgets/health-monitoring/HealthMonitoringFileSystem.tsx @@ -34,8 +34,10 @@ const HealthMonitoringFileSystem = ({ fileSystem }: any) => { - {t('info.available')}: {humanFileSize(disk.available)} -{' '} - {100 - disk.percentage}% + {t('fileSystem.available', { + available: humanFileSize(disk.available), + percentage: 100 - disk.percentage, + })} diff --git a/src/widgets/health-monitoring/HealthMonitoringMemory.tsx b/src/widgets/health-monitoring/HealthMonitoringMemory.tsx index 9739fabfef9..ee506d2b88b 100644 --- a/src/widgets/health-monitoring/HealthMonitoringMemory.tsx +++ b/src/widgets/health-monitoring/HealthMonitoringMemory.tsx @@ -25,10 +25,10 @@ const HealthMonitoringMemory = ({ info }: any) => { - {t('info.totalMem')}: {totalMemoryGB}GB + {t('memory.totalMem', { total: totalMemoryGB })} - {t('info.available')}: {freeMemoryGB}GB - {percentageFree}% + {t('memory.available', { available: freeMemoryGB, percentage: percentageFree })} @@ -37,14 +37,7 @@ const HealthMonitoringMemory = ({ info }: any) => { sections={[ { value: percentageUsed, - color: - percentageUsed < 10 - ? 'green' - : percentageUsed > 10 && percentageUsed < 70 - ? 'yellow' - : percentageUsed > 70 && percentageUsed < 90 - ? 'orange' - : 'red', + color: percentageUsed < 70 ? 'green' : 'red', }, ]} />