Admin seite umgebaut mit PW
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user