-
管理后台 检测中…
-
接口状态 检测中…
+
@@ -43,39 +43,39 @@
function check() {
svcEl.textContent = "检测中…";
- svcEl.className = "pill";
+ svcEl.style.color = "";
apiEl.textContent = "检测中…";
- apiEl.className = "pill";
+ apiEl.style.color = "";
fetch("/health")
.then(function(r) { return r.text(); })
.then(function(t) {
if (t.indexOf("ok") !== -1) {
svcEl.textContent = "运行正常";
- svcEl.className = "pill ok";
+ svcEl.style.color = "var(--green)";
} else {
svcEl.textContent = "异常";
- svcEl.className = "pill bad";
+ svcEl.style.color = "var(--danger-soft-text)";
}
})
.catch(function() {
svcEl.textContent = "无法连接";
- svcEl.className = "pill bad";
+ svcEl.style.color = "var(--danger-soft-text)";
});
fetch("/openapi.json")
.then(function(r) {
if (r.ok) {
apiEl.textContent = "正常";
- apiEl.className = "pill ok";
+ apiEl.style.color = "var(--green)";
} else {
apiEl.textContent = "异常 (" + r.status + ")";
- apiEl.className = "pill bad";
+ apiEl.style.color = "var(--danger-soft-text)";
}
})
.catch(function() {
apiEl.textContent = "无法连接";
- apiEl.className = "pill bad";
+ apiEl.style.color = "var(--danger-soft-text)";
});
}