feat: Add 2 and update 6 files
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user