diff --git a/lib/infobox/node.js b/lib/infobox/node.js index 337ca41..5b3994a 100644 --- a/lib/infobox/node.js +++ b/lib/infobox/node.js @@ -149,18 +149,15 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"] return span; } - function showLoadBar(v) { + function showLoadBar(v, p) { var span = document.createElement("span"); span.classList.add("bar"); var bar = document.createElement("span"); - if (v >= 1) { - bar.style.width = ((v * 100) % 100) + "%"; + bar.style.width = ((v * 100) % 100) + "%"; + if (v >= p) { span.classList.add("warning"); } - else { - bar.style.width = (v * 100) + "%"; - } span.appendChild(bar); var label = document.createElement("label"); @@ -176,7 +173,7 @@ define(["chroma-js", "moment/moment", "tablesort", "helper", "moment/locale/de"] } return function (el) { - el.appendChild(showLoadBar(d.statistics.loadavg.toFixed(2))); + el.appendChild(showLoadBar(d.statistics.loadavg.toFixed(2), d.nodeinfo.hardware.nproc)); }; }