MEM @#parseInt(server.State?server.State.MemUsed/server.Host.MemTotal*100:0)#@%
@@ -150,8 +126,8 @@
@#formatByteSize(server.State.NetOutTransfer)#@ |
@#formatByteSize(server.State.NetInTransfer)#@ |
-
-
+
+
@#server.live?parseInt(server.State.CPU):'NaN'#@%
@@ -172,16 +148,7 @@
-
+{{template "theme-mdui/footer" .}}
@@ -270,6 +237,7 @@
}
});
}
+ var infoTooltip = {}, memTooltip = {};
ws.onmessage = function (evt) {
const data = JSON.parse(evt.data)
statusCards.servers = data.servers
@@ -282,9 +250,30 @@
ns.live = false
} else {
ns.live = true
+ if (statusCards.showCard) {
+ var disk = statusCards.formatByteSize(ns.State.DiskUsed) + '/' + statusCards.formatByteSize(ns.Host.DiskTotal);
+ var upTime = statusCards.secondToDate(ns.State.Uptime);
+ var content =
+`System: ${ns.Host.Platform}-${ns.Host.PlatformVersion}[${ns.Host.Arch}]
+CPU: ${ns.Host.CPU}
+Disk: ${disk}
+Online: ${upTime}
+Version: ${ns.Host.Version}`;
+ if (infoTooltip[ns.ID]) {infoTooltip[ns.ID].$element[0].innerText = content;}
+ else {
+ if (document.getElementById(`info-${ns.ID}`)) infoTooltip[ns.ID] = new mdui.Tooltip(`#info-${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;}
+ else {
+ if (document.getElementById(`mem-${ns.ID}`)) memTooltip[ns.ID] = new mdui.Tooltip(`#mem-${ns.ID}`, {});
+ }
+ } else {mdui.$('div').remove('.mdui-tooltip'); infoTooltip = {}; memTooltip = {};}
}
}
}
+ mdui.mutation();
}
ws.onclose = function () {
mdui.snackbar({
diff --git a/resource/template/theme-mdui/menu.html b/resource/template/theme-mdui/menu.html
new file mode 100644
index 0000000..7d0be88
--- /dev/null
+++ b/resource/template/theme-mdui/menu.html
@@ -0,0 +1,30 @@
+{{define "theme-mdui/menu"}}
+
+
+
+
+{{end}}
diff --git a/resource/template/theme-mdui/service.html b/resource/template/theme-mdui/service.html
index 03e66f0..3ace361 100644
--- a/resource/template/theme-mdui/service.html
+++ b/resource/template/theme-mdui/service.html
@@ -17,32 +17,8 @@
-
-
+
+{{template "theme-mdui/menu" .}}
@@ -84,7 +60,7 @@
{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}
{{else if ge $percent 80.0}}
- sentiment_dissatisfied
+ sentiment_dissatisfied
{{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}
{{else}}
sentiment_very_dissatisfied
@@ -98,16 +74,7 @@
-
+{{template "theme-mdui/footer" .}}
diff --git a/resource/template/theme-mdui/viewpassword.html b/resource/template/theme-mdui/viewpassword.html
index f0d71de..3327da7 100644
--- a/resource/template/theme-mdui/viewpassword.html
+++ b/resource/template/theme-mdui/viewpassword.html
@@ -39,6 +39,7 @@
if (res.redirected) {
window.location.href = res.url;
} else {
+ window.location.reload();
mdui.snackbar({
message: '密码错误',
position: 'top',
|