diff --git a/src/components/admin/devices/admin-devices-overview.tsx b/src/components/admin/devices/admin-devices-overview.tsx index 3b0edc4..57c858f 100644 --- a/src/components/admin/devices/admin-devices-overview.tsx +++ b/src/components/admin/devices/admin-devices-overview.tsx @@ -271,6 +271,64 @@ type WindowsDiskEntry = { MediaType?: string } +type WindowsBattery = { + Name?: string + DeviceID?: string + Status?: string + BatteryStatus?: number + BatteryStatusText?: string + EstimatedChargeRemaining?: number + EstimatedRunTime?: number + DesignCapacity?: number + FullChargeCapacity?: number + DesignVoltage?: number + Chemistry?: number + BatteryRechargeTime?: number +} + +type WindowsBatteryInfo = { + Present: boolean + Batteries: WindowsBattery[] +} + +type WindowsThermalSensor = { + Source?: string + Name?: string + TemperatureCelsius?: number + CriticalTripPoint?: number + Parent?: string +} + +type WindowsNetworkAdapter = { + Name?: string + Description?: string + MACAddress?: string + Speed?: number + NetConnectionStatus?: number + StatusText?: string + AdapterType?: string + Manufacturer?: string + NetConnectionID?: string + PNPDeviceID?: string +} + +type WindowsMonitor = { + ManufacturerName?: string + ProductCodeID?: string + SerialNumberID?: string + UserFriendlyName?: string + YearOfManufacture?: number + WeekOfManufacture?: number +} + +type WindowsChassis = { + ChassisTypes?: number[] + ChassisTypesText?: string[] + Manufacturer?: string + SerialNumber?: string + SMBIOSAssetTag?: string +} + type WindowsExtended = { software?: DeviceSoftware[] services?: Array<{ name?: string; status?: string; displayName?: string }> @@ -292,6 +350,11 @@ type WindowsExtended = { windowsUpdate?: Record computerSystem?: Record azureAdStatus?: Record + battery?: WindowsBatteryInfo + thermal?: WindowsThermalSensor[] + networkAdapters?: WindowsNetworkAdapter[] + monitors?: WindowsMonitor[] + chassis?: WindowsChassis } type MacExtended = { @@ -3015,6 +3078,21 @@ export function DeviceDetails({ device }: DeviceDetailsProps) { return a.id.localeCompare(b.id) }) }, [windowsExt?.hotfix]) + // Novos dados do agente: bateria, sensores termicos, adaptadores de rede, monitores, chassis + const windowsBatteryInfo = windowsExt?.battery ?? null + const windowsThermalSensors = useMemo(() => { + if (Array.isArray(windowsExt?.thermal)) return windowsExt.thermal + return [] + }, [windowsExt?.thermal]) + const windowsNetworkAdapters = useMemo(() => { + if (Array.isArray(windowsExt?.networkAdapters)) return windowsExt.networkAdapters + return [] + }, [windowsExt?.networkAdapters]) + const windowsMonitors = useMemo(() => { + if (Array.isArray(windowsExt?.monitors)) return windowsExt.monitors + return [] + }, [windowsExt?.monitors]) + const windowsChassisInfo = windowsExt?.chassis ?? null const osNameDisplay = useMemo(() => { const base = device?.osName?.trim() const edition = windowsEditionLabel?.trim() @@ -5506,6 +5584,143 @@ export function DeviceDetails({ device }: DeviceDetailsProps) { ) : null} + {/* Bateria */} + {windowsBatteryInfo?.Present && windowsBatteryInfo.Batteries.length > 0 ? ( +
+

Bateria

+
+ {windowsBatteryInfo.Batteries.map((battery, idx) => ( +
+ + + {battery.EstimatedChargeRemaining != null && ( + + )} + {battery.EstimatedRunTime != null && battery.EstimatedRunTime > 0 && battery.EstimatedRunTime < 71582788 && ( + + )} + {battery.DesignCapacity != null && battery.DesignCapacity > 0 && ( + + )} + {battery.FullChargeCapacity != null && battery.FullChargeCapacity > 0 && ( + + )} +
+ ))} +
+
+ ) : null} + + {/* Sensores térmicos */} + {windowsThermalSensors.length > 0 ? ( +
+

Sensores térmicos

+
+ + + + Sensor + Temperatura + Crítico + Fonte + + + + {windowsThermalSensors.map((sensor, idx) => ( + + {sensor.Name ?? sensor.Parent ?? "Sensor"} + + {sensor.TemperatureCelsius != null ? `${sensor.TemperatureCelsius}°C` : "—"} + + + {sensor.CriticalTripPoint != null ? `${sensor.CriticalTripPoint}°C` : "—"} + + {sensor.Source ?? "—"} + + ))} + +
+
+
+ ) : null} + + {/* Adaptadores de rede */} + {windowsNetworkAdapters.length > 0 ? ( +
+

Adaptadores de rede

+
+ + + + Nome + MAC + Velocidade + Status + + + + {windowsNetworkAdapters.slice(0, 10).map((adapter, idx) => ( + + {adapter.NetConnectionID ?? adapter.Name ?? "—"} + {adapter.MACAddress ?? "—"} + + {adapter.Speed != null && adapter.Speed > 0 + ? adapter.Speed >= 1000000000 + ? `${(adapter.Speed / 1000000000).toFixed(1)} Gbps` + : `${(adapter.Speed / 1000000).toFixed(0)} Mbps` + : "—"} + + {adapter.StatusText ?? "—"} + + ))} + +
+
+
+ ) : null} + + {/* Monitores */} + {windowsMonitors.length > 0 ? ( +
+

Monitores

+
    + {windowsMonitors.map((monitor, idx) => ( +
  • + + {monitor.UserFriendlyName ?? monitor.ManufacturerName ?? "Monitor"} + +
    + {monitor.ManufacturerName && Fabricante: {monitor.ManufacturerName}} + {monitor.SerialNumberID && · Serial: {monitor.SerialNumberID}} + {monitor.YearOfManufacture && · Ano: {monitor.YearOfManufacture}} +
    +
  • + ))} +
+
+ ) : null} + + {/* Chassis / Gabinete */} + {windowsChassisInfo ? ( +
+

Gabinete / Chassis

+
+ + + + {windowsChassisInfo.SMBIOSAssetTag && windowsChassisInfo.SMBIOSAssetTag !== "Default string" && ( + + )} +
+
+ ) : null} + ) : null}