ui: add login routing and docs

This commit is contained in:
2025-12-30 13:25:15 +01:00
parent b12e0bf4d5
commit f27e423ef3
21 changed files with 2123 additions and 6 deletions

View File

@ -294,5 +294,7 @@ def update_logs(settings: Settings = Depends(get_settings), limit: int = 200) ->
@app.get("/", response_class=HTMLResponse)
@app.get("/login", response_class=HTMLResponse)
@app.get("/dashboard", response_class=HTMLResponse)
def index(request: Request) -> HTMLResponse:
return templates.TemplateResponse("index.html", {"request": request})

View File

@ -286,19 +286,25 @@
}
// Authentication
function setPath(path) {
if (window.location.pathname !== path) {
history.replaceState(null, '', path);
}
}
function showLanding() {
document.getElementById('loginLanding').classList.remove('hidden');
document.getElementById('appContainer').classList.add('hidden');
document.getElementById('headerVersion').textContent = 'v-';
history.replaceState(null, '', '#login');
if (window.location.pathname !== '/login') {
setPath('/login');
}
}
function showApp() {
document.getElementById('loginLanding').classList.add('hidden');
document.getElementById('appContainer').classList.remove('hidden');
if (window.location.hash !== '#app') {
history.replaceState(null, '', '#app');
}
setPath('/dashboard');
}
async function checkSession() {