demo a thing WEB UI IS BACK

This commit is contained in:
lda
2026-04-12 02:00:01 +07:00 Unverified
parent e23617bd90
commit ea611d5135
7 changed files with 336 additions and 0 deletions
+1
View File
@@ -22,6 +22,7 @@ tokio = { version = "1", features = [
"time",
"signal",
] }
tower-http = { version = "0.6.8", features = ["fs"] }
tracing = "0.1"
tracing-opentelemetry = "0.32"
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "json"] }
+5
View File
@@ -4,10 +4,13 @@ use std::time::Duration;
use anyhow::{Context, Result};
use axum::Router;
use axum::response::Redirect;
use axum::routing::{get, post};
use axum::routing::get_service;
use tokio::net::TcpListener;
use tokio::sync::{Mutex, RwLock, mpsc, oneshot};
use tokio::time::MissedTickBehavior;
use tower_http::services::ServeDir;
use tracing::{info, warn};
use wakey_agent::protocol::{ErrorPayload, ServerMessage};
@@ -42,6 +45,8 @@ pub enum AgentReply {
fn public_api_routes() -> Router<AppState> {
Router::new()
.route("/ui", get(|| async { Redirect::temporary("/ui/") }))
.nest_service("/ui/", get_service(ServeDir::new("ui")))
.route("/healthz", get(api::healthz))
.route("/api/v1/agents/enroll", post(api::enroll))
.route("/api/v1/agent/ws", get(ws::agent_ws))