Tidying
This commit is contained in:
@ -131,6 +131,7 @@ void show_server_details(const std::string& server_name) {
|
||||
|
||||
//---------------------
|
||||
// list services, and run healthcheck on each
|
||||
std::cout << std::endl;
|
||||
std::cout << "Services: " << server_name << std::endl;
|
||||
std::cout << std::string(40, '-') << std::endl;
|
||||
|
||||
@ -140,13 +141,26 @@ void show_server_details(const std::string& server_name) {
|
||||
std::vector<std::string> services = get_server_services(server_name);
|
||||
for (const auto& service : services) {
|
||||
bool healthy = false;
|
||||
std::vector<int> ports;
|
||||
server_service ss;
|
||||
if (ss.init(server_name, service))
|
||||
{
|
||||
if (ss.is_healthy())
|
||||
healthy=true;
|
||||
|
||||
std::cout << service << ": " << (healthy ? green_tick : red_cross) << std::endl;
|
||||
}
|
||||
ports = ss.get_ports();
|
||||
}
|
||||
std::cout << " " << (healthy ? green_tick : red_cross) << " " << service << ", ports: ";
|
||||
std::cout << "(";
|
||||
bool first = true;
|
||||
for (const auto& port : ports) {
|
||||
if (!first) {
|
||||
std::cout << ", ";
|
||||
}
|
||||
std::cout << port;
|
||||
first = false;
|
||||
}
|
||||
std::cout << ")" << std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user