feat: Add 2 and update 6 files
All checks were successful
Build-Test-Publish / build (linux/amd64) (push) Successful in 1m33s
Build-Test-Publish / build (linux/arm64) (push) Successful in 3m12s

This commit is contained in:
Your Name
2025-09-20 14:34:03 +12:00
parent c8493b92a0
commit a18e3508ce
8 changed files with 262 additions and 7 deletions

View File

@@ -118,9 +118,12 @@ void list_servers() {
std::string ports_used_str = "";
std::set<int> ports_used;
// Check if server is disabled
bool is_disabled = gConfig().is_server_disabled(sup.server.get_server_name());
// Check if server is online (with caching to avoid redundant checks for multiple users)
bool is_online = false;
{
if (!is_disabled) {
auto it = server_online_status.find(sup.server.get_server_name());
if (it != server_online_status.end()) {
is_online = it->second;
@@ -133,8 +136,8 @@ void list_servers() {
}
}
// Only check service status if server is online
if (is_online) {
// Only check service status if server is online and not disabled
if (is_online && !is_disabled) {
std::map<std::string, shared_commands::ServiceStatus> status = shared_commands::get_all_services_status(sup.server.get_server_name(),sup.user.user);
for (const auto& [service_name, service_status] : status) {
@@ -146,12 +149,14 @@ void list_servers() {
ports_used_str += std::to_string(port) + " ";
}
// Add red cross to address if server is offline
// Add red cross to address if server is offline or disabled
std::string address_display = sup.server.get_SSH_HOST();
if (!is_online) {
if (is_disabled) {
address_display += " :disabled:";
} else if (!is_online) {
address_display += " :cross:";
}
// critical section
{
std::lock_guard<std::mutex> lock(tp_mutex);