trying interactive
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "server_env.hpp"
|
||||
#include "server_service.hpp"
|
||||
#include "tableprint.hpp"
|
||||
#include "interactive/interactive.hpp"
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
@ -51,6 +52,27 @@ std::vector<ServerInfo> get_configured_servers() {
|
||||
return servers;
|
||||
}
|
||||
|
||||
void interactive_mode() {
|
||||
interactive::fullscreen_window iw("DropShell Servers");
|
||||
auto servers = get_configured_servers();
|
||||
std::vector<std::string> server_names;
|
||||
for (const auto& server : servers) {
|
||||
server_names.push_back(server.name);
|
||||
}
|
||||
|
||||
list_servers();
|
||||
|
||||
std::string server_name = iw.set_input_multiple_choice("Select a server", server_names);
|
||||
if (server_name.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
iw.close();
|
||||
|
||||
show_server_details(server_name);
|
||||
|
||||
}
|
||||
|
||||
void list_servers() {
|
||||
auto servers = get_configured_servers();
|
||||
|
||||
|
Reference in New Issue
Block a user