This commit is contained in:
John
2025-04-27 13:51:36 +12:00
parent c35fabe6e7
commit 13b1327da7
12 changed files with 11 additions and 63 deletions

View File

@ -79,7 +79,7 @@ std::string server_env::construct_standard_command_run_cmd(const std::string &se
std::map<std::string, std::string> env_vars;
get_all_service_env_vars(service_name, env_vars);
std::string argstr = quote(remote_service_config_path);
std::string argstr = "";
for (const auto& arg : args) {
argstr += " " + quote(dequote(trim(arg)));
}

View File

@ -274,14 +274,7 @@ HealthStatus service_runner::is_healthy()
return HealthStatus::ERROR;
}
// Check if status script exists
std::string command = "status";
if (!template_command_exists(m_service_info.template_name, command)) {
return HealthStatus::UNKNOWN;
}
std::string script_path = mRemote_service_template_path + "/" + command + ".sh";
std::string script_path = get_remote_service_template_path(m_server_name, m_service_info.service_name) + "/status.sh";
if (!m_server_env.check_remote_file_exists(script_path)) {
std::cerr << "Service is not installed: " << m_service_info.service_name << std::endl;
return HealthStatus::NOTINSTALLED;
@ -319,7 +312,7 @@ std::string service_runner::HealthStatus2String(HealthStatus status)
else if (status == HealthStatus::UNHEALTHY)
return ":cross:";
else if (status == HealthStatus::UNKNOWN)
return ":question:";
return ":greytick:";
else if (status == HealthStatus::NOTINSTALLED)
return ":warning:";
else

View File

@ -36,7 +36,9 @@ const std::map<std::string, coloredText> kReplacements = {
{":check:", {"+", kTextColor_Green}},
{":x:", {"x", kTextColor_Red}},
{":error:", {"!", kTextColor_Red}},
{":question:", {"?", kTextColor_DarkGrey}}
{":question:", {"?", kTextColor_DarkGrey}},
{":greytick:", {"+", kTextColor_LightGrey}},
{":greycross:", {"x", kTextColor_LightGrey}}
};
// Helper function to get ANSI color code