Fix infrastructure white page error cause by theme color

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

No files matched your search

+6 -8
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,
+1 -3
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 {