From 40b992efebabaf3227d5b725a902128375dc1695 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 23 Apr 2025 23:25:51 +1200 Subject: [PATCH] tidy table a little. --- src/interactive/interactive.cpp | 9 +++++++++ src/servers.cpp | 13 +++++++------ src/tableprint.cpp | 4 ++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/interactive/interactive.cpp b/src/interactive/interactive.cpp index a55b121..126f17a 100644 --- a/src/interactive/interactive.cpp +++ b/src/interactive/interactive.cpp @@ -181,6 +181,13 @@ void process_line(WINDOW* win, const std::string& text, const std::map(text[pos]); + if (ch < 32 && ch != '\t' && ch != '\n' && ch != '\r') { + pos++; + continue; + } + // Print the character as-is waddch(win, text[pos]); pos++; @@ -286,6 +293,8 @@ fullscreen_window::~fullscreen_window() { void fullscreen_window::clear_display() { werase(display_win); + wclear(display_win); // Also call wclear for complete clearing + wmove(display_win, 0, 0); // Move cursor to top-left position wrefresh(display_win); } diff --git a/src/servers.cpp b/src/servers.cpp index d25ca2f..8acbae9 100644 --- a/src/servers.cpp +++ b/src/servers.cpp @@ -109,12 +109,12 @@ void show_server_details(const std::string& server_name) { if (result == 0) { std::cout << "Status: Online" << std::endl; - // Get uptime if possible - cmd = "ssh " + ssh_address + " 'uptime' 2>/dev/null"; - int rval = system(cmd.c_str()); - if (rval != 0) { - std::cout << "Error: Failed to get uptime" << std::endl; - } + // // Get uptime if possible + // cmd = "ssh " + ssh_address + " 'uptime' 2>/dev/null"; + // int rval = system(cmd.c_str()); + // if (rval != 0) { + // std::cout << "Error: Failed to get uptime" << std::endl; + // } } else { std::cout << "Status: Offline" << std::endl; } @@ -123,6 +123,7 @@ void show_server_details(const std::string& server_name) { //--------------------- { + std::cout << std::endl; tableprint tp("Server Configuration: " + server_name, true); tp.add_row({"Key", "Value"}); for (const auto& [key, value] : env.get_variables()) { diff --git a/src/tableprint.cpp b/src/tableprint.cpp index 22bbcec..821cfce 100644 --- a/src/tableprint.cpp +++ b/src/tableprint.cpp @@ -195,7 +195,7 @@ void tableprint::print() { std::cout << "+"; for (size_t i = 0; i < rows[0].size(); ++i) { std::cout << std::string(col_widths[i] + 2, '-'); - if (i < rows[0].size() - 1) std::cout << "+"; + if (i < rows[0].size() - 1) std::cout << "-"; } std::cout << "+" << std::endl; @@ -219,7 +219,7 @@ void tableprint::print() { } else { // Print top border if no title std::cout << "\033[90m"; // Dark grey color for borders - std::cout << "┌"; + std::cout << "+"; for (size_t i = 0; i < rows[0].size(); ++i) { std::cout << std::string(col_widths[i] + 2, '-'); if (i < rows[0].size() - 1) std::cout << "+";