fix: make system health temp optional (#2247)
This commit is contained in:
@@ -12,7 +12,7 @@ export interface HealthMonitoring {
|
|||||||
};
|
};
|
||||||
rebootRequired: boolean;
|
rebootRequired: boolean;
|
||||||
availablePkgUpdates: number;
|
availablePkgUpdates: number;
|
||||||
cpuTemp: number;
|
cpuTemp: number | undefined;
|
||||||
fileSystem: {
|
fileSystem: {
|
||||||
deviceName: string;
|
deviceName: string;
|
||||||
used: string;
|
used: string;
|
||||||
|
|||||||
@@ -63,9 +63,6 @@ export class OpenMediaVaultIntegration extends Integration {
|
|||||||
if (!smartResult.success) {
|
if (!smartResult.success) {
|
||||||
throw new Error("Invalid SMART information response");
|
throw new Error("Invalid SMART information response");
|
||||||
}
|
}
|
||||||
if (!cpuTempResult.success) {
|
|
||||||
throw new Error("Invalid CPU temperature response");
|
|
||||||
}
|
|
||||||
|
|
||||||
const fileSystem = fileSystemResult.data.response.map((fileSystem) => ({
|
const fileSystem = fileSystemResult.data.response.map((fileSystem) => ({
|
||||||
deviceName: fileSystem.devicename,
|
deviceName: fileSystem.devicename,
|
||||||
@@ -94,7 +91,7 @@ export class OpenMediaVaultIntegration extends Integration {
|
|||||||
},
|
},
|
||||||
rebootRequired: systemResult.data.response.rebootRequired,
|
rebootRequired: systemResult.data.response.rebootRequired,
|
||||||
availablePkgUpdates: systemResult.data.response.availablePkgUpdates,
|
availablePkgUpdates: systemResult.data.response.availablePkgUpdates,
|
||||||
cpuTemp: cpuTempResult.data.response.cputemp,
|
cpuTemp: cpuTempResult.success ? cpuTempResult.data.response.cputemp : undefined,
|
||||||
fileSystem,
|
fileSystem,
|
||||||
smart,
|
smart,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -347,9 +347,14 @@ const CpuRing = ({ cpuUtilization }: { cpuUtilization: number }) => {
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
const CpuTempRing = ({ fahrenheit, cpuTemp }: { fahrenheit: boolean; cpuTemp: number }) => {
|
const CpuTempRing = ({ fahrenheit, cpuTemp }: { fahrenheit: boolean; cpuTemp: number | undefined }) => {
|
||||||
const { width, ref } = useElementSize();
|
const { width, ref } = useElementSize();
|
||||||
const fallbackWidth = width || 1; // See https://github.com/homarr-labs/homarr/issues/2196
|
const fallbackWidth = width || 1; // See https://github.com/homarr-labs/homarr/issues/2196
|
||||||
|
|
||||||
|
if (!cpuTemp) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box ref={ref} w="100%" h="100%" className="health-monitoring-cpu-temperature">
|
<Box ref={ref} w="100%" h="100%" className="health-monitoring-cpu-temperature">
|
||||||
<RingProgress
|
<RingProgress
|
||||||
|
|||||||
Reference in New Issue
Block a user