feat(ui): restricted-User sehen keine Steuerungs-UI (An/Aus, Zeitplan, Override)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jesko Anschütz 2026-03-27 21:38:37 +01:00
parent e35c3cfdbd
commit c943df4663

View file

@ -970,6 +970,7 @@ const manageTmpl = `<!DOCTYPE html>
</div>
</div>
<!-- Schedule control -->
{{if ne .UserRole "restricted"}}
<div class="box mb-3">
<h3 class="title is-6 mb-2">Zeitplan</h3>
<label class="pl-toggle" title="Zeitplan aktivieren">
@ -996,7 +997,9 @@ const manageTmpl = `<!DOCTYPE html>
</div>
<p id="schedule-save-ok" class="save-ok mt-2" style="font-size:.8rem"> Gespeichert</p>
</div>
{{end}}
<!-- Per-Screen Override (Einschalten bis) -->
{{if ne .UserRole "restricted"}}
<div class="box mb-3">
<h3 class="title is-6 mb-2">Einschalten bis (Override)</h3>
{{if not_expired .Schedule.OverrideOnUntil}}
@ -1017,6 +1020,7 @@ const manageTmpl = `<!DOCTYPE html>
{{end}}
<p id="screen-override-ok" class="save-ok mt-2" style="font-size:.8rem">&#x2713; Gespeichert</p>
</div>
{{end}}
<!-- Upload (collapsed) -->
<div class="box mb-3">
<details id="upload-details">
@ -1455,6 +1459,7 @@ const screenOverviewTmpl = `<!DOCTYPE html>
<div class="container">
<h1 class="title is-4 mb-5">Meine Bildschirme</h1>
<!-- Globaler Override-Banner -->
{{if ne .UserRole "restricted"}}
<div id="global-override-section" style="margin-bottom:1rem">
{{if .GlobalOverride}}
<div class="notification {{if eq .GlobalOverride.Type "off"}}is-warning{{else}}is-info{{end}} is-light py-2 px-3" style="display:flex;align-items:center;gap:1rem;flex-wrap:wrap">
@ -1477,7 +1482,8 @@ const screenOverviewTmpl = `<!DOCTYPE html>
</div>
{{end}}
</div>
{{if gt (len .Cards) 1}}
{{end}}
{{if and (gt (len .Cards) 1) (ne .UserRole "restricted")}}
<div class="bulk-bar">
<span style="font-size:.875rem;font-weight:600;color:#374151">Alle Displays:</span>
<button class="button is-small is-success is-light" type="button" onclick="bulkDisplay('on')">Alle einschalten</button>
@ -1504,13 +1510,16 @@ const screenOverviewTmpl = `<!DOCTYPE html>
<span id="ds-{{.Screen.Slug}}" class="display-state-badge {{.DisplayState}}">
{{if eq .DisplayState "on"}}An{{else if eq .DisplayState "off"}}Aus{{else}}?{{end}}
</span>
{{if ne $.UserRole "restricted"}}
<button class="button is-small is-success is-light" type="button"
onclick="sendDisplayCmd('{{.Screen.Slug}}','on')">Ein</button>
<button class="button is-small is-danger is-light" type="button"
onclick="sendDisplayCmd('{{.Screen.Slug}}','off')">Aus</button>
{{end}}
</div>
<!-- Per-Screen Override -->
<div style="margin-top:.5rem;font-size:.8rem">
{{if ne $.UserRole "restricted"}}
{{if .OverrideOnUntil}}
<span style="color:#059669">&#x23F0; Ein bis {{.OverrideOnUntil.Format "02.01. 15:04"}}</span>
<button class="button is-small is-light" style="padding:0 .4rem;height:1.4rem" type="button"
@ -1526,6 +1535,7 @@ const screenOverviewTmpl = `<!DOCTYPE html>
</div>
</details>
{{end}}
{{end}}
</div>
</div>
</div>