feat: 配置项目的热修改

This commit is contained in:
2024-03-30 19:24:09 +08:00
parent c15c604752
commit 9b2b0a7c7d
15 changed files with 11526 additions and 47 deletions

View File

@ -0,0 +1,19 @@
let server_addr = "mc.liteyuki.icu";
let api_url = "https://api.mcstatus.io/v2/status/java/" + server_addr;
let server_status = document.getElementById("now-online");
fetch(api_url)
.then(response => {
console.log(response);
return response.json();
})
.then(data => {
if (data.online){
server_status.textContent = "当前状态: 在线 " + data.players.online + " / " +data.players.max;
} else {
server_status.textContent = "当前状态: 服务器离线";
}
}
)