fix: emit relative container link URLs from harness, update dashboard join
Container link URLs (/screen.html, /stats.html) were root-relative, which works when the agent is accessed directly at :port/ but resolves to the gateway root when accessed via /agent/<name>/. Fix at the source: harness emits relative URLs (screen.html, stats.html) and the dashboard joins containerBase + '/' + url. The agent page uses the URL directly and relative resolution is now correct in both paths.
This commit is contained in:
parent
7a8b8fe266
commit
c353dc1893
2 changed files with 4 additions and 11 deletions
|
|
@ -607,12 +607,8 @@ async fn api_state(State(state): State<AppState>) -> axum::Json<StateSnapshot> {
|
|||
fn agent_links(label: &str, gui_enabled: bool) -> Vec<AgentLink> {
|
||||
let mut links = Vec::new();
|
||||
|
||||
// URLs are the actual HTML files served out of the frontend dist
|
||||
// (`stats.html` / `screen.html`); the harness serves them as
|
||||
// static files via ServeDir rather than via Rust routes, so the
|
||||
// URL has to be the on-disk filename.
|
||||
links.push(AgentLink {
|
||||
url: "/stats.html".to_owned(),
|
||||
url: "stats.html".to_owned(),
|
||||
icon: "📊".to_owned(),
|
||||
label: "stats".to_owned(),
|
||||
kind: AgentLinkKind::Container,
|
||||
|
|
@ -620,7 +616,7 @@ fn agent_links(label: &str, gui_enabled: bool) -> Vec<AgentLink> {
|
|||
|
||||
if gui_enabled {
|
||||
links.push(AgentLink {
|
||||
url: "/screen.html".to_owned(),
|
||||
url: "screen.html".to_owned(),
|
||||
icon: "🖥".to_owned(),
|
||||
label: "screen".to_owned(),
|
||||
kind: AgentLinkKind::Container,
|
||||
|
|
|
|||
Loading…
Reference in a new issue