Hide health status on RAID virtual disks in host drives section
This commit is contained in:
@@ -596,22 +596,24 @@ const driveTypeBadge = (type, t) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function HostDriveRow({ d, onSelect, t, indent }) {
|
function HostDriveRow({ d, onSelect, t, indent }) {
|
||||||
|
const isRaid = d.drive_type === "raid";
|
||||||
const healthStatus = d.health_status || "healthy";
|
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 (
|
return (
|
||||||
<button
|
<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={{
|
style={{
|
||||||
display: "flex", alignItems: "center", gap: 16,
|
display: "flex", alignItems: "center", gap: 16,
|
||||||
padding: indent ? "10px 16px 10px 44px" : "12px 16px", borderRadius: 12,
|
padding: indent ? "10px 16px 10px 44px" : "12px 16px", borderRadius: 12,
|
||||||
background: c.bg, border: `1px solid ${c.border}`,
|
background: isRaid ? t.health.empty.bg : c.bg,
|
||||||
cursor: "pointer", width: "100%", textAlign: "left",
|
border: `1px solid ${isRaid ? t.cardBorder : c.border}`,
|
||||||
|
cursor: isRaid ? "default" : "pointer", width: "100%", textAlign: "left",
|
||||||
transition: "all 0.18s",
|
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)"; }}
|
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) => { e.currentTarget.style.transform = "scale(1)"; e.currentTarget.style.boxShadow = "none"; }}
|
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={{
|
<span style={{
|
||||||
fontSize: indent ? 13 : 14, fontWeight: 700, color: t.text,
|
fontSize: indent ? 13 : 14, fontWeight: 700, color: t.text,
|
||||||
fontFamily: "'JetBrains Mono', monospace", minWidth: 80,
|
fontFamily: "'JetBrains Mono', monospace", minWidth: 80,
|
||||||
@@ -652,7 +654,7 @@ function HostDriveRow({ d, onSelect, t, indent }) {
|
|||||||
{d.zfs_pool}
|
{d.zfs_pool}
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
<StatusPill status={healthStatus} t={t} />
|
{d.drive_type !== "raid" && <StatusPill status={healthStatus} t={t} />}
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user