SMART: add eMMC health via sysfs (#1736)

* SMART: add eMMC health via sysfs

Read eMMC wear/EOL indicators from /sys/class/block/mmcblk*/device and expose in SMART device list. Includes mocked sysfs tests and UI tweaks for unknown temps.

* small optimizations for emmc scan and parsing

* smart: keep smartctl optional only for Linux hosts with eMMC

* update smart alerts to handle warning state

* refactor: rename binPath to smartctlPath and replace hasSmartctl with smartctlPath checks

---------

Co-authored-by: henrygd <hank@henrygd.me>
This commit is contained in:
VACInc
2026-02-12 15:27:42 -05:00
committed by GitHub
parent 2230097dc7
commit e816ea143a
11 changed files with 661 additions and 27 deletions

View File

@@ -206,7 +206,12 @@ export const columns: ColumnDef<SmartDeviceRecord>[] = [
invertSorting: true,
header: ({ column }) => <HeaderButton column={column} name={t`Temp`} Icon={ThermometerIcon} />,
cell: ({ getValue }) => {
const { value, unit } = formatTemperature(getValue() as number)
const temp = getValue() as number | undefined | null
// Most devices won't report a real 0C temperature; treat 0 as "unknown".
if (temp == null || temp === 0) {
return <div className="text-muted-foreground ms-1.5">N/A</div>
}
const { value, unit } = formatTemperature(temp)
return <span className="ms-1.5">{`${value} ${unit}`}</span>
},
},