Admin seite umgebaut mit PW

This commit is contained in:
2026-05-21 20:35:30 +02:00
parent f53d51acb6
commit ea5521c815
4 changed files with 415 additions and 0 deletions
+30
View File
@@ -138,8 +138,32 @@
</div>
</main>
<div id="auth_overlay" class="auth_overlay">
<div class="auth_box">
<p class="eyebrow" style="margin:0;">Admin-Zugang</p>
<h2 style="margin:0;">CUNO System</h2>
<p style="margin:0; font-size:0.88rem; opacity:.6;">Passwort eingeben um fortzufahren</p>
<input type="password" id="auth_input" class="auth_input" placeholder="••••••••" autocomplete="current-password">
<p id="auth_error" class="auth_error"></p>
<button class="button buttonX" onclick="submitPassword()">Entsperren</button>
</div>
</div>
<script type="text/javascript">
var adminApiBase = window.location.protocol + '//' + window.location.hostname + ':8082';
var AUTH_TOKEN = 'Y3Vubw==';
function submitPassword() {
var input = document.getElementById('auth_input');
var error = document.getElementById('auth_error');
if (btoa(input.value) === AUTH_TOKEN) {
document.getElementById('auth_overlay').remove();
} else {
error.textContent = 'Falsches Passwort';
input.value = '';
input.focus();
}
}
function setAdminStatus(text) {
var status = document.getElementById('admin_status');
@@ -307,6 +331,12 @@
}
window.addEventListener('load', function () {
var input = document.getElementById('auth_input');
input.focus();
input.addEventListener('keydown', function(e) {
if (e.key === 'Enter') submitPassword();
});
fetchStatus();
fetchDelay();
window.setInterval(fetchStatus, 10000);