Software /
code /
prosody
Comparison
plugins/mod_admin_adhoc.lua @ 5326:e96361eb8286
mod_admin_adhoc: Fix info message for module reload/unload
author | Florian Zeitz <florob@babelmonkeys.de> |
---|---|
date | Wed, 06 Feb 2013 00:53:49 +0100 |
parent | 5325:97bf651e32a4 |
child | 5327:b0c36b043f00 |
comparison
equal
deleted
inserted
replaced
5325:97bf651e32a4 | 5326:e96361eb8286 |
---|---|
542 ok_list[#ok_list + 1] = module; | 542 ok_list[#ok_list + 1] = module; |
543 else | 543 else |
544 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")"; | 544 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")"; |
545 end | 545 end |
546 end | 546 end |
547 local info = (#ok_list > 0 and ("The following modules were successfully reloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "").. | 547 local info = (#ok_list > 0 and ("The following modules were successfully reloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "") |
548 .. ((#ok_list > 0 and #err_list > 0) and "\n" or "") .. | |
548 (#err_list > 0 and ("Failed to reload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or ""); | 549 (#err_list > 0 and ("Failed to reload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or ""); |
549 return { status = "completed", info = info }; | 550 return { status = "completed", info = info }; |
550 else | 551 else |
551 local modules = array.collect(keys(hosts[data.to].modules)):sort(); | 552 local modules = array.collect(keys(hosts[data.to].modules)):sort(); |
552 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; | 553 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; |
640 ok_list[#ok_list + 1] = module; | 641 ok_list[#ok_list + 1] = module; |
641 else | 642 else |
642 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")"; | 643 err_list[#err_list + 1] = module .. "(Error: " .. tostring(err) .. ")"; |
643 end | 644 end |
644 end | 645 end |
645 local info = (#ok_list > 0 and ("The following modules were successfully unloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "").. | 646 local info = (#ok_list > 0 and ("The following modules were successfully unloaded on host "..data.to..":\n"..t_concat(ok_list, "\n")) or "") |
647 .. ((#ok_list > 0 and #err_list > 0) and "\n" or "") .. | |
646 (#err_list > 0 and ("Failed to unload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or ""); | 648 (#err_list > 0 and ("Failed to unload the following modules on host "..data.to..":\n"..t_concat(err_list, "\n")) or ""); |
647 return { status = "completed", info = info }; | 649 return { status = "completed", info = info }; |
648 else | 650 else |
649 local modules = array.collect(keys(hosts[data.to].modules)):sort(); | 651 local modules = array.collect(keys(hosts[data.to].modules)):sort(); |
650 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; | 652 return { status = "executing", actions = {"next", "complete", default = "complete"}, form = { layout = layout; values = { modules = modules } } }, "executing"; |