1
This commit is contained in:
@@ -930,32 +930,6 @@
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
function showLoginOverlay() {
|
|
||||||
document.getElementById('login-overlay').classList.remove('hidden');
|
|
||||||
document.getElementById('login-error').style.display = 'none';
|
|
||||||
}
|
|
||||||
|
|
||||||
async function attemptLogin() {
|
|
||||||
const input = document.getElementById('web-pass-input');
|
|
||||||
const pwd = input.value.trim();
|
|
||||||
if (!pwd) return;
|
|
||||||
|
|
||||||
const res = await fetch('/api/login', {
|
|
||||||
headers: { 'X-Web-Password': pwd }
|
|
||||||
});
|
|
||||||
|
|
||||||
if (res.ok) {
|
|
||||||
webPassword = pwd;
|
|
||||||
localStorage.setItem('vps_web_password', pwd);
|
|
||||||
document.getElementById('login-overlay').classList.add('hidden');
|
|
||||||
initDashboard();
|
|
||||||
} else {
|
|
||||||
document.getElementById('login-error').style.display = 'block';
|
|
||||||
input.value = '';
|
|
||||||
input.focus();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function initDashboard() {
|
function initDashboard() {
|
||||||
fetchStats();
|
fetchStats();
|
||||||
loadConfig();
|
loadConfig();
|
||||||
@@ -1032,8 +1006,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
setInterval(() => { fetchStats(); }, 3000);
|
||||||
setInterval(() => { if (!document.getElementById('login-overlay').classList.contains('hidden')) return; fetchStats(); }, 3000);
|
|
||||||
|
|
||||||
// Actions
|
// Actions
|
||||||
async function executeAction(type) {
|
async function executeAction(type) {
|
||||||
@@ -1537,9 +1510,7 @@
|
|||||||
|
|
||||||
window.toggleRecording = toggleRecording;
|
window.toggleRecording = toggleRecording;
|
||||||
|
|
||||||
// Auto-login se já tiver senha salva
|
// Inicia direto - Segurança suspensa
|
||||||
// Autenticação desativada - Inicia direto
|
|
||||||
document.getElementById('login-overlay').classList.add('hidden');
|
|
||||||
initDashboard();
|
initDashboard();
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Reference in New Issue
Block a user