Fix syntax errors in torrent table component (missing function and closing tags)
All checks were successful
Build MIPS Binary / build (push) Successful in 4m23s
All checks were successful
Build MIPS Binary / build (push) Successful in 4m23s
This commit is contained in:
@@ -24,6 +24,27 @@ fn format_speed(bytes_per_sec: i64) -> String {
|
|||||||
format!("{}/s", format_bytes(bytes_per_sec))
|
format!("{}/s", format_bytes(bytes_per_sec))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn format_duration(seconds: i64) -> String {
|
||||||
|
if seconds <= 0 {
|
||||||
|
return "∞".to_string();
|
||||||
|
}
|
||||||
|
|
||||||
|
let days = seconds / 86400;
|
||||||
|
let hours = (seconds % 86400) / 3600;
|
||||||
|
let minutes = (seconds % 3600) / 60;
|
||||||
|
let secs = seconds % 60;
|
||||||
|
|
||||||
|
if days > 0 {
|
||||||
|
format!("{}d {}h", days, hours)
|
||||||
|
} else if hours > 0 {
|
||||||
|
format!("{}h {}m", hours, minutes)
|
||||||
|
} else if minutes > 0 {
|
||||||
|
format!("{}m {}s", minutes, secs)
|
||||||
|
} else {
|
||||||
|
format!("{}s", secs)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn format_date(timestamp: i64) -> String {
|
fn format_date(timestamp: i64) -> String {
|
||||||
if timestamp <= 0 {
|
if timestamp <= 0 {
|
||||||
return "-".to_string();
|
return "-".to_string();
|
||||||
@@ -400,7 +421,10 @@ pub fn TorrentTable() -> impl IntoView {
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div> {move || filtered_torrents().into_iter().map(|t| {
|
</div>
|
||||||
|
|
||||||
|
<div class="overflow-y-auto p-3 pb-20 flex-1 grid grid-cols-1 content-start gap-3">
|
||||||
|
{move || filtered_torrents().into_iter().map(|t| {
|
||||||
let progress_class = if t.percent_complete >= 100.0 { "progress-success" } else { "progress-primary" };
|
let progress_class = if t.percent_complete >= 100.0 { "progress-success" } else { "progress-primary" };
|
||||||
let status_str = format!("{:?}", t.status);
|
let status_str = format!("{:?}", t.status);
|
||||||
let status_badge_class = match t.status {
|
let status_badge_class = match t.status {
|
||||||
|
|||||||
Reference in New Issue
Block a user