Port server status to the web dashboard

This commit is contained in:
Crypto137 2025-10-17 17:25:19 +03:00
parent 947d196891
commit 8b14517f3f
2 changed files with 14 additions and 2 deletions

View file

@ -22,7 +22,8 @@
<div class="content tab-content" id="server-status-tab">
<h2>Server Status</h2>
<p>Coming soon...</p>
<button id="server-status-button">Refresh</button>
<div id="server-status-container"></div>
</div>
<div class="content tab-content" id="metrics-tab">

View file

@ -104,8 +104,19 @@ const serverStatusTab = {
tabName: "server-status",
initialize() {
document.getElementById("server-status-button").onclick = () => this.requestData();
},
requestData() {
apiUtil.get("/ServerStatus", (data) => this.onDataReceived(data));
},
onDataReceived(data) {
const serverStatusContainer = document.getElementById("server-status-container");
serverStatusContainer.innerHTML = "";
htmlUtil.createAndAppendChild(serverStatusContainer, "pre", data.Text);
}
}
const metricsTab = {