Hide health status on RAID virtual disks in host drives section

This commit is contained in:
2026-03-07 05:36:55 +00:00
parent 1dd40a1181
commit 8ea8fdef08

View File

@@ -596,22 +596,24 @@ const driveTypeBadge = (type, t) => {
};
function HostDriveRow({ d, onSelect, t, indent }) {
const isRaid = d.drive_type === "raid";
const healthStatus = d.health_status || "healthy";
const c = t.health[healthStatus] || t.health.healthy;
const c = isRaid ? t.health.empty : (t.health[healthStatus] || t.health.healthy);
return (
<button
onClick={() => onSelect({ slot: d.megaraid_id || "-", device: d.device, populated: true, drive: d })}
onClick={isRaid ? undefined : () => onSelect({ slot: d.megaraid_id || "-", device: d.device, populated: true, drive: d })}
style={{
display: "flex", alignItems: "center", gap: 16,
padding: indent ? "10px 16px 10px 44px" : "12px 16px", borderRadius: 12,
background: c.bg, border: `1px solid ${c.border}`,
cursor: "pointer", width: "100%", textAlign: "left",
background: isRaid ? t.health.empty.bg : c.bg,
border: `1px solid ${isRaid ? t.cardBorder : c.border}`,
cursor: isRaid ? "default" : "pointer", width: "100%", textAlign: "left",
transition: "all 0.18s",
}}
onMouseEnter={(e) => { e.currentTarget.style.transform = "scale(1.01)"; e.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)"; }}
onMouseLeave={(e) => { e.currentTarget.style.transform = "scale(1)"; e.currentTarget.style.boxShadow = "none"; }}
onMouseEnter={(e) => { if (!isRaid) { e.currentTarget.style.transform = "scale(1.01)"; e.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)"; } }}
onMouseLeave={(e) => { if (!isRaid) { e.currentTarget.style.transform = "scale(1)"; e.currentTarget.style.boxShadow = "none"; } }}
>
<span style={{ width: 9, height: 9, borderRadius: "50%", background: c.dot, flexShrink: 0 }} />
{!isRaid && <span style={{ width: 9, height: 9, borderRadius: "50%", background: c.dot, flexShrink: 0 }} />}
<span style={{
fontSize: indent ? 13 : 14, fontWeight: 700, color: t.text,
fontFamily: "'JetBrains Mono', monospace", minWidth: 80,
@@ -652,7 +654,7 @@ function HostDriveRow({ d, onSelect, t, indent }) {
{d.zfs_pool}
</span>
)}
<StatusPill status={healthStatus} t={t} />
{d.drive_type !== "raid" && <StatusPill status={healthStatus} t={t} />}
</button>
);
}