diff --git a/src/args.rs b/src/args.rs index 92f92e7..39f64c1 100644 --- a/src/args.rs +++ b/src/args.rs @@ -101,6 +101,8 @@ pub enum GetCommands { MonthlyRx, /// Fetch monthly TX bytes. MonthlyTx, + /// Fetch realtime RX bytes. + RealtimeRx, } #[derive(Subcommand, Debug)] diff --git a/src/main.rs b/src/main.rs index 12caf0a..a793d50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,6 +43,7 @@ async fn main() -> EyreResult<()> { GetCommands::SecondarySsidAuthMode => router.show::().await?, GetCommands::MonthlyRx => router.show::().await?, GetCommands::MonthlyTx => router.show::().await?, + GetCommands::RealtimeRx => router.show::().await?, }, TopLevelCommands::Post { command } => match command { PostCommands::Reboot => router.reboot().await.print_table(), diff --git a/src/proc_get.rs b/src/proc_get.rs index 76d1b4b..a327a8d 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -737,3 +737,23 @@ impl ProcGet for MonthlyTx { println!("{table}"); } } + +#[derive(Debug, Deserialize)] +pub struct RealtimeRx { + pub realtime_rx_bytes: BoxStr, +} + +impl ProcGet for RealtimeRx { + const CMD: &str = "realtime_rx_bytes"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + + let size = self.realtime_rx_bytes.parse::().unwrap(); + let size = humansize::format_size(size, humansize::DECIMAL); + + table.set_header(["Realtime RX Bytes"]).add_row([&size]); + println!("{table}"); + } +}