Styles
Its more beautifull now
This commit is contained in:
@@ -575,3 +575,38 @@ fn user_total_component(props: &UserTotalProps) -> Html {
|
|||||||
</div>
|
</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>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -192,6 +192,7 @@
|
|||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
|
max-width: 30%;
|
||||||
|
|
||||||
h2 {
|
h2 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user