diff options
author | Kim Alvefur <zash@zash.se> | 2023-05-28 22:33:45 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2023-05-28 22:33:45 +0200 |
commit | 9480954e92895449674183f166af2ad657396f79 (patch) | |
tree | 6155105cc13da8a27846c25d3e7b93b9bd5b697f | |
parent | e6f0e0b9d0065fcc94e1c570e48a64b5587a058b (diff) | |
download | prosody-9480954e92895449674183f166af2ad657396f79.tar.gz prosody-9480954e92895449674183f166af2ad657396f79.zip |
mod_admin_shell: Show internal URL where different from external
-rw-r--r-- | plugins/mod_admin_shell.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/mod_admin_shell.lua b/plugins/mod_admin_shell.lua index aa50b882..8b901031 100644 --- a/plugins/mod_admin_shell.lua +++ b/plugins/mod_admin_shell.lua @@ -1836,9 +1836,13 @@ def_env.http = {}; function def_env.http:list(hosts) local print = self.session.print; hosts = array.collect(set.new({ not hosts and "*" or nil }) + get_hosts_set(hosts)):sort(_sort_hosts); - local output = format_table({ + local output_simple = format_table({ { title = "Module"; width = "1p" }; - { title = "URL"; width = "3p" }; + { title = "External URL"; width = "6p" }; + }, self.session.width); + local output_split = format_table({ + { title = "Module"; width = "1p" }; + { title = "External URL"; width = "3p" }; { title = "Internal URL"; width = "3p" }; }, self.session.width); @@ -1851,14 +1855,14 @@ function def_env.http:list(hosts) else print("HTTP endpoints on "..host..(http_host and (" (using "..http_host.."):") or ":")); end - print(output()); + print(output_split()); for _, provider in ipairs(http_apps) do local mod = provider._provided_by; local external = module:context(host):http_url(provider.name, provider.default_path); local internal = module:context(host):http_url(provider.name, provider.default_path, "internal"); if external==internal then internal="" end mod = mod and "mod_"..mod or "" - print(output{mod, external, internal}); + print((internal=="" and output_simple or output_split){mod, external, internal}); end print(""); end |