api docs, generator
This commit is contained in:
25
static/js/base.js
Normal file
25
static/js/base.js
Normal file
@@ -0,0 +1,25 @@
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
|
||||
const dot = document.getElementById("apiStatusDot");
|
||||
const text = document.getElementById("apiStatusText");
|
||||
|
||||
if (!dot || !text) return;
|
||||
|
||||
fetch("/health", { method: "GET" })
|
||||
.then(response => {
|
||||
if (!response.ok) throw new Error("API not healthy");
|
||||
dot.classList.remove("bg-secondary");
|
||||
dot.classList.add("bg-success");
|
||||
text.textContent = "API Online";
|
||||
text.classList.remove("text-muted");
|
||||
text.classList.add("text-success");
|
||||
})
|
||||
.catch(() => {
|
||||
dot.classList.remove("bg-secondary");
|
||||
dot.classList.add("bg-danger");
|
||||
text.textContent = "API Offline";
|
||||
text.classList.remove("text-muted");
|
||||
text.classList.add("text-danger");
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user