refactor(maestro): flatten web UI to a single host
Session tree nests by working directory only; the daemon chips in the header become a session tally, and the spawn form loses its host picker. API calls move from /api/daemons/:id/* to /api/dirs, /api/recent-dirs, /api/gitroot, and /api/info.
This commit is contained in:
@@ -20,8 +20,8 @@ async fn spawn_mock_daemon() -> (SocketAddr, oneshot::Sender<()>) {
|
||||
async fn list_sessions() -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!([{"id": "session-1"}]))
|
||||
}
|
||||
async fn web_info() -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({"daemon_id": "mock", "hostname": "mock-host"}))
|
||||
async fn daemon_info() -> Json<serde_json::Value> {
|
||||
Json(serde_json::json!({"hostname": "mock-host"}))
|
||||
}
|
||||
async fn echo_ws(ws: WebSocketUpgrade) -> impl IntoResponse {
|
||||
ws.on_upgrade(echo_handler)
|
||||
@@ -43,7 +43,7 @@ async fn spawn_mock_daemon() -> (SocketAddr, oneshot::Sender<()>) {
|
||||
|
||||
let app = Router::new()
|
||||
.route("/api/sessions", get(list_sessions))
|
||||
.route("/api/web/info", get(web_info))
|
||||
.route("/api/info", get(daemon_info))
|
||||
.route("/api/attach/:id", any(echo_ws));
|
||||
let listener = TcpListener::bind(SocketAddr::from((Ipv4Addr::LOCALHOST, 0)))
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user