diff --git a/frontend/src/components/layout/statusbar.rs b/frontend/src/components/layout/statusbar.rs index 3fa1cef..832ce67 100644 --- a/frontend/src/components/layout/statusbar.rs +++ b/frontend/src/components/layout/statusbar.rs @@ -40,10 +40,13 @@ pub fn StatusBar() -> impl IntoView { (2 * 1024 * 1024, "2 MB/s"), (5 * 1024 * 1024, "5 MB/s"), (10 * 1024 * 1024, "10 MB/s"), + (20 * 1024 * 1024, "20 MB/s"), ]; let set_limit = move |limit_type: &str, val: i64| { let limit_type = limit_type.to_string(); + logging::log!("Setting {} limit to {}", limit_type, val); + spawn_local(async move { let req_body = if limit_type == "down" { GlobalLimitRequest { @@ -60,10 +63,22 @@ pub fn StatusBar() -> impl IntoView { let client = gloo_net::http::Request::post("/api/settings/global-limits").json(&req_body); - if let Ok(req) = client { - if let Err(e) = req.send().await { - logging::error!("Failed to set limit: {}", e); - } + match client { + Ok(req) => match req.send().await { + Ok(resp) => { + if !resp.ok() { + logging::error!( + "Failed to set limit: {} {}", + resp.status(), + resp.status_text() + ); + } else { + logging::log!("Limit set successfully"); + } + } + Err(e) => logging::error!("Network error setting limit: {}", e), + }, + Err(e) => logging::error!("Failed to create request: {}", e), } }); set_down_menu_open.set(false); @@ -75,13 +90,13 @@ pub fn StatusBar() -> impl IntoView { // --- DOWNLOAD SPEED DROPDOWN ---
@@ -101,17 +116,22 @@ pub fn StatusBar() -> impl IntoView {