Change node wizard flow

fixes #8891
This commit is contained in:
Jean-Marcel Flach 2015-04-20 10:51:18 +02:00 committed by Gunnar Beutner
parent 23264a291e
commit 460d858a8e
1 changed files with 27 additions and 11 deletions

View File

@ -160,33 +160,49 @@ wizard_endpoint_loop_start:
endpoint_buffer = answer; endpoint_buffer = answer;
endpoint_buffer.Trim(); endpoint_buffer.Trim();
std::cout << ConsoleColorTag(Console_Bold) << "Please fill out the master connection information:" << ConsoleColorTag(Console_Normal) << "\n"; std::cout << "Do you want to establish a connection to the master " << ConsoleColorTag(Console_Bold) << "now " << ConsoleColorTag(Console_Normal) << " [Y/n]? ";
std::cout << ConsoleColorTag(Console_Bold) << "Master endpoint host" << ConsoleColorTag(Console_Normal) << " (optional, your master's IP address or FQDN): ";
std::getline(std::cin, answer); std::getline (std::cin, answer);
boost::algorithm::to_lower(answer); boost::algorithm::to_lower(answer);
choice = answer;
if (choice.Contains("n")) {
Log(LogWarning, "cli", "Node to master connection setup skipped");
std::cout << "Connection setup skipped, you know hat you are doing.\n";
} else {
std::cout << ConsoleColorTag(Console_Bold) << "Please fill out the master connection information:" << ConsoleColorTag(Console_Normal) << "\n";
std::cout << ConsoleColorTag(Console_Bold) << "Master endpoint host" << ConsoleColorTag(Console_Normal) << " (Your master's IP address or FQDN): ";
std::getline(std::cin, answer);
boost::algorithm::to_lower(answer);
if (answer.empty()) {
Log(LogWarning, "cli", "Please enter the masters endpoint data");
goto wizard_endpoint_loop_start;
}
if (!answer.empty()) {
String tmp = answer; String tmp = answer;
tmp.Trim(); tmp.Trim();
endpoint_buffer += "," + tmp; endpoint_buffer += "," + tmp;
master_endpoint_name = tmp; //store the endpoint name for later master_endpoint_name = tmp; //store the endpoint name for later
}
std::cout << ConsoleColorTag(Console_Bold) << "Master endpoint port" << ConsoleColorTag(Console_Normal) << " (optional) []: "; std::cout << ConsoleColorTag(Console_Bold) << "Master endpoint port" << ConsoleColorTag(Console_Normal) << " [5665]: ";
std::getline(std::cin, answer); std::getline(std::cin, answer);
boost::algorithm::to_lower(answer); boost::algorithm::to_lower(answer);
if (!answer.empty())
tmp = answer;
else
tmp = "5665";
if (!answer.empty()) {
String tmp = answer;
tmp.Trim(); tmp.Trim();
endpoint_buffer += "," + answer; endpoint_buffer += "," + answer;
} }
endpoints.push_back(endpoint_buffer); endpoints.push_back(endpoint_buffer);
std::cout << ConsoleColorTag(Console_Bold) << "Add more master endpoints?" << ConsoleColorTag(Console_Normal) << " [y/N]"; std::cout << ConsoleColorTag(Console_Bold) << "Add more master endpoints?" << ConsoleColorTag(Console_Normal) << " [y/N]: ";
std::getline (std::cin, answer); std::getline (std::cin, answer);
boost::algorithm::to_lower(answer); boost::algorithm::to_lower(answer);