Do not add locks to home page (or any other page)
All checks were successful
docker-image / docker (push) Successful in 1m20s
All checks were successful
docker-image / docker (push) Successful in 1m20s
This commit is contained in:
parent
337602c388
commit
3a2d1869c0
2 changed files with 2 additions and 3 deletions
|
@ -61,9 +61,9 @@
|
||||||
|
|
||||||
|
|
||||||
fetch("/api/lock").then((res) => res.json()).then((data) => {
|
fetch("/api/lock").then((res) => res.json()).then((data) => {
|
||||||
if (!data.authorized)
|
|
||||||
return;
|
|
||||||
let locks = document.getElementById("locks");
|
let locks = document.getElementById("locks");
|
||||||
|
if (locks === null || !data.authorized)
|
||||||
|
return;
|
||||||
for (let lock of data.locks) {
|
for (let lock of data.locks) {
|
||||||
let lock_line = document.createElement("div");
|
let lock_line = document.createElement("div");
|
||||||
lock_line.id = `lock__line__${lock.id}`;
|
lock_line.id = `lock__line__${lock.id}`;
|
||||||
|
|
|
@ -2,6 +2,5 @@
|
||||||
{% block page_title %}CCCHH Dooris{% endblock %}
|
{% block page_title %}CCCHH Dooris{% endblock %}
|
||||||
{% block page_body %}
|
{% block page_body %}
|
||||||
<p>Shows the status of the logs</p>
|
<p>Shows the status of the logs</p>
|
||||||
<div id="locks"></div>
|
|
||||||
<a href="operate">Lock or unlock a door</a>
|
<a href="operate">Lock or unlock a door</a>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue