Skip to content

Commit

Permalink
UI(afterfact): changed adjustable rule author table column by termina…
Browse files Browse the repository at this point in the history
…l size #1071
  • Loading branch information
hitenkoku committed Jun 3, 2023
1 parent 8dc73f0 commit cb4e831
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
20 changes: 15 additions & 5 deletions src/afterfact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ fn emit_csv<W: std::io::Write>(
.iter(),
);

let terminal_width = match terminal_size() {
Some((Width(w), _)) => w as usize,
None => 100,
};

if !output_option.no_summary && !rule_author_counter.is_empty() {
write_color_buffer(
&disp_wtr,
Expand All @@ -513,14 +518,19 @@ fn emit_csv<W: std::io::Write>(
.ok();

println!();
output_detected_rule_authors(rule_author_counter, 3);
let table_column_num = if terminal_width < 130 {
3
} else if terminal_width < 170 {
4
} else if terminal_width <= 190 {
5
} else {
6
};
output_detected_rule_authors(rule_author_counter, table_column_num);
println!();
}

let terminal_width = match terminal_size() {
Some((Width(w), _)) => w as usize,
None => 100,
};
println!();
if output_option.visualize_timeline {
_print_timeline_hist(timestamps, terminal_width, 3);
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,7 @@ impl App {
tl.search_dsp_msg(event_timeline_config, stored_static);
}
if stored_static.output_path.is_some() {
println!("Scanning finished. Please wait while the results are being saved.");
println!("\nScanning finished. Please wait while the results are being saved.");
}
println!();
detection.add_aggcondition_msges(&self.rt, stored_static);
Expand Down

0 comments on commit cb4e831

Please sign in to comment.