diff --git a/AppImage/components/hardware.tsx b/AppImage/components/hardware.tsx index ab03297f..f4dfe10e 100644 --- a/AppImage/components/hardware.tsx +++ b/AppImage/components/hardware.tsx @@ -104,18 +104,64 @@ const formatClock = (clockString: string | number): string => { const getDeviceTypeColor = (type: string): string => { const lowerType = type.toLowerCase() + + // UPS / battery — amber: warm orange-yellow, distinct from the orange used + // for Storage and avoids the "warning" connotation of pure yellow. + if (lowerType === "ups" || lowerType.includes("battery")) { + return "bg-amber-500/10 text-amber-500 border-amber-500/20" + } + + // Storage family — orange (Mass Storage USB class + PCI storage controllers) if (lowerType.includes("storage") || lowerType.includes("sata") || lowerType.includes("raid")) { return "bg-orange-500/10 text-orange-500 border-orange-500/20" } + + // Printer — rose, unmistakable + if (lowerType.includes("printer")) { + return "bg-rose-500/10 text-rose-500 border-rose-500/20" + } + + // Audio family — teal (Audio, Audio/Video); placed before video so that + // combined "Audio/Video" class labels read as audio-family. + if (lowerType.includes("audio")) { + return "bg-teal-500/10 text-teal-500 border-teal-500/20" + } + + // Graphics / Video / Imaging — green (cameras, webcams, displays, GPUs). + if ( + lowerType.includes("graphics") || + lowerType.includes("vga") || + lowerType.includes("display") || + lowerType.includes("video") || + lowerType.includes("imaging") + ) { + return "bg-green-500/10 text-green-500 border-green-500/20" + } + + // Network family — blue (Ethernet / Wi-Fi PCI controllers, USB Communications, + // CDC Data, Wireless Controllers like Bluetooth dongles). + if ( + lowerType.includes("network") || + lowerType.includes("ethernet") || + lowerType.includes("communications") || + lowerType.includes("wireless") || + lowerType === "cdc data" + ) { + return "bg-blue-500/10 text-blue-500 border-blue-500/20" + } + + // HID — purple: keyboards, mice, game controllers. + if (lowerType === "hid") { + return "bg-purple-500/10 text-purple-500 border-purple-500/20" + } + + // USB host controllers (PCI-level) keep the existing purple identity. if (lowerType.includes("usb")) { return "bg-purple-500/10 text-purple-500 border-purple-500/20" } - if (lowerType.includes("network") || lowerType.includes("ethernet")) { - return "bg-blue-500/10 text-blue-500 border-blue-500/20" - } - if (lowerType.includes("graphics") || lowerType.includes("vga") || lowerType.includes("display")) { - return "bg-green-500/10 text-green-500 border-green-500/20" - } + + // Smart Card, Billboard, Diagnostic, Hub, Physical, Content Security, + // Personal Healthcare, Miscellaneous, Application/Vendor Specific, unknown. return "bg-gray-500/10 text-gray-500 border-gray-500/20" } @@ -1511,9 +1557,67 @@ return ( -
- Note: Coral TPUs do not expose temperature, utilization or power telemetry through standard interfaces. Monitoring is limited to device presence and driver state. -
+ {typeof selectedCoral.temperature === "number" && (() => { + const trips = selectedCoral.temperature_trips + // Dynamic thresholds when the driver exposes trip points. + // Otherwise fall back to conservative hardcoded limits. + // trips are reported warn→critical, so [N-1] is critical (red) + // and [N-2] is the throttle/warn level (amber). + const redAt = trips && trips.length >= 1 ? trips[trips.length - 1] : 85 + const amberAt = + trips && trips.length >= 2 + ? trips[trips.length - 2] + : trips && trips.length === 1 + ? redAt - 10 + : 75 + const color = + selectedCoral.temperature >= redAt + ? "text-red-500" + : selectedCoral.temperature >= amberAt + ? "text-amber-500" + : "text-green-500" + return ( +
+ Temperature +
+ + {selectedCoral.temperature.toFixed(1)} °C + + {trips && trips.length > 0 && ( +
+ Thresholds: {trips.map((t) => `${t.toFixed(0)}°C`).join(" · ")} +
+ )} +
+
+ ) + })()} + + {selectedCoral.thermal_warnings && selectedCoral.thermal_warnings.length > 0 && ( +
+ Hardware Warnings +
+ {selectedCoral.thermal_warnings.map((w) => ( +
+ + {w.name} + {typeof w.threshold_c === "number" && ` @ ${w.threshold_c.toFixed(0)}°C`} + + + {w.enabled ? "enabled" : "disabled"} + +
+ ))} +
+
+ )} {!selectedCoral.drivers_ready && (