various: simplify code; work on security and performance
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9a5114addcab5fbff430ab2b919b83466a6a6964
This commit is contained in:
parent
016841b200
commit
c4adc4e3e0
75 changed files with 12921 additions and 358 deletions
|
|
@ -15,14 +15,17 @@ pub fn render(f: &mut Frame, state: &AppState, area: Rect) {
|
|||
} else {
|
||||
let mut list_items = Vec::new();
|
||||
for (i, group) in state.duplicate_groups.iter().enumerate() {
|
||||
// Show truncated hash (first 16 chars) for identification
|
||||
let hash_display = if group.content_hash.len() > 16 {
|
||||
&group.content_hash[..16]
|
||||
} else {
|
||||
&group.content_hash
|
||||
};
|
||||
let header = format!(
|
||||
"Group {} ({} items, hash: {})",
|
||||
"Group {} ({} items, hash: {}...)",
|
||||
i + 1,
|
||||
group.len(),
|
||||
group
|
||||
.first()
|
||||
.map(|m| m.content_hash.as_str())
|
||||
.unwrap_or("?")
|
||||
group.items.len(),
|
||||
hash_display
|
||||
);
|
||||
list_items.push(ListItem::new(Line::from(Span::styled(
|
||||
header,
|
||||
|
|
@ -30,7 +33,7 @@ pub fn render(f: &mut Frame, state: &AppState, area: Rect) {
|
|||
.fg(Color::Yellow)
|
||||
.add_modifier(Modifier::BOLD),
|
||||
))));
|
||||
for item in group {
|
||||
for item in &group.items {
|
||||
let line = format!(" {} - {}", item.file_name, item.path);
|
||||
let is_selected = state
|
||||
.duplicates_selected
|
||||
|
|
|
|||
|
|
@ -37,9 +37,15 @@ pub fn render(f: &mut Frame, state: &AppState, area: Rect) {
|
|||
.map(super::format_date)
|
||||
.unwrap_or("-");
|
||||
let status = task.last_status.as_deref().unwrap_or("-");
|
||||
// Show abbreviated task ID (first 8 chars)
|
||||
let task_id_short = if task.id.len() > 8 {
|
||||
&task.id[..8]
|
||||
} else {
|
||||
&task.id
|
||||
};
|
||||
|
||||
let text = format!(
|
||||
" {enabled_marker} {:<20} {:<16} Last: {:<12} Next: {:<12} Status: {}",
|
||||
" {enabled_marker} [{task_id_short}] {:<20} {:<16} Last: {:<12} Next: {:<12} Status: {}",
|
||||
task.name, task.schedule, last_run, next_run, status
|
||||
);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue