feat: status page + maintenance

这个提交包含在:
mco-system
2023-05-27 17:58:14 +11:00
父节点 02645b7ef7
当前提交 f3d697699d
修改 4 个文件,包含 11 行新增20 行删除

2
maintenance/scripts/jquery-3.7.0.min.js vendored 普通文件

文件差异因一行或多行过长而隐藏

查看文件

@@ -1,18 +1,6 @@
function reboot() {
console.log("Vroom...");
var xhttp = new XMLHttpRequest();
console.log("Vroop...");
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
console.log("Houba");
document.getElementById("logs").innerHTML = this.responseText;
console.log("Hop");
setTimeout(function () {location.reload()}, 5000);
}
};
console.log("Ready");
xhttp.open("GET", "https://www.thsf.net/thsf.net/maintenance/reboot.py", true);
console.log("Go");
xhttp.send();
console.log("Gone !");
}
$("reboot").click(function(){
$.get("https://www.thsf.net/thsf.net/maintenance/reboot.py", function(data, status){
document.getElementById("logs").innerHTML = data;
setTimeout(function () {document.location.reload()}, 5000);
});
});

查看文件

@@ -55,7 +55,7 @@
}
.container_log {
text-align: left;
width: 48.4em;
width: 48.6em;
padding: 0.2em;
border-width: 1px;
border-style: solid;

查看文件

@@ -11,6 +11,7 @@ Content-type: text/html
href="/thsf.net/maintenance/style/maintenance.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<script src="/thsf.net/maintenance/scripts/jquery-3.7.0.min.js"></script>
</head>
<body>
<div class="page_wrapper">
@@ -30,7 +31,7 @@ Content-type: text/html
<div class="status">{{ container.name }}</div>
<div class="status">{{ container.status }}</div>
<div class="status">
<i class="button fa-regular fa-recycle" onclick="reboot()"></i>
<i id="reboot" class="button fa-regular fa-recycle" onclick="reboot()"></i>
</div>
</div>
<div class="container_log" id="logs">