fix: don´t make PG/CPU usage go over 100% (#140)

This commit is contained in:
Patric Stout
2024-05-26 15:09:02 +02:00
committed by GitHub
parent da14dee51d
commit 7df8090a5d

View File

@@ -48,6 +48,9 @@ export const Usage = (props: {
break;
}
/* Don't try to draw more than 100%. */
if (usageUsed > usageTotal) usageUsed = usageTotal;
const radius = 232;
const degrees = props.angle;
const usageDegrees = (degrees * usageUsed) / usageTotal;