Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 30 additions & 28 deletions src/ui/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ pub async fn tasks(
tbody class="animate-fade-up" {
@for task in tasks.tasks {
// Pre-compute / formate some values
@let try_number: u32 = task.try_number.unwrap_or(0);
@let state_cell: Markup = match task.state {
Some(state) => html! {
td class={ "badge " (task_state_badge_type(&state)) } { (state) }
Expand All @@ -190,33 +189,36 @@ pub async fn tasks(
None => "".to_string()
};
// Should the row link to the logs?
@if try_number > 0 {
tr
id={ "row_" (task.task_id) }
class="hover:bg-base-300 cursor-pointer"
onclick={ "window.location='/logs/" (task.run_id) "/" (task.task_id) "';" } {
td { (task.task_id) }
// Task State Badge
(state_cell)
// Start and End Date
td { (start_date) }
td { (end_date) }
// Attepts
td class="text-center" { (try_number) }
}
} @else {
tr
id={ "row_" (task.task_id) }
class="hover:bg-base-300" {
td { (task.task_id) }
// Task State Badge
(state_cell)
// Start and End Date
td { (start_date) }
td { (end_date) }
// Attepts
td {}
}
@match task.try_number {
Some(try_number) if try_number > 0 => {
tr
id={ "row_" (task.task_id) }
class="hover:bg-base-300 cursor-pointer"
onclick={ "window.location='/logs/" (task.run_id) "/" (task.task_id) "';" } {
td { (task.task_id) }
// Task State Badge
(state_cell)
// Start and End Date
td { (start_date) }
td { (end_date) }
// Attepts
td class="text-center" { (try_number) }
}
},
_ => {
tr
id={ "row_" (task.task_id) }
class="hover:bg-base-300" {
td { (task.task_id) }
// Task State Badge
(state_cell)
// Start and End Date
td { (start_date) }
td { (end_date) }
// Attepts
td {}
}
},
}
}
}
Expand Down