Port server status to the web dashboard
This commit is contained in:
parent
947d196891
commit
8b14517f3f
2 changed files with 14 additions and 2 deletions
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue