smart support over ssh + change response code for smart failure

This commit is contained in:
henrygd
2025-10-26 10:33:34 -04:00
parent e646f2c1fc
commit b107d12a62
2 changed files with 5 additions and 2 deletions

View File

@@ -307,7 +307,7 @@ func (h *Hub) containerRequestHandler(e *core.RequestEvent, fetchFunc func(*syst
data, err := fetchFunc(system, containerID)
if err != nil {
return e.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
return e.JSON(http.StatusNotFound, map[string]string{"error": err.Error()})
}
return e.JSON(http.StatusOK, map[string]string{responseKey: data})
@@ -338,7 +338,7 @@ func (h *Hub) getSmartData(e *core.RequestEvent) error {
}
data, err := system.FetchSmartDataFromAgent()
if err != nil {
return e.JSON(http.StatusInternalServerError, map[string]string{"error": err.Error()})
return e.JSON(http.StatusNotFound, map[string]string{"error": err.Error()})
}
e.Response.Header().Set("Cache-Control", "public, max-age=60")
return e.JSON(http.StatusOK, data)