Add technician login and dashboard pages
- Add /login page with dark theme matching portal - Add /dashboard with 4 tabs: Support, Access, Build, Settings - Add clean URL routes (/login, /dashboard) to server - Add "Technician Login" link to portal footer - Dashboard shows active support codes with generate/cancel - Build tab has installer builder form (placeholder for agent) - Access tab has 3-panel layout for machine management 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -82,6 +82,10 @@ async fn main() -> Result<()> {
|
||||
.route("/api/sessions", get(list_sessions))
|
||||
.route("/api/sessions/:id", get(get_session))
|
||||
|
||||
// HTML page routes (clean URLs)
|
||||
.route("/login", get(serve_login))
|
||||
.route("/dashboard", get(serve_dashboard))
|
||||
|
||||
// State
|
||||
.with_state(state)
|
||||
|
||||
@@ -173,3 +177,18 @@ async fn get_session(
|
||||
|
||||
Ok(Json(api::SessionInfo::from(session)))
|
||||
}
|
||||
|
||||
// Static page handlers
|
||||
async fn serve_login() -> impl IntoResponse {
|
||||
match tokio::fs::read_to_string("static/login.html").await {
|
||||
Ok(content) => Html(content).into_response(),
|
||||
Err(_) => (StatusCode::NOT_FOUND, "Page not found").into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
async fn serve_dashboard() -> impl IntoResponse {
|
||||
match tokio::fs::read_to_string("static/dashboard.html").await {
|
||||
Ok(content) => Html(content).into_response(),
|
||||
Err(_) => (StatusCode::NOT_FOUND, "Page not found").into_response(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user