status updates

This commit is contained in:
Fran Jurmanović
2025-05-06 23:46:02 +02:00
parent d5140783ca
commit a1bcc080f1
9 changed files with 175 additions and 61 deletions

View File

@@ -69,7 +69,7 @@ func (ac *ApiController) getStatus(c *fiber.Ctx) error {
if err != nil {
return c.Status(400).SendString(strings.ReplaceAll(err.Error(), "\x00", ""))
}
return c.SendString(apiModel)
return c.SendString(string(apiModel))
}
// startServer starts service

View File

@@ -58,11 +58,7 @@ func (ac *ConfigController) updateConfig(c *fiber.Ctx) error {
return c.Status(400).SendString(err.Error())
}
if restart {
serviceName, err := ac.apiService.GetServiceName(c)
if err != nil {
return c.Status(400).JSON(fiber.Map{"error": "Unable to restart service"})
}
ac.apiService.RestartServer(serviceName)
ac.apiService.ApiRestartServer(c)
}
return c.JSON(ConfigModel)