fix: don´t make PG/CPU usage go over 100% (#140)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user