nice disable of servers
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m0s
Build-Test-Publish / build (linux/arm64) (push) Successful in 1m18s

This commit is contained in:
Your Name
2025-09-20 14:48:24 +12:00
parent a18e3508ce
commit 23fb68903c
3 changed files with 67 additions and 15 deletions

View File

@@ -40,7 +40,8 @@ const std::map<std::string, coloredText> kReplacements = {
{":error:", {"!", kTextColor_Red}},
{":question:", {"?", kTextColor_DarkGrey}},
{":greytick:", {"+", kTextColor_LightGrey}},
{":greycross:", {"x", kTextColor_LightGrey}}
{":greycross:", {"x", kTextColor_LightGrey}},
{":disabled:", {"", kTextColor_DarkGrey}} // Special marker for disabled rows
};
// Helper function to get ANSI color code
@@ -285,11 +286,26 @@ void tableprint::print() {
// Print rows
for (size_t row_idx = 1; row_idx < rows.size(); ++row_idx) {
const auto& row = rows[row_idx];
// Check if this row contains :disabled: marker
bool is_disabled = false;
for (const auto& cell : row) {
if (cell.find(":disabled:") != std::string::npos) {
is_disabled = true;
break;
}
}
dropshell::info << "\033[90m"; // Dark grey color for borders
dropshell::info << "|";
for (size_t i = 0; i < row.size(); ++i) {
// Set the appropriate color for the row
std::string rowcolor = (row_idx % 2 == 1) ? "\033[38;5;142m" : "\033[38;5;250m";
std::string rowcolor;
if (is_disabled) {
rowcolor = "\033[90m"; // Dark grey for disabled servers
} else {
rowcolor = (row_idx % 2 == 1) ? "\033[38;5;142m" : "\033[38;5;250m";
}
dropshell::info << width_print_left(row[i],col_widths[i]+2,rowcolor);
dropshell::info << "\033[90m" << "|";
}