From e99026e3d60a56ad33d0c8334841171c834a34f1 Mon Sep 17 00:00:00 2001 From: schn33fuchs Date: Wed, 13 May 2026 23:00:46 +0200 Subject: [PATCH] Styles Its more beautifull now --- frontend/src/pages/utilities.rs | 35 +++++++++++++++++++ .../src/styles/components/_diagnostics.scss | 1 + 2 files changed, 36 insertions(+) diff --git a/frontend/src/pages/utilities.rs b/frontend/src/pages/utilities.rs index 968f840..a818f43 100644 --- a/frontend/src/pages/utilities.rs +++ b/frontend/src/pages/utilities.rs @@ -575,3 +575,38 @@ fn user_total_component(props: &UserTotalProps) -> Html { } } + +#[component(EasyFixCount)] +fn easy_fix_component() -> Html { + let count = use_state(|| 0); + let error = use_state(|| None::); + + { + let count = count.clone(); + let error = error.clone(); + + use_effect_with((), move |_| { + spawn_local(async move { + match Request::get("/api/count").send().await { + Ok(resp) if resp.status() == 200 => match resp.json::().await { + Ok(r) => count.set(r.value), + Err(e) => error.set(Some(format!("parse error: {}", e))), + }, + Ok(resp) => error.set(Some( + resp.text() + .await + .unwrap_or_else(|_| format!("status {}", resp.status())), + )), + Err(e) => error.set(Some(format!("Network error: {}", e))), + } + }); + || () + }); + } + html! { +
+

{ "Probleme ohne Ticket gelößt" }

+

{ *count }

+
+ } +} diff --git a/frontend/src/styles/components/_diagnostics.scss b/frontend/src/styles/components/_diagnostics.scss index 42775c0..d2aa1de 100644 --- a/frontend/src/styles/components/_diagnostics.scss +++ b/frontend/src/styles/components/_diagnostics.scss @@ -192,6 +192,7 @@ display: flex; align-items: center; flex-shrink: 0; + max-width: 30%; h2 { margin: 0;