26 lines
605 B
JavaScript
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)
|
|
} |