Add logout button to the sidebar

This commit is contained in:
VPS 4 Builder
2026-05-26 04:30:46 +02:00
parent a04dea830b
commit 20372c6202
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -34,6 +34,12 @@ function showErrorBanner(msg, detail = '') {
setTimeout(() => banner && banner.remove(), 8000);
}
function logout() {
localStorage.removeItem('auth_token');
localStorage.removeItem('token');
window.location.href = '/login';
}
function getAuthToken() {
return localStorage.getItem('auth_token');
}
+3
View File
@@ -34,6 +34,9 @@
<a href="/reset" class="nav-item" style="color: #dc3545;">
<span class="icon">⚠️</span> Zerar Sistema
</a>
<a href="#" class="nav-item" onclick="logout(); return false;">
<span class="icon">🚪</span> Sair
</a>
<div class="nav-divider"></div>
<button id="toggleDisabledBtn" class="btn btn-secondary" style="margin: 10px 20px; width: calc(100% - 40px);">
<span id="toggleText">Ocultas</span>