Skip to content

Commit 8044322

Browse files
committed
add job name to details window
Provide a way to check long names as the default space is quite small
1 parent 3dfe8dc commit 8044322

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/app.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,8 +464,22 @@ impl App {
464464
Span::raw(s),
465465
]);
466466
}
467-
let state = Line::from(state_spans);
468467

468+
let state = Line::from(state_spans);
469+
if let Some(s) = j.reason.as_deref() {
470+
Span::styled(
471+
format!(" ({s})"),
472+
Style::default().add_modifier(Modifier::DIM),
473+
)
474+
} else {
475+
Span::raw("")
476+
},
477+
]);
478+
let name = Line::from(vec![
479+
Span::styled("Name ", Style::default().fg(Color::Yellow)),
480+
Span::raw(" "),
481+
Span::raw(&j.name),
482+
]);
469483
let command = Line::from(vec![
470484
Span::styled("Command", Style::default().fg(Color::Yellow)),
471485
Span::raw(" "),
@@ -499,7 +513,7 @@ impl App {
499513
),
500514
]);
501515

502-
Text::from(vec![state, command, nodes, tres, stdout])
516+
Text::from(vec![state, name, command, nodes, tres, stdout])
503517
});
504518
let job_detail = Paragraph::new(job_detail.unwrap_or_default()).block(
505519
Block::default()

0 commit comments

Comments
 (0)