Fix infrastructure white page error cause by theme color

This commit is contained in:
YinDongfang
2025-01-27 12:50:53 +08:00
parent 9a250e1460
commit e19dffb186
2 changed files with 7 additions and 11 deletions

View File

@@ -156,14 +156,12 @@ function Infrastructure() {
const uptimePercentage = ((monitor?.uptimePercentage ?? 0) * 100)
.toFixed(2)
.toString();
const percentageColor =
monitor.uptimePercentage < 0.25
? theme.palette.error.main
: monitor.uptimePercentage < 0.5
? theme.palette.percentage.uptimeFair
: monitor.uptimePercentage < 0.75
? theme.palette.percentage.uptimeGood
: theme.palette.success.lowContrast;
const percentageColor = monitor.uptimePercentage < 0.25
? theme.palette.error.main
: monitor.uptimePercentage < 0.5
? theme.palette.warning.main
: theme.palette.success.main;
return {
id: monitor._id,
name: monitor.name,

View File

@@ -71,9 +71,7 @@ const UptimeMonitors = () => {
? theme.palette.error.main
: monitor.uptimePercentage < 0.5
? theme.palette.warning.main
: monitor.uptimePercentage < 0.75
? theme.palette.success.main
: theme.palette.success.main;
: theme.palette.success.main;
}
return {