mod_admin_telnet: Show which hosts are components and what type of component in host...
authorKim Alvefur <zash@zash.se>
Sun, 11 May 2014 23:07:40 +0000 (01:07 +0200)
committerKim Alvefur <zash@zash.se>
Sun, 11 May 2014 23:07:40 +0000 (01:07 +0200)
plugins/mod_admin_telnet.lua

index a3352b101124edba86755be805359f73889425ba..6a8783e23fd9bce3b06a99ef909df7ee2ec6754e 100644 (file)
@@ -872,9 +872,19 @@ end
 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