diff --git a/src/routes.rs b/src/routes.rs index 6066420..9ecb77f 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -16,7 +16,7 @@ use std::fs; pub fn home() -> Template { let show_config_cmd = wg_cmd(vec!["show".to_string()]); let whoami = sh_cmd("whoami".to_string()); - let uptime = sh_cmd("uptime".to_string()); + let w = sh_cmd("w".to_string()); let hostname = sh_cmd("hostname".to_string()); let netstat_info = sh_cmd("netstat -tan | grep \"ESTABLISHED\\|CLOSE_WAIT\"".to_string()); let shell_ps1 = format!( @@ -26,7 +26,7 @@ pub fn home() -> Template { ); let context: JsonValue = json!({ "show_config": show_config_cmd.0.trim_end(), - "uptime": uptime.trim_end(), + "w": w.trim_end(), "netstat_info": netstat_info, "shell_ps1": shell_ps1, }); diff --git a/templates/home.html.tera b/templates/home.html.tera index 416bce0..361accf 100644 --- a/templates/home.html.tera +++ b/templates/home.html.tera @@ -10,8 +10,8 @@

The current tunnel configuration and stats are shown below.

-{{ shell_ps1 }} uptime -{{ uptime }} +{{ shell_ps1 }} w +{{ w }} {{ shell_ps1 }} wg show {% if show_config %}{{ show_config }}{% else %}It doesn't look like the tunnel interface is up yet.{% endif %}