8000 don't show "NaN" in web interface for cluster RAM usage by jsteemann · Pull Request #10283 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

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

8000
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 21, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
< 8000 input type="hidden" data-csrf="true" name="authenticity_token" value="9jtgy67gbbca3eXrvlKxDIYdoIEa0/GuQwrBxf/UYgoYt9l7MOPqGXXbdRxWmwV1ah2s+2820nfgvs7U+bTqhQ==" />
Diff view
don't show "NaN" in web interface for cluster RAM usage
  • Loading branch information
jsteemann committed Oct 20, 2019
commit b5f8e3c338f553ae6ab22acdf4c4706d7d4a60b2
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,20 @@
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) {
error = true;
} 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);
}
Expand Down
0