Fix infrastructure white page error cause by theme color
This commit is contained in:
1 parent
9a250e1460
commit
e19dffb186
2 files changed
+7
-11
No files matched your search
@@ -156,14 +156,12 @@ function Infrastructure() {
|
|||||||
const uptimePercentage = ((monitor?.uptimePercentage ?? 0) * 100)
|
const uptimePercentage = ((monitor?.uptimePercentage ?? 0) * 100)
|
||||||
.toFixed(2)
|
.toFixed(2)
|
||||||
.toString();
|
.toString();
|
||||||
const percentageColor =
|
const percentageColor = monitor.uptimePercentage < 0.25
|
||||||
monitor.uptimePercentage < 0.25
|
? theme.palette.error.main
|
||||||
? theme.palette.error.main
|
: monitor.uptimePercentage < 0.5
|
||||||
: monitor.uptimePercentage < 0.5
|
? theme.palette.warning.main
|
||||||
? theme.palette.percentage.uptimeFair
|
: theme.palette.success.main;
|
||||||
: monitor.uptimePercentage < 0.75
|
|
||||||
? theme.palette.percentage.uptimeGood
|
|
||||||
: theme.palette.success.lowContrast;
|
|
||||||
return {
|
return {
|
||||||
id: monitor._id,
|
id: monitor._id,
|
||||||
name: monitor.name,
|
name: monitor.name,
|
||||||
|
|||||||
@@ -71,9 +71,7 @@ const UptimeMonitors = () => {
|
|||||||
? theme.palette.error.main
|
? theme.palette.error.main
|
||||||
: monitor.uptimePercentage < 0.5
|
: monitor.uptimePercentage < 0.5
|
||||||
? theme.palette.warning.main
|
? theme.palette.warning.main
|
||||||
: monitor.uptimePercentage < 0.75
|
: theme.palette.success.main;
|
||||||
? theme.palette.success.main
|
|
||||||
: theme.palette.success.main;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in new issue
Block a user