Mercurial > prosody-modules
comparison mod_server_status/mod_server_status.lua @ 542:32d9fd110cb1
mod_server_status: corrected error.
| author | Marco Cirillo <maranda@lightwitch.org> |
|---|---|
| date | Tue, 10 Jan 2012 19:46:54 +0000 |
| parents | 947103177844 |
| children | d8614cfe8fc9 |
comparison
equal
deleted
inserted
replaced
| 541:947103177844 | 542:32d9fd110cb1 |
|---|---|
| 97 if show_hosts then | 97 if show_hosts then |
| 98 result.hosts = {} | 98 result.hosts = {} |
| 99 for _,n in ipairs(show_hosts) do result.hosts[n] = hosts[name] and "online" or "offline" end | 99 for _,n in ipairs(show_hosts) do result.hosts[n] = hosts[name] and "online" or "offline" end |
| 100 end | 100 end |
| 101 if show_comps then | 101 if show_comps then |
| 102 result.comps = {} | 102 result.components = {} |
| 103 for _,n in ipairs(show_hosts) do | 103 for _,n in ipairs(show_comps) do |
| 104 result.comps[n] = hosts[name].modules.component and hosts[name].modules.component.connected and "online" or | 104 result.components[n] = hosts[name].modules.component and hosts[name].modules.component.connected and "online" or |
| 105 hosts[name] and hosts[name].modules.component == nil and "online" or "offline" | 105 hosts[name] and hosts[name].modules.component == nil and "online" or "offline" |
| 106 end | 106 end |
| 107 end | 107 end |
| 108 | 108 |
| 109 return json_encode(result) | 109 return json_encode(result) |
