Improve init Home page.

This commit is contained in:
MikoyChinese 2022-01-10 18:35:47 +08:00
parent 7baa4d1d00
commit 57c868c527

View File

@ -101,7 +101,7 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else class="mdui-table-fluid mdui-m-t-1"> <div v-else class="mdui-table-fluid mdui-m-t-1">
<table class="mdui-table mdui-table-hoverable"> <table class="mdui-table mdui-table-hoverable">
<thead> <thead>
@ -144,7 +144,7 @@
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
@ -251,21 +251,25 @@
} else { } else {
ns.live = true ns.live = true
if (statusCards.showCard) { if (statusCards.showCard) {
var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal); if (infoTooltip[ns.ID]) {
var upTime = statusCards.secondToDate(ns.State.Uptime); var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal);
var content = var upTime = statusCards.secondToDate(ns.State.Uptime);
`System: ${ns.Host.Platform}-${ns.Host.PlatformVersion}[${ns.Host.Arch}] var content =
CPU: ${ns.Host.CPU} `System: ${ns.Host.Platform}-${ns.Host.PlatformVersion}[${ns.Host.Arch}]
Disk: ${disk} CPU: ${ns.Host.CPU}
Online: ${upTime} Disk: ${disk}
Version: ${ns.Host.Version}`; Online: ${upTime}
if (infoTooltip[ns.ID]) {infoTooltip[ns.ID].$element[0].innerText = content;} Version: ${ns.Host.Version}`;
else { infoTooltip[ns.ID].$element[0].innerText = content;
if (document.getElementById(`info-${ns.ID}`)) infoTooltip[ns.ID] = new mdui.Tooltip(`#info-${ns.ID}`, {}) }
else {
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)}`;
memTooltip[ns.ID].$element[0].innerText = content;
} }
var content = `${statusCards.formatByteSize(ns.State.MemUsed)}/${statusCards.formatByteSize(ns.Host.MemTotal)}`;
if (memTooltip[ns.ID]) {memTooltip[ns.ID].$element[0].innerText = content;}
else { else {
if (document.getElementById(`mem-${ns.ID}`)) memTooltip[ns.ID] = new mdui.Tooltip(`#mem-${ns.ID}`, {}); if (document.getElementById(`mem-${ns.ID}`)) memTooltip[ns.ID] = new mdui.Tooltip(`#mem-${ns.ID}`, {});
} }