working on system management

This commit is contained in:
Warp Agent
2025-12-26 17:47:20 +00:00
parent 5e63ebc9fe
commit ec0ba85958
19 changed files with 969 additions and 128 deletions

View File

@@ -115,3 +115,19 @@ func (h *Handler) GenerateSupportBundle(c *gin.Context) {
c.JSON(http.StatusAccepted, gin.H{"task_id": taskID})
}
// ListNetworkInterfaces lists all network interfaces
func (h *Handler) ListNetworkInterfaces(c *gin.Context) {
interfaces, err := h.service.ListNetworkInterfaces(c.Request.Context())
if err != nil {
h.logger.Error("Failed to list network interfaces", "error", err)
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to list network interfaces"})
return
}
// Ensure we return an empty array instead of null
if interfaces == nil {
interfaces = []NetworkInterface{}
}
c.JSON(http.StatusOK, gin.H{"interfaces": interfaces})
}