Nun mit login und Einrichten zusätzlicher User

This commit is contained in:
rxf
2025-09-02 18:49:50 +02:00
parent 6466bb2d92
commit 5ccd37b931
12 changed files with 191 additions and 109 deletions

View File

@@ -9,11 +9,13 @@ html(lang="de")
h1 ESP-ID → Sensornummer
// Tab Navigation
div.tabs
button.tab-btn#tabInput.active(type="button") Eingabe
button.tab-btn#tabList(type="button") Liste
button.tab-btn#tabInput.active(type="button" onclick="showTab('input')") Eingabe
button.tab-btn#tabList(type="button" onclick="showTab('list')") Liste
if isAdmin
button.tab-btn#tabUser(type="button" onclick="showTab('user')") User
// Eingabe-Tab
div#tabInputContent.tab-content
// Eingabe-Tab
div#tabInputContent.tab-content
div.card
form#entryForm
label(for="sensorNumber") Sensornummer:
@@ -35,9 +37,10 @@ html(lang="de")
button#saveBtn(type="button") Speichern
button#cancelBtn(type="button") Abbrechen
div#result
#version Version: #{version} vom #{vdate}
// Listen-Tab
div#tabListContent.tab-content(style="display:none")
// Listen-Tab
div#tabListContent.tab-content(style="display:none")
div.controls
button#refreshBtn Aktualisieren
| Seite:
@@ -63,4 +66,25 @@ html(lang="de")
th(id="thDate" data-sort="date" style="cursor:pointer") Datum <span id="sortArrowDate">↑</span>
th Aktionen
tbody
// User-Tab (nur für Admins)
if isAdmin
div#tabUserContent.tab-content(style="display:none")
div.card
h2 Neuen User anlegen
form#userForm
label(for="username") Benutzername:
input#username(type="text" required)
label(for="password") Passwort:
input#password(type="password" required)
label(for="role") Rolle:
select#role
option(value="user") User
option(value="admin") Admin
.twobuttons
button#userSaveBtn(type="button") Anlegen
button#userCancelBtn(type="button") Abbrechen
div#userResult
#version Version: #{version} vom #{vdate}
script(type="module" src="/global.js")

View File

@@ -6,14 +6,16 @@ html(lang="de")
title Login
link(rel="stylesheet", href="/styles.css")
body
h1 Login
form(method="POST" action="/login")
label(for="email") E-Mail:
input#email(type="email" name="email" required)
span#emailStatus
label(for="password") Passwort:
input#password(type="password" name="password" required)
button(type="submit") Login
if error
p.error= error
h1 ESP-ID → Sensornummer
div.card
h2 Login
form(method="POST" action="/login")
label(for="email") E-Mail:
input#email(type="email" name="email" required)
span#emailStatus
label(for="password") Passwort:
input#password(type="password" name="password" required)
button(type="submit") Login
if error
p.error= error
script(type="module" src="/login.js")

View File

@@ -1,19 +0,0 @@
doctype html
html(lang="de")
head
meta(charset="utf-8")
meta(name="viewport", content="width=device-width, initial-scale=1")
title Registrieren
link(rel="stylesheet", href="/styles.css")
body
h1 Registrierung
form(method="POST" action="/register")
label(for="email") E-Mail:
input#email(type="email" name="email" required)
span#emailStatus
label(for="password") Passwort:
input#password(type="password" name="password" required)
button(type="submit") Registrieren
if error
p.error= error
script(type="module" src="/register.js")