Skip to content

Commit

Permalink
add cpu, memory and file system switch to settings
Browse files Browse the repository at this point in the history
  • Loading branch information
hillaliy authored and manuel-rw committed Feb 25, 2024
1 parent c04de17 commit 29078be
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 10 deletions.
9 changes: 9 additions & 0 deletions public/locales/en/modules/health-monitoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
"fahrenheit": {
"label": "Fahrenheit"
},
"cpu": {
"label": "CPU"
},
"memory": {
"label": "Memory"
},
"fileSystem": {
"label": "File System"
},
}
},
"info": {
Expand Down
44 changes: 34 additions & 10 deletions src/widgets/health-monitoring/HealthMonitoringTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ const definition = defineWidget({
type: 'switch',
defaultValue: false,
},
cpu: {
type: 'switch',
defaultValue: true,
},
memory: {
type: 'switch',
defaultValue: true,
},
fileSystem: {
type: 'switch',
defaultValue: true,
},
},
gridstack: {
minWidth: 1,
Expand Down Expand Up @@ -110,16 +122,28 @@ function HealthMonitoringWidgetTile({ widget }: HealthMonitoringWidgetProps) {
</Group>
</Group>
</Card>
<Divider my="sm" />
<HealthMonitoringMemory info={data.systemInfo} />
<Divider my="sm" />
<HealthMonitoringCpu
info={data.systemInfo}
cpuTemp={data.cpuTemp}
fahrenheit={widget?.properties.fahrenheit}
/>
<Divider my="sm" />
<HealthMonitoringFileSystem fileSystem={data.fileSystem} />
{widget?.properties.memory && (
<>
<Divider my="sm" />
<HealthMonitoringMemory info={data.systemInfo} />
</>
)}
{widget?.properties.cpu && (
<>
<Divider my="sm" />
<HealthMonitoringCpu
info={data.systemInfo}
cpuTemp={data.cpuTemp}
fahrenheit={widget?.properties.fahrenheit}
/>
</>
)}
{widget?.properties.fileSystem && (
<>
<Divider my="sm" />
<HealthMonitoringFileSystem fileSystem={data.fileSystem} />
</>
)}
</ScrollArea>
</Flex>
);
Expand Down

0 comments on commit 29078be

Please sign in to comment.