Improve init Home page.
} else {
ns.live = true
if (statusCards.showCard) {
+ if (infoTooltip[ns.ID]) {
var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal);
var upTime = statusCards.secondToDate(ns.State.Uptime);
var content =
@@ -259,13 +260,16 @@ CPU: ${ns.Host.CPU}
Disk: ${disk}
Online: ${upTime}
Version: ${ns.Host.Version}`;
- if (infoTooltip[ns.ID]) {infoTooltip[ns.ID].$element[0].innerText = content;}
+ infoTooltip[ns.ID].$element[0].innerText = content;
+ }
else {
- if (document.getElementById(`info-${ns.ID}`)) infoTooltip[ns.ID] = new mdui.Tooltip(`#info-${ns.ID}`, {})
+ if (document.getElementById(`info-${ns.ID}`)) infoTooltip[ns.ID] = new mdui.Tooltip(`#info-${ns.ID}`, {});
}
+ if (memTooltip[ns.ID]) {
var content = `${statusCards.formatByteSize(ns.State.MemUsed)}/${statusCards.formatByteSize(ns.Host.MemTotal)}`;
- if (memTooltip[ns.ID]) {memTooltip[ns.ID].$element[0].innerText = content;}
+ memTooltip[ns.ID].$element[0].innerText = content;
+ }
else {
if (document.getElementById(`mem-${ns.ID}`)) memTooltip[ns.ID] = new mdui.Tooltip(`#mem-${ns.ID}`, {});
}
