ui: add login routing and docs
This commit is contained in:
@ -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})
|
||||
|
||||
@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user