diff --git a/internal/store/store.go b/internal/store/store.go index 99fb93b42..9472760ef 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -201,6 +201,7 @@ type ComposeEntry struct { Blueprint string `json:"blueprint"` Version string `json:"version"` ComposeType string `json:"compose_type"` + ImageSize int64 `json:"image_size"` QueueStatus string `json:"queue_status"` JobCreated float64 `json:"job_created"` JobStarted float64 `json:"job_started,omitempty"` @@ -232,7 +233,24 @@ func (s *Store) ListQueue(uuids []uuid.UUID) []*ComposeEntry { JobCreated: float64(compose.JobCreated.UnixNano()) / 1000000000, JobStarted: float64(compose.JobStarted.UnixNano()) / 1000000000, } - case "FAILED", "FINISHED": + case "FINISHED": + image, err := s.GetImage(id) + imageSize := int64(0) + if err == nil { + imageSize = image.Size + } + return &ComposeEntry{ + ID: id, + Blueprint: compose.Blueprint.Name, + Version: compose.Blueprint.Version, + ComposeType: compose.OutputType, + ImageSize: imageSize, + QueueStatus: compose.QueueStatus, + JobCreated: float64(compose.JobCreated.UnixNano()) / 1000000000, + JobStarted: float64(compose.JobStarted.UnixNano()) / 1000000000, + JobFinished: float64(compose.JobFinished.UnixNano()) / 1000000000, + } + case "FAILED": return &ComposeEntry{ ID: id, Blueprint: compose.Blueprint.Name, diff --git a/internal/weldr/api.go b/internal/weldr/api.go index 94046ac5b..b1cc419a8 100644 --- a/internal/weldr/api.go +++ b/internal/weldr/api.go @@ -299,7 +299,7 @@ func (api *API) modulesListHandler(writer http.ResponseWriter, request *http.Req if total > offset && total < end { modules = append(modules, modulesListModule{pkg.Name, "rpm"}) // this removes names that have been found from the list of names - if len(names) < i - 1 { + if len(names) < i-1 { names = append(names[:i], names[i+1:]...) } else { names = names[:i]