feat: integrate modern Progress component into torrent table and cards
Some checks failed
Build MIPS Binary / build (push) Failing after 50s

This commit is contained in:
spinline
2026-02-13 19:47:44 +03:00
parent ec76ddb041
commit 0720580cf0

View File

@@ -15,6 +15,7 @@ use crate::components::ui::empty::*;
use crate::components::ui::input::Input; use crate::components::ui::input::Input;
use crate::components::ui::multi_select::*; use crate::components::ui::multi_select::*;
use crate::components::ui::dropdown_menu::*; use crate::components::ui::dropdown_menu::*;
use crate::components::ui::progress::Progress;
use crate::components::ui::alert_dialog::{ use crate::components::ui::alert_dialog::{
AlertDialog, AlertDialog,
AlertDialogBody, AlertDialogBody,
@@ -619,12 +620,14 @@ fn TorrentRow(
{move || visible_columns.get().contains("Progress").then({ {move || visible_columns.get().contains("Progress").then({
let percent = t.percent_complete; let percent = t.percent_complete;
let status = t.status.clone();
move || view! { move || view! {
<DataTableCell> <DataTableCell>
<div class="flex items-center gap-2"> <div class="flex items-center gap-2">
<div class="h-1.5 w-full bg-secondary rounded-full overflow-hidden min-w-[80px]"> <Progress
<div class="h-full bg-primary transition-all duration-500" style=format!("width: {}%", percent)></div> value=Signal::derive(move || percent)
</div> class=if status == shared::TorrentStatus::Error { "bg-destructive/20 [&>div]:bg-destructive".to_string() } else { "bg-secondary w-32".to_string() }
/>
<span class="text-[10px] text-muted-foreground w-10 text-right">{format!("{:.1}%", percent)}</span> <span class="text-[10px] text-muted-foreground w-10 text-right">{format!("{:.1}%", percent)}</span>
</div> </div>
</DataTableCell> </DataTableCell>
@@ -750,9 +753,10 @@ fn TorrentCard(
</span> </span>
<span class="font-bold text-primary">{format!("{:.1}%", t.percent_complete)}</span> <span class="font-bold text-primary">{format!("{:.1}%", t.percent_complete)}</span>
</div> </div>
<div class="h-2 w-full bg-secondary rounded-full overflow-hidden"> <Progress
<div class="h-full bg-primary transition-all duration-500 ease-out" style=format!("width: {}%", t.percent_complete)></div> value=Signal::derive(move || t.percent_complete)
</div> class=if t.status == shared::TorrentStatus::Error { "bg-destructive/20 [&>div]:bg-destructive".to_string() } else { "".to_string() }
/>
</div> </div>
<div class="grid grid-cols-2 gap-y-2 gap-x-4 text-[10px] font-mono pt-2 border-t border-border/40"> <div class="grid grid-cols-2 gap-y-2 gap-x-4 text-[10px] font-mono pt-2 border-t border-border/40">