[fix](trx-frontend-http): serve /statistics and /bookmarks, align the Statistics page #32

Merged
sjg merged 2 commits from fix/statistics-alignment-and-routes into main 2026-08-03 00:08:49 +02:00
3 changed files with 19 additions and 5 deletions
@@ -1531,15 +1531,16 @@ small { color: var(--text-muted); }
align-items: center; align-items: center;
gap: 0.2rem; gap: 0.2rem;
min-width: 0; min-width: 0;
/* Never wraps and never scrolls: the occasional destinations live behind /* Never wraps. It must still be able to shrink below its content, or it
* More, so four tabs plus More always fit. overflow-x here would clip the * overlaps the controls; the menus it anchors are reparented to the body on
* dropdown this element anchors. */ * open, so clipping here no longer reaches them. */
flex-wrap: nowrap; flex-wrap: nowrap;
overflow: hidden;
} }
.tab-bar-nav .tab { flex: 0 0 auto; } .tab-bar-nav .tab { flex: 0 0 auto; }
/* Icons before scrolling: every tab already carries one, and four icons plus /* Icons before scrolling: every tab already carries one, and four icons plus
* More always fit, so the strip never has to hide a destination. */ * More always fit, so the strip never has to hide a destination. */
@media (max-width: 1180px) and (min-width: 701px) { @media (max-width: 1360px) and (min-width: 701px) {
.tab-bar-nav .tab .tab-label { display: none; } .tab-bar-nav .tab .tab-label { display: none; }
.tab-bar-nav .tab .tab-icon, .tab-bar-nav .tab .tab-more-icon { display: block; } .tab-bar-nav .tab .tab-icon, .tab-bar-nav .tab .tab-more-icon { display: block; }
.tab-bar-nav .tab { padding: 0.5rem 0.6rem; } .tab-bar-nav .tab { padding: 0.5rem 0.6rem; }
@@ -5187,7 +5188,6 @@ body[data-operator-layout="broadcast"] #cw-bar-overlay {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 1rem; gap: 1rem;
padding: 1rem;
} }
.stats-controls { .stats-controls {
display: flex; display: flex;
@@ -95,6 +95,18 @@ pub(crate) async fn about_index(req: HttpRequest) -> impl Responder {
static_asset_response(&req, "text/html; charset=utf-8", c) static_asset_response(&req, "text/html; charset=utf-8", c)
} }
#[get("/statistics")]
pub(crate) async fn statistics_index(req: HttpRequest) -> impl Responder {
let c = gz_index_html();
static_asset_response(&req, "text/html; charset=utf-8", c)
}
#[get("/bookmarks")]
pub(crate) async fn bookmarks_index(req: HttpRequest) -> impl Responder {
let c = gz_index_html();
static_asset_response(&req, "text/html; charset=utf-8", c)
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// Favicon & logo // Favicon & logo
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@@ -637,6 +637,8 @@ pub fn configure(cfg: &mut web::ServiceConfig) {
.service(assets::recorder_index) .service(assets::recorder_index)
.service(assets::settings_index) .service(assets::settings_index)
.service(assets::about_index) .service(assets::about_index)
.service(assets::statistics_index)
.service(assets::bookmarks_index)
.service(assets::favicon) .service(assets::favicon)
.service(assets::favicon_png) .service(assets::favicon_png)
.service(assets::logo) .service(assets::logo)