WIP:change to comfy_table #463
This commit is contained in:
2
rules
2
rules
Submodule rules updated: 5364222c54...ff5732fa17
@@ -6,5 +6,3 @@ pub mod omikuji;
|
||||
pub mod options;
|
||||
pub mod timeline;
|
||||
pub mod yaml;
|
||||
#[macro_use]
|
||||
extern crate prettytable;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::detections::message::{LOGONSUMMARY_FLAG, STATISTICS_FLAG};
|
||||
use crate::detections::{configs::CONFIG, detection::EvtxRecordInfo};
|
||||
use prettytable::{Cell, Row, Table};
|
||||
use comfy_table::*;
|
||||
|
||||
use super::statistics::EventStatistics;
|
||||
use hashbrown::HashMap;
|
||||
@@ -142,7 +142,7 @@ impl Timeline {
|
||||
}
|
||||
} else {
|
||||
let mut logins_stats_tb = Table::new();
|
||||
logins_stats_tb.set_titles(row!["User", "Failed", "Successful"]);
|
||||
logins_stats_tb.set_header(vec!["User", "Failed", "Successful"]);
|
||||
// 集計件数でソート
|
||||
let mut mapsorted: Vec<_> = self.stats.stats_login_list.iter().collect();
|
||||
mapsorted.sort_by(|x, y| x.0.cmp(y.0));
|
||||
@@ -153,13 +153,13 @@ impl Timeline {
|
||||
//key.to_string().pop();
|
||||
username.pop();
|
||||
username.remove(0);
|
||||
logins_stats_tb.add_row(Row::new(vec![
|
||||
logins_stats_tb.add_row(vec![
|
||||
Cell::new(&username),
|
||||
Cell::new(&values[1].to_string()),
|
||||
Cell::new(&values[0].to_string()),
|
||||
]));
|
||||
]);
|
||||
}
|
||||
logins_stats_tb.printstd();
|
||||
println!("{logins_stats_tb}");
|
||||
println!();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user