v0.171.0: disk-health card device-model label (pairs with agent v0.95.0)
agentapi.SmartSummary.ModelName mirrors the agent's model_name; the card row label prefers the device model over the raw name/UUID, falling back to Name(+hint) on an old agent. Additive. Test + red-proof (drop fallback -> A4 fails).
This commit is contained in:
@@ -75,6 +75,11 @@ func isPhysicalDisk(d agentapi.DiskInfo) bool {
|
||||
|
||||
// diskDisplayLabel is the customer-facing disk label (PVE name + a Hungarian speed hint when known).
|
||||
func diskDisplayLabel(d agentapi.DiskInfo) string {
|
||||
// Prefer the device model (agent v0.95.0) over the raw storage name/UUID — a customer reads
|
||||
// "TOSHIBA MQ04ABF100", not "47a3361a-…". Falls back to Name (+ speed hint) on an older agent.
|
||||
if d.Smart != nil && d.Smart.ModelName != nil && *d.Smart.ModelName != "" {
|
||||
return *d.Smart.ModelName
|
||||
}
|
||||
switch d.Class {
|
||||
case "fast":
|
||||
return d.Name + " (gyors)"
|
||||
|
||||
Reference in New Issue
Block a user