feat: integrate modern Progress component into torrent table and cards
Some checks failed
Build MIPS Binary / build (push) Failing after 50s
Some checks failed
Build MIPS Binary / build (push) Failing after 50s
This commit is contained in:
@@ -15,6 +15,7 @@ use crate::components::ui::empty::*;
|
||||
use crate::components::ui::input::Input;
|
||||
use crate::components::ui::multi_select::*;
|
||||
use crate::components::ui::dropdown_menu::*;
|
||||
use crate::components::ui::progress::Progress;
|
||||
use crate::components::ui::alert_dialog::{
|
||||
AlertDialog,
|
||||
AlertDialogBody,
|
||||
@@ -619,12 +620,14 @@ fn TorrentRow(
|
||||
|
||||
{move || visible_columns.get().contains("Progress").then({
|
||||
let percent = t.percent_complete;
|
||||
let status = t.status.clone();
|
||||
move || view! {
|
||||
<DataTableCell>
|
||||
<div class="flex items-center gap-2">
|
||||
<div class="h-1.5 w-full bg-secondary rounded-full overflow-hidden min-w-[80px]">
|
||||
<div class="h-full bg-primary transition-all duration-500" style=format!("width: {}%", percent)></div>
|
||||
</div>
|
||||
<Progress
|
||||
value=Signal::derive(move || percent)
|
||||
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>
|
||||
</div>
|
||||
</DataTableCell>
|
||||
@@ -750,9 +753,10 @@ fn TorrentCard(
|
||||
</span>
|
||||
<span class="font-bold text-primary">{format!("{:.1}%", t.percent_complete)}</span>
|
||||
</div>
|
||||
<div class="h-2 w-full bg-secondary rounded-full overflow-hidden">
|
||||
<div class="h-full bg-primary transition-all duration-500 ease-out" style=format!("width: {}%", t.percent_complete)></div>
|
||||
</div>
|
||||
<Progress
|
||||
value=Signal::derive(move || t.percent_complete)
|
||||
class=if t.status == shared::TorrentStatus::Error { "bg-destructive/20 [&>div]:bg-destructive".to_string() } else { "".to_string() }
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-y-2 gap-x-4 text-[10px] font-mono pt-2 border-t border-border/40">
|
||||
|
||||
Reference in New Issue
Block a user