mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 05:08:13 -05:00
Improve init Home page.
This commit is contained in:
parent
7baa4d1d00
commit
57c868c527
20
resource/template/theme-mdui/home.html
vendored
20
resource/template/theme-mdui/home.html
vendored
@ -251,21 +251,25 @@
|
|||||||
} else {
|
} else {
|
||||||
ns.live = true
|
ns.live = true
|
||||||
if (statusCards.showCard) {
|
if (statusCards.showCard) {
|
||||||
|
if (infoTooltip[ns.ID]) {
|
||||||
var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal);
|
var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal);
|
||||||
var upTime = statusCards.secondToDate(ns.State.Uptime);
|
var upTime = statusCards.secondToDate(ns.State.Uptime);
|
||||||
var content =
|
var content =
|
||||||
`System: ${ns.Host.Platform}-${ns.Host.PlatformVersion}[${ns.Host.Arch}]
|
`System: ${ns.Host.Platform}-${ns.Host.PlatformVersion}[${ns.Host.Arch}]
|
||||||
CPU: ${ns.Host.CPU}
|
CPU: ${ns.Host.CPU}
|
||||||
Disk: ${disk}
|
Disk: ${disk}
|
||||||
Online: ${upTime}
|
Online: ${upTime}
|
||||||
Version: ${ns.Host.Version}`;
|
Version: ${ns.Host.Version}`;
|
||||||
if (infoTooltip[ns.ID]) {infoTooltip[ns.ID].$element[0].innerText = content;}
|
infoTooltip[ns.ID].$element[0].innerText = content;
|
||||||
|
}
|
||||||
else {
|
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)}`;
|
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 {
|
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}`, {});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user