diff --git a/src/api/mod.rs b/src/api/mod.rs index cee3e82..7126f4f 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -499,12 +499,9 @@ async fn handle( let result: Result>, ApiFailure> = async { match (method.as_str(), normalized_path) { - ("GET", "/web-status") => Ok(web_status::render( - query.as_deref(), - &shared.web_trace, - &cfg.web.debug, - ) - .await), + ("GET", "/web-status") => { + Ok(web_status::render(query.as_deref(), &shared.web_trace, &cfg.web.debug).await) + } ("GET", "/v1/health") => { let revision = current_revision(&shared.config_path).await?; let data = HealthData { diff --git a/src/api/web_status.rs b/src/api/web_status.rs index bee469c..41ef777 100644 --- a/src/api/web_status.rs +++ b/src/api/web_status.rs @@ -1,7 +1,6 @@ use std::collections::BTreeMap; use std::sync::Arc; -use base64::Engine as _; use http_body_util::Full; use hyper::body::Bytes; use hyper::header::{self, HeaderValue}; @@ -9,16 +8,17 @@ use hyper::{Response, StatusCode}; use tokio::sync::OwnedSemaphorePermit; use crate::config::WebDebugConfig; -use crate::web::trace::{ - StoredTraceRecord, TraceRecord, TraceRecordKind, WebTraceStore, -}; +use crate::web::trace::{StoredTraceRecord, TraceRecord, TraceRecordKind, WebTraceStore}; const MAX_PAGE_BYTES: usize = 8 * 1024 * 1024; const MAX_GROUPS: usize = 1024; +// Record-detail rendering remains isolated from filtering and page layout. +mod details; // Query parsing and matching remain independent from bounded HTML rendering. mod query; +use details::{push_body, push_frames, push_headers}; use query::{GroupBy, StatusQuery, client_ip, parse_query, record_matches}; struct GroupSummary { @@ -119,11 +119,18 @@ fn push_page_start(html: &mut String) { fn push_filter_form(html: &mut String, query: &StatusQuery) { html.push_str("

Filters

"); input(html, "window_secs", &query.window_secs.to_string()); - input(html, "ip", &query.ip.map(|value| value.to_string()).unwrap_or_default()); + input( + html, + "ip", + &query.ip.map(|value| value.to_string()).unwrap_or_default(), + ); input( html, "session", - &query.session.map(|value| value.to_string()).unwrap_or_default(), + &query + .session + .map(|value| value.to_string()) + .unwrap_or_default(), ); input( html, @@ -133,7 +140,12 @@ fn push_filter_form(html: &mut String, query: &StatusQuery) { input(html, "key", query.key.as_deref().unwrap_or_default()); input(html, "limit", &query.limit.to_string()); html.push_str("