mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-10-22 15:12:23 +00:00
add constant ReportCol::FILTER_COLUMNS_WIDTH
This commit is contained in:
parent
957e30012b
commit
fcfd865624
2 changed files with 3 additions and 4 deletions
|
|
@ -559,10 +559,7 @@ fn get_agglomerates_row<'a>(
|
|||
tot_out_bytes: u128,
|
||||
) -> Row<'a, Message, StyleType> {
|
||||
let tot_bytes = tot_in_bytes + tot_out_bytes;
|
||||
let width = ReportCol::ALL
|
||||
.iter()
|
||||
.filter(|x| *x != &ReportCol::Bytes && *x != &ReportCol::Packets)
|
||||
.fold(0.0, |acc, x| acc + x.get_width());
|
||||
let width = ReportCol::FILTER_COLUMNS_WIDTH;
|
||||
#[allow(clippy::cast_precision_loss)]
|
||||
let in_length = width * (tot_in_bytes as f32 / tot_bytes as f32);
|
||||
let out_length = width - in_length;
|
||||
|
|
|
|||
|
|
@ -41,6 +41,8 @@ impl ReportCol {
|
|||
ReportCol::Packets,
|
||||
];
|
||||
|
||||
pub(crate) const FILTER_COLUMNS_WIDTH: f32 = 4.0 * SMALL_COL_WIDTH + 2.0 * LARGE_COL_WIDTH;
|
||||
|
||||
pub(crate) fn get_title(&self, language: Language) -> String {
|
||||
match self {
|
||||
ReportCol::SrcIp | ReportCol::DstIp => address_translation(language).to_string(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue