Files
CustomPanel/resources/website/js/server-list-insert.js
T
2025-12-12 22:00:48 +01:00

26 lines
605 B
JavaScript

/** @type {HTMLElement} */
var serverList
window.onload = () => {
serverList = document.getElementById("server-list")
loadServerList()
}
async function loadServerList() {
serversResponse = await fetch("/api/servers", {
method: "POST",
body: JSON.stringify({
token: window.sessionStorage.getItem("session")
})
})
}
function addServerElement(name) {
const container = new HTMLDivElement()
const nameHeader = new HTMLHeadingElement()
nameHeader.textContent = name
container.appendChild(nameHeader)
document.appendChild(container)
}