trying interactive

This commit is contained in:
Your Name
2025-04-22 19:57:17 +12:00
parent bd0c48f427
commit 4117b3daaf
6 changed files with 449 additions and 3 deletions

View File

@ -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();