Styles
Its more beautifull now
This commit is contained in:
@@ -575,3 +575,38 @@ fn user_total_component(props: &UserTotalProps) -> Html {
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
#[component(EasyFixCount)]
|
||||
fn easy_fix_component() -> Html {
|
||||
let count = use_state(|| 0);
|
||||
let error = use_state(|| None::<String>);
|
||||
|
||||
{
|
||||
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::<CountResponse>().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! {
|
||||
<div class="open-tickets">
|
||||
<h2 class="left">{ "Probleme ohne Ticket gelößt" }</h2>
|
||||
<h4 class="ticket_count center">{ *count }</h4>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user