1
0
Fork 0

don't show "NaN" in web interface for cluster RAM usage (#10283)

This commit is contained in:
Jan 2019-10-21 09:36:13 +02:00 committed by GitHub
parent ddb08ed045
commit 525b8f7a45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -185,7 +185,8 @@
if (typeof value === 'number') {
$(id).html(value);
} else if ($.isArray(value)) {
var a = value[0]; var b = value[1];
var a = value[0];
var b = value[1];
var percent = 1 / (b / a) * 100;
if (percent > 90) {
@ -193,7 +194,11 @@
} else if (percent > 70 && percent < 90) {
warning = true;
}
$(id).html(percent.toFixed(1) + ' %');
if (isNaN(percent)) {
$(id).html('n/a');
} else {
$(id).html(percent.toFixed(1) + ' %');
}
} else if (typeof value === 'string') {
$(id).html(value);
}