From 565beefac10e1a7b6ccc07ace37dea622fe90f57 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 30 Mar 2026 09:34:25 +1100 Subject: [PATCH 1/2] fix: Use toLocal for number --- templates/assets/js/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/assets/js/index.js b/templates/assets/js/index.js index ecf0ce9..a64c03b 100644 --- a/templates/assets/js/index.js +++ b/templates/assets/js/index.js @@ -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}, Videos: ${data.videos}`; + statsLabel.textContent = `Images: ${data.images.toLocaleString()}, Videos: ${data.videos}`; // Append the stats span to the Immich link immichLink.appendChild(statsLabel); } else { @@ -91,4 +91,4 @@ document.addEventListener("DOMContentLoaded", () => { console.error("Error fetching VPN status:", error); }); } -}); \ No newline at end of file +}); -- 2.49.1 From 3df49aed78b80eed85123b9d731c3075a73cb7c3 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Mon, 30 Mar 2026 09:41:34 +1100 Subject: [PATCH 2/2] feat: Add more local strings and healthcheck api --- server.py | 23 +++-------------------- templates/assets/js/index.js | 6 +++--- 2 files changed, 6 insertions(+), 23 deletions(-) diff --git a/server.py b/server.py index 4e23d86..9120d99 100644 --- a/server.py +++ b/server.py @@ -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"]) diff --git a/templates/assets/js/index.js b/templates/assets/js/index.js index a64c03b..bdb064d 100644 --- a/templates/assets/js/index.js +++ b/templates/assets/js/index.js @@ -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 { -- 2.49.1