Minor UX Tweaks

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto
2025-03-04 22:01:00 +01:00
parent 5dd4b9cb65
commit 758a73e8ab
5 changed files with 165 additions and 68 deletions

View File

@@ -97,9 +97,9 @@ func statusJSONMessage(c *fiber.Ctx, message string) error {
func (a *App) Pause(pool *state.AgentPool) func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
xlog.Info("Pausing agent", c.Params("name"))
agent := pool.GetAgent(c.Params("name"))
if agent != nil {
xlog.Info("Pausing agent", "name", c.Params("name"))
agent.Pause()
}
return statusJSONMessage(c, "ok")
@@ -110,6 +110,7 @@ func (a *App) Start(pool *state.AgentPool) func(c *fiber.Ctx) error {
return func(c *fiber.Ctx) error {
agent := pool.GetAgent(c.Params("name"))
if agent != nil {
xlog.Info("Starting agent", "name", c.Params("name"))
agent.Resume()
}
return statusJSONMessage(c, "ok")