Mercurial > prosody-modules
comparison mod_server_status/mod_server_status.lua @ 544:f78a95aa23c4
mod_server_status: corrected mistake in the code.
| author | Marco Cirillo <maranda@lightwitch.org> |
|---|---|
| date | Tue, 10 Jan 2012 19:57:06 +0000 |
| parents | d8614cfe8fc9 |
| children | 0afe88f9bdde |
comparison
equal
deleted
inserted
replaced
| 543:d8614cfe8fc9 | 544:f78a95aa23c4 |
|---|---|
| 94 local result = {} | 94 local result = {} |
| 95 | 95 |
| 96 if prosody.stanza_counter then result.stanzas = {} ; result.stanzas = prosody.stanza_counter end | 96 if prosody.stanza_counter then result.stanzas = {} ; result.stanzas = prosody.stanza_counter end |
| 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[n] and "online" or "offline" end |
| 100 end | 100 end |
| 101 if show_comps then | 101 if show_comps then |
| 102 result.components = {} | 102 result.components = {} |
| 103 for _,n in ipairs(show_comps) do | 103 for _,n in ipairs(show_comps) do |
| 104 result.components[n] = hosts[name].modules.component and hosts[name].modules.component.connected and "online" or | 104 result.components[n] = hosts[n].modules.component and hosts[n].modules.component.connected and "online" or |
| 105 hosts[name] and hosts[name].modules.component == nil and "online" or "offline" | 105 hosts[n] and hosts[n].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) |
| 110 end | 110 end |
