# HG changeset patch # User Kim Alvefur # Date 1399849660 -7200 # Node ID 50ddaec11f2a18e45ad0fb5c440e316fb94f0780 # Parent 513ea94761b2497a96bd17f9e3a129b9de11e817 mod_admin_telnet: Show which hosts are components and what type of component in host:list() diff -r 513ea94761b2 -r 50ddaec11f2a plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sun May 11 19:13:36 2014 +0200 +++ b/plugins/mod_admin_telnet.lua Mon May 12 01:07:40 2014 +0200 @@ -872,9 +872,19 @@ function def_env.host:list() local print = self.session.print; local i = 0; + local type; for host in values(array.collect(keys(prosody.hosts)):sort()) do i = i + 1; - print(host); + type = hosts[host].type; + if type == "local" then + print(host); + else + type = module:context(host):get_option_string("component_module", type); + if type ~= "component" then + type = type .. " component"; + end + print(("%s (%s)"):format(host, type)); + end end return true, i.." hosts"; end