Skip to content

Commit

Permalink
Fix all
Browse files Browse the repository at this point in the history
  • Loading branch information
hillaliy committed Feb 27, 2024
1 parent 1a5efb4 commit c9a2397
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 35 deletions.
29 changes: 15 additions & 14 deletions public/locales/en/modules/health-monitoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
11 changes: 2 additions & 9 deletions src/widgets/health-monitoring/HealthMonitoringCpu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const HealthMonitoringCpu = ({ info, cpuTemp, fahrenheit }: any) => {
</HoverCard.Target>
<HoverCard.Dropdown>
<Text fz="lg" tt="uppercase" fw={700} c="dimmed" align="center">
{t('info.load')}
{t('cpu.load')}
</Text>
<Flex
direction={{ base: 'column', sm: 'row' }}
Expand Down Expand Up @@ -100,14 +100,7 @@ const HealthMonitoringCpu = ({ info, cpuTemp, fahrenheit }: any) => {
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',
},
]}
/>
Expand Down
6 changes: 4 additions & 2 deletions src/widgets/health-monitoring/HealthMonitoringFileSystem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ const HealthMonitoringFileSystem = ({ fileSystem }: any) => {
</HoverCard.Target>
<HoverCard.Dropdown>
<Text fz="lg" tt="uppercase" fw={700} c="dimmed" align="center">
{t('info.available')}: {humanFileSize(disk.available)} -{' '}
{100 - disk.percentage}%
{t('fileSystem.available', {
available: humanFileSize(disk.available),
percentage: 100 - disk.percentage,
})}
</Text>
</HoverCard.Dropdown>
</HoverCard>
Expand Down
13 changes: 3 additions & 10 deletions src/widgets/health-monitoring/HealthMonitoringMemory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ const HealthMonitoringMemory = ({ info }: any) => {
</HoverCard.Target>
<HoverCard.Dropdown>
<Text fz="lg" tt="uppercase" fw={700} c="dimmed" align="center">
{t('info.totalMem')}: {totalMemoryGB}GB
{t('memory.totalMem', { total: totalMemoryGB })}
</Text>
<Text fz="lg" fw={500} align="center">
{t('info.available')}: {freeMemoryGB}GB - {percentageFree}%
{t('memory.available', { available: freeMemoryGB, percentage: percentageFree })}
</Text>
</HoverCard.Dropdown>
</HoverCard>
Expand All @@ -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',
},
]}
/>
Expand Down

0 comments on commit c9a2397

Please sign in to comment.