Fix crash when backend has no rrSCParity property (#2826)

This commit is contained in:
GeekTR
2023-05-23 03:14:41 +08:00
committed by GitHub
parent dc90db6591
commit 6e314a2fa5

View File

@@ -285,33 +285,21 @@ const BasicDashboard = ({ usage }: IDashboardProps) => {
<TimeStatItem
icon={<StorageIcon />}
label={"Backend type"}
value={
usage?.backend?.backendType
? usage.backend.backendType
: "Unknown"
}
value={usage?.backend?.backendType ?? "Unknown"}
/>
</Grid>
<Grid item xs={4}>
<TimeStatItem
icon={<FormatDrivesIcon />}
label={"Standard storage class parity"}
value={
usage?.backend?.standardSCParity
? usage.backend.standardSCParity.toString()
: "n/a"
}
value={usage?.backend?.standardSCParity?.toString() ?? "n/a"}
/>
</Grid>
<Grid item xs={4}>
<TimeStatItem
icon={<FormatDrivesIcon />}
label={"Reduced redundancy storage class parity"}
value={
usage?.backend?.standardSCParity
? usage.backend.rrSCParity.toString()
: "n/a"
}
value={usage?.backend?.rrSCParity?.toString() ?? "n/a"}
/>
</Grid>
</Grid>