Software /
code /
prosody
Changeset
9868:0361e3379dd1
mod_admin_telnet: Show module status in module:list()
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 19 Mar 2019 09:05:37 +0000 |
parents | 9867:984f27e4b8a3 |
children | 9869:7be5477c399e |
files | plugins/mod_admin_telnet.lua |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua Tue Mar 19 09:05:15 2019 +0000 +++ b/plugins/mod_admin_telnet.lua Tue Mar 19 09:05:37 2019 +0000 @@ -480,7 +480,12 @@ end else for _, name in ipairs(modules) do - print(" "..name); + local status, status_text = modulemanager.get_module(host, name).module:get_status(); + local status_summary = ""; + if status == "warn" or status == "error" then + status_summary = (" (%s: %s)"):format(status, status_text); + end + print((" %s%s"):format(name, status_summary)); end end end