mirror of
https://github.com/ClementTsang/bottom
synced 2025-02-16 13:18:28 +00:00
rustfmt
This commit is contained in:
parent
520af2b68f
commit
75a1934420
7 changed files with 29 additions and 29 deletions
|
@ -8,8 +8,8 @@ use data_harvester::{processes, temperature};
|
||||||
|
|
||||||
use crate::{canvas, constants, utils::error::Result};
|
use crate::{canvas, constants, utils::error::Result};
|
||||||
|
|
||||||
pub mod data_harvester;
|
|
||||||
pub mod data_farmer;
|
pub mod data_farmer;
|
||||||
|
pub mod data_harvester;
|
||||||
mod process_killer;
|
mod process_killer;
|
||||||
|
|
||||||
const MAX_SEARCH_LENGTH: usize = 200;
|
const MAX_SEARCH_LENGTH: usize = 200;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
use std::vec::Vec;
|
use std::vec::Vec;
|
||||||
|
|
||||||
use crate::data_harvester::{cpu, Data, disks, mem, network, processes, temperature};
|
use crate::data_harvester::{cpu, disks, mem, network, processes, temperature, Data};
|
||||||
|
|
||||||
pub type TimeOffset = f64;
|
pub type TimeOffset = f64;
|
||||||
pub type Value = f64;
|
pub type Value = f64;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use std::{
|
use std::{
|
||||||
collections::{hash_map::RandomState, HashMap},
|
collections::{hash_map::RandomState, HashMap},
|
||||||
process::Command,
|
process::Command,
|
||||||
time::Instant,
|
time::Instant,
|
||||||
};
|
};
|
||||||
|
|
||||||
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
||||||
|
|
|
@ -3,10 +3,10 @@ use std::process::Command;
|
||||||
// Copied from SO: https://stackoverflow.com/a/55231715
|
// Copied from SO: https://stackoverflow.com/a/55231715
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
use winapi::{
|
use winapi::{
|
||||||
shared::{minwindef::DWORD, ntdef::HANDLE},
|
shared::{minwindef::DWORD, ntdef::HANDLE},
|
||||||
um::{
|
um::{
|
||||||
processthreadsapi::{OpenProcess, TerminateProcess},
|
processthreadsapi::{OpenProcess, TerminateProcess},
|
||||||
winnt::{PROCESS_QUERY_INFORMATION, PROCESS_TERMINATE},
|
winnt::{PROCESS_QUERY_INFORMATION, PROCESS_TERMINATE},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,12 @@ use std::cmp::max;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use tui::{
|
use tui::{
|
||||||
backend,
|
backend,
|
||||||
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
layout::{Alignment, Constraint, Direction, Layout, Rect},
|
||||||
style::{Color, Style},
|
style::{Color, Style},
|
||||||
Terminal,
|
terminal::Frame,
|
||||||
terminal::Frame,
|
widgets::{Axis, Block, Borders, Chart, Dataset, Marker, Paragraph, Row, Table, Text, Widget},
|
||||||
widgets::{Axis, Block, Borders, Chart, Dataset, Marker, Paragraph, Row, Table, Text, Widget},
|
Terminal,
|
||||||
};
|
};
|
||||||
use unicode_segmentation::UnicodeSegmentation;
|
use unicode_segmentation::UnicodeSegmentation;
|
||||||
use unicode_width::UnicodeWidthStr;
|
use unicode_width::UnicodeWidthStr;
|
||||||
|
@ -16,10 +16,10 @@ use canvas_colours::*;
|
||||||
use drawing_utils::*;
|
use drawing_utils::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
app::{self, data_harvester::processes::ProcessHarvest, WidgetPosition},
|
app::{self, data_harvester::processes::ProcessHarvest, WidgetPosition},
|
||||||
constants::*,
|
constants::*,
|
||||||
data_conversion::{ConvertedCpuData, ConvertedProcessData},
|
data_conversion::{ConvertedCpuData, ConvertedProcessData},
|
||||||
utils::error,
|
utils::error,
|
||||||
};
|
};
|
||||||
|
|
||||||
mod canvas_colours;
|
mod canvas_colours;
|
||||||
|
|
|
@ -6,13 +6,13 @@ use std::collections::HashMap;
|
||||||
use constants::*;
|
use constants::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
app::{
|
app::{
|
||||||
App,
|
data_farmer,
|
||||||
data_farmer,
|
data_harvester::{self, processes::ProcessHarvest},
|
||||||
data_harvester::{self, processes::ProcessHarvest},
|
App,
|
||||||
},
|
},
|
||||||
constants,
|
constants,
|
||||||
utils::gen_util::{get_exact_byte_values, get_simple_byte_values},
|
utils::gen_util::{get_exact_byte_values, get_simple_byte_values},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Default, Debug)]
|
#[derive(Default, Debug)]
|
||||||
|
|
|
@ -20,20 +20,20 @@ use std::{
|
||||||
|
|
||||||
use crossterm::{
|
use crossterm::{
|
||||||
event::{
|
event::{
|
||||||
DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode, KeyEvent, KeyModifiers, MouseEvent,
|
poll, read, DisableMouseCapture, EnableMouseCapture, Event as CEvent, KeyCode, KeyEvent,
|
||||||
poll, read,
|
KeyModifiers, MouseEvent,
|
||||||
},
|
},
|
||||||
execute,
|
execute,
|
||||||
style::Print,
|
style::Print,
|
||||||
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen},
|
|
||||||
terminal::LeaveAlternateScreen,
|
terminal::LeaveAlternateScreen,
|
||||||
|
terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen},
|
||||||
};
|
};
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use tui::{backend::CrosstermBackend, Terminal};
|
use tui::{backend::CrosstermBackend, Terminal};
|
||||||
|
|
||||||
use app::{
|
use app::{
|
||||||
App,
|
|
||||||
data_harvester::{self, processes::ProcessSorting},
|
data_harvester::{self, processes::ProcessSorting},
|
||||||
|
App,
|
||||||
};
|
};
|
||||||
use constants::*;
|
use constants::*;
|
||||||
use data_conversion::*;
|
use data_conversion::*;
|
||||||
|
|
Loading…
Add table
Reference in a new issue