feat: Add more local strings and healthcheck api
All checks were successful
Check Code Quality / RuffCheck (push) Successful in 46s
Build Docker / BuildImage (push) Successful in 52s

This commit is contained in:
2026-03-30 09:41:34 +11:00
parent 565beefac1
commit 3df49aed78
2 changed files with 6 additions and 23 deletions

View File

@@ -181,26 +181,9 @@ def catch_all(path: str):
# region API routes
api_requests = 0
@app.route("/api/v1/data", methods=["GET"])
def api_data():
"""
Example API endpoint that returns some data.
You can modify this to return whatever data you need.
"""
global api_requests
api_requests += 1
data = {
"header": "Sample API Response",
"content": f"Hello, this is a sample API response! You have called this endpoint {api_requests} times.",
"timestamp": datetime.now().isoformat(),
}
return jsonify(data)
@app.route("/api/v1/status")
def api_status():
return jsonify({"status": "ok"})
@app.route("/api/v1/cloud_quota", methods=["GET"])

View File

@@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", () => {
// Create a new span element to display the quota
const quotaLabel = document.createElement("p");
quotaLabel.classList.add("service-note");
quotaLabel.textContent = `${data.used} GB used / ${data.total} GB total`;
quotaLabel.textContent = `${data.used.toLocaleString()} GB used / ${data.total.toLocaleString()} GB total`;
// Append the quota span to the cloud link
cloudLink.appendChild(quotaLabel);
} else {
@@ -31,7 +31,7 @@ document.addEventListener("DOMContentLoaded", () => {
// Create a new span element to display the stats
const statsLabel = document.createElement("p");
statsLabel.classList.add("service-note");
statsLabel.textContent = `Images: ${data.images.toLocaleString()}, Videos: ${data.videos}`;
statsLabel.textContent = `Images: ${data.images.toLocaleString()}, Videos: ${data.videos.toLocaleString()}`;
// Append the stats span to the Immich link
immichLink.appendChild(statsLabel);
} else {
@@ -53,7 +53,7 @@ document.addEventListener("DOMContentLoaded", () => {
// Create a new span element to display the stats
const statsLabel = document.createElement("p");
statsLabel.classList.add("service-note");
statsLabel.textContent = `Links: ${data.links_count}`;
statsLabel.textContent = `Links: ${data.links_count.toLocaleString()}`;
// Append the stats span to the Links link
linksLink.appendChild(statsLabel);
} else {