diff --git a/src/args.rs b/src/args.rs index 9df5ae9..92f92e7 100644 --- a/src/args.rs +++ b/src/args.rs @@ -99,6 +99,8 @@ pub enum GetCommands { SecondarySsidAuthMode, /// Fetch monthly RX bytes. MonthlyRx, + /// Fetch monthly TX bytes. + MonthlyTx, } #[derive(Subcommand, Debug)] diff --git a/src/main.rs b/src/main.rs index 3554e38..12caf0a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -42,6 +42,7 @@ async fn main() -> EyreResult<()> { GetCommands::PrimarySsidAuthMode => router.show::().await?, GetCommands::SecondarySsidAuthMode => router.show::().await?, GetCommands::MonthlyRx => router.show::().await?, + GetCommands::MonthlyTx => 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 05fea3a..76d1b4b 100644 --- a/src/proc_get.rs +++ b/src/proc_get.rs @@ -717,3 +717,23 @@ impl ProcGet for MonthlyRx { println!("{table}"); } } + +#[derive(Debug, Deserialize)] +pub struct MonthlyTx { + pub monthly_tx_bytes: BoxStr, +} + +impl ProcGet for MonthlyTx { + const CMD: &str = "monthly_tx_bytes"; + type Params = (); + + fn print_table(&self) { + let mut table = create_table(); + + let size = self.monthly_tx_bytes.parse::().unwrap(); + let size = humansize::format_size(size, humansize::DECIMAL); + + table.set_header(["Monthly TX Bytes"]).add_row([&size]); + println!("{table}"); + } +}