Skip to main content

prospero_api/
dashboard.rs

1//! Serve the embedded **deprecated** v1 dashboard (no Node toolchain — assets
2//! are compiled in).
3//!
4//! Superseded by [`crate::dashboard_v2`], which serves `/` since #191. This one
5//! moved to `/v1` and renders a deprecation notice pointing home. It is kept
6//! rather than deleted so an operator who hits a v2 regression has somewhere to
7//! land; removing it is a follow-up once v2 has a release of real-world use.
8//!
9//! Note it carries known defects v2 was built to fix — most visibly #106, where
10//! a tool call whose finish frame has a blank name stays "running" forever.
11
12use axum::http::header;
13use axum::response::{Html, IntoResponse, Response};
14
15const INDEX_HTML: &str = include_str!("../dashboard/index.html");
16const APP_JS: &str = include_str!("../dashboard/app.js");
17
18/// `GET /v1` — the deprecated dashboard page.
19pub async fn index() -> Html<&'static str> {
20    Html(INDEX_HTML)
21}
22
23/// `GET /v1/app.js` — the deprecated dashboard's script.
24pub async fn app_js() -> Response {
25    (
26        [(
27            header::CONTENT_TYPE,
28            "application/javascript; charset=utf-8",
29        )],
30        APP_JS,
31    )
32        .into_response()
33}