From 3a2d1869c0ddb90c004b81148d5812d8d460e7c4 Mon Sep 17 00:00:00 2001 From: Stefan Bethke Date: Fri, 30 May 2025 13:07:37 +0200 Subject: [PATCH] Do not add locks to home page (or any other page) --- hmdooris/static/main.js | 4 ++-- hmdooris/templates/home.html.j2 | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/hmdooris/static/main.js b/hmdooris/static/main.js index 2360f12..fd21872 100644 --- a/hmdooris/static/main.js +++ b/hmdooris/static/main.js @@ -61,9 +61,9 @@ fetch("/api/lock").then((res) => res.json()).then((data) => { - if (!data.authorized) - return; let locks = document.getElementById("locks"); + if (locks === null || !data.authorized) + return; for (let lock of data.locks) { let lock_line = document.createElement("div"); lock_line.id = `lock__line__${lock.id}`; diff --git a/hmdooris/templates/home.html.j2 b/hmdooris/templates/home.html.j2 index ea06382..e3dd21e 100644 --- a/hmdooris/templates/home.html.j2 +++ b/hmdooris/templates/home.html.j2 @@ -2,6 +2,5 @@ {% block page_title %}CCCHH Dooris{% endblock %} {% block page_body %}

Shows the status of the logs

-
Lock or unlock a door {% endblock %}