Skip to content

Modern Docker Management, Designed for Everyone

feat: updated table UX, additional 'all' rows option (#1547)

Chase Baucomf8af6fb44a79
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index da2c85f73..803b23860 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,13 +31,11 @@ jobs:
timeout: 30
gcc: true
cgo_enabled: "1"
- coverage_name: backend-coverage
- name: cli
path: cli
timeout: 10
gcc: false
cgo_enabled: "1"
- coverage_name: cli-coverage
defaults:
run:
working-directory: ${{ matrix.module.path }}
@@ -79,14 +77,9 @@ jobs:
if: always()
uses: actions/upload-artifact@v6
with:
- name: ${{ matrix.module.coverage_name }}
+ name: ${{ matrix.module.name }}-coverage
path: ${{ matrix.module.path }}/coverage.txt
- - name: Upload coverage reports to Codecov
- uses: codecov/codecov-action@v5
- with:
- token: ${{ secrets.CODECOV_TOKEN }}
-
go-linter:
name: Go Linter (${{ matrix.module.name }})
runs-on: depot-ubuntu-24.04-16
diff --git a/.gitignore b/.gitignore
index 736b8b641..f3b080751 100644
--- a/.gitignore
+++ b/.gitignore
@@ -44,3 +44,7 @@ tests/package-lock.json
.fast-check
*.out
arcane-devcli
+
+
+# btca
+.btca
\ No newline at end of file
diff --git a/backend/internal/huma/handlers/containers.go b/backend/internal/huma/handlers/containers.go
index 7139290ca..0590b8f0f 100644
--- a/backend/internal/huma/handlers/containers.go
+++ b/backend/internal/huma/handlers/containers.go
@@ -39,6 +39,7 @@ type ListContainersInput struct {
Start int `query:"start" default:"0" doc:"Start index"`
Limit int `query:"limit" default:"20" doc:"Limit"`
IncludeInternal bool `query:"includeInternal" default:"false" doc:"Include internal containers"`
+ Updates string `query:"updates" doc:"Filter by update status (has_update, up_to_date, error, unknown)"`
}
type ListContainersOutput struct {
@@ -202,6 +203,11 @@ func (h *ContainerHandler) ListContainers(ctx context.Context, input *ListContai
return nil, huma.Error500InternalServerError("service not available")
}
+ filters := make(map[string]string)
+ if input.Updates != "" {
+ filters["updates"] = input.Updates
+ }
+
params := pagination.QueryParams{
SearchQuery: pagination.SearchQuery{Search: input.Search},
SortParams: pagination.SortParams{
@@ -212,6 +218,7 @@ func (h *ContainerHandler) ListContainers(ctx context.Context, input *ListContai
Start: input.Start,
Limit: input.Limit,
},
+ Filters: filters,
}
containers, paginationResp, counts, err := h.containerService.ListContainersPaginated(ctx, params, true, input.IncludeInternal)
diff --git a/backend/internal/huma/handlers/helpers.go b/backend/internal/huma/handlers/helpers.go
index 673265fb1..0a1df622b 100644
--- a/backend/internal/huma/handlers/helpers.go
+++ b/backend/internal/huma/handlers/helpers.go
@@ -18,14 +18,17 @@ func checkAdmin(ctx context.Context) error {
// buildPaginationParams converts query parameters to pagination.QueryParams.
// It supports both the legacy nested style (page/limit) and the standard style (start/limit).
+// A limit of -1 means "show all items" (no pagination).
func buildPaginationParams(page, start, limit int, sortCol, sortDir, search string) pagination.QueryParams {
- if limit < 1 {
+ // limit = -1 means "show all", preserve it; zero or other negative values default to 20
+ if limit < -1 {
limit = 20
}
finalStart := start
- if page > 1 && start == 0 {
+ if page > 1 && start == 0 && limit > 0 {
// Convert page-based to offset-based if page is provided and start is 0
+ // Skip this conversion when limit is -1 (show all)
finalStart = (page - 1) * limit
}
diff --git a/backend/internal/services/container_service.go b/backend/internal/services/container_service.go
index f89bfa34d..fba591ea2 100644
--- a/backend/internal/services/container_service.go
+++ b/backend/internal/services/container_service.go
@@ -443,11 +443,12 @@ func (s *ContainerService) ListContainersPaginated(ctx context.Context, params p
dockerContainers = filterInternalContainers(dockerContainers, includeInternal)
imageIDs := collectImageIDs(dockerContainers)
updateInfoMap := s.getUpdateInfoMap(ctx, imageIDs)
- items := buildContainerSummaries(dockerContainers, updateInfoMap)
+ items := s.buildContainerSummaries(dockerContainers, updateInfoMap)
- result := pagination.SearchOrderAndPaginate(items, params, containerPaginationConfig())
- counts := computeContainerCounts(items)
- paginationResp := buildPaginationResponse(result, params)
+ config := s.buildContainerPaginationConfig()
+ result := pagination.SearchOrderAndPaginate(items, params, config)
+ counts := s.calculateContainerStatusCounts(items)
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, counts, nil
}
@@ -497,7 +498,7 @@ func (s *ContainerService) getUpdateInfoMap(ctx context.Context, imageIDs []stri
return updateInfoMap
}
-func buildContainerSummaries(containers []container.Summary, updateInfoMap map[string]*imagetypes.UpdateInfo) []containertypes.Summary {
+func (s *ContainerService) buildContainerSummaries(containers []container.Summary, updateInfoMap map[string]*imagetypes.UpdateInfo) []containertypes.Summary {
items := make([]containertypes.Summary, 0, len(containers))
for _, dc := range containers {
summary := containertypes.NewSummary(dc)
@@ -509,7 +510,7 @@ func buildContainerSummaries(containers []container.Summary, updateInfoMap map[s
return items
}
-func containerPaginationConfig() pagination.Config[containertypes.Summary] {
+func (s *ContainerService) buildContainerPaginationConfig() pagination.Config[containertypes.Summary] {
return pagination.Config[containertypes.Summary]{
SearchAccessors: []pagination.SearchAccessor[containertypes.Summary]{
func(c containertypes.Summary) (string, error) {
@@ -522,56 +523,82 @@ func containerPaginationConfig() pagination.Config[containertypes.Summary] {
func(c containertypes.Summary) (string, error) { return c.State, nil },
func(c containertypes.Summary) (string, error) { return c.Status, nil },
},
- SortBindings: []pagination.SortBinding[containertypes.Summary]{
- {
- Key: "name",
- Fn: func(a, b containertypes.Summary) int {
- nameA := ""
- if len(a.Names) > 0 {
- nameA = a.Names[0]
- }
- nameB := ""
- if len(b.Names) > 0 {
- nameB = b.Names[0]
- }
- return strings.Compare(nameA, nameB)
- },
+ SortBindings: s.buildContainerSortBindings(),
+ FilterAccessors: s.buildContainerFilterAccessors(),
+ }
+}
+
+func (s *ContainerService) buildContainerSortBindings() []pagination.SortBinding[containertypes.Summary] {
+ return []pagination.SortBinding[containertypes.Summary]{
+ {
+ Key: "name",
+ Fn: func(a, b containertypes.Summary) int {
+ nameA, nameB := "", ""
+ if len(a.Names) > 0 {
+ nameA = a.Names[0]
+ }
+ if len(b.Names) > 0 {
+ nameB = b.Names[0]
+ }
+ return strings.Compare(nameA, nameB)
+ },
+ },
+ {
+ Key: "image",
+ Fn: func(a, b containertypes.Summary) int {
+ return strings.Compare(a.Image, b.Image)
},
- {
- Key: "image",
- Fn: func(a, b containertypes.Summary) int {
- return strings.Compare(a.Image, b.Image)
- },
+ },
+ {
+ Key: "state",
+ Fn: func(a, b containertypes.Summary) int {
+ return strings.Compare(a.State, b.State)
},
- {
- Key: "state",
- Fn: func(a, b containertypes.Summary) int {
- return strings.Compare(a.State, b.State)
- },
+ },
+ {
+ Key: "status",
+ Fn: func(a, b containertypes.Summary) int {
+ return strings.Compare(a.Status, b.Status)
},
- {
- Key: "status",
- Fn: func(a, b containertypes.Summary) int {
- return strings.Compare(a.Status, b.Status)
- },
+ },
+ {
+ Key: "created",
+ Fn: func(a, b containertypes.Summary) int {
+ if a.Created < b.Created {
+ return -1
+ }
+ if a.Created > b.Created {
+ return 1
+ }
+ return 0
},
- {
- Key: "created",
- Fn: func(a, b containertypes.Summary) int {
- if a.Created < b.Created {
- return -1
- }
- if a.Created > b.Created {
- return 1
- }
- return 0
- },
+ },
+ }
+}
+
+func (s *ContainerService) buildContainerFilterAccessors() []pagination.FilterAccessor[containertypes.Summary] {
+ return []pagination.FilterAccessor[containertypes.Summary]{
+ {
+ Key: "updates",
+ Fn: func(c containertypes.Summary, filterValue string) bool {
+ switch filterValue {
+ case "has_update":
+ return c.UpdateInfo != nil && c.UpdateInfo.HasUpdate
+ case "up_to_date":
+ return c.UpdateInfo != nil && !c.UpdateInfo.HasUpdate && c.UpdateInfo.Error == ""
+ case "error":
+ return c.UpdateInfo != nil && c.UpdateInfo.Error != ""
+ case "unknown":
+ return c.UpdateInfo == nil
+ default:
+ return true
+ }
},
},
}
}
-func computeContainerCounts(items []containertypes.Summary) containertypes.StatusCounts {
+func (s *ContainerService) calculateContainerStatusCounts(items []containertypes.Summary) containertypes.StatusCounts {
counts := containertypes.StatusCounts{
TotalContainers: len(items),
}
@@ -585,26 +612,6 @@ func computeContainerCounts(items []containertypes.Summary) containertypes.Statu
return counts
}
-func buildPaginationResponse(result pagination.FilterResult[containertypes.Summary], params pagination.QueryParams) pagination.Response {
- totalPages := int64(0)
- if params.Limit > 0 {
- totalPages = (result.TotalCount + int64(params.Limit) - 1) / int64(params.Limit)
- }
-
- page := 1
- if params.Limit > 0 {
- page = (params.Start / params.Limit) + 1
- }
-
- return pagination.Response{
- TotalPages: totalPages,
- TotalItems: result.TotalCount,
- CurrentPage: page,
- ItemsPerPage: params.Limit,
- GrandTotalItems: result.TotalAvailable,
- }
-}
-
// CreateExec creates an exec instance in the container
func (s *ContainerService) CreateExec(ctx context.Context, containerID string, cmd []string) (string, error) {
dockerClient, err := s.dockerService.GetClient()
diff --git a/backend/internal/services/image_service.go b/backend/internal/services/image_service.go
index 7f897bd21..6f9d758e8 100644
--- a/backend/internal/services/image_service.go
+++ b/backend/internal/services/image_service.go
@@ -475,24 +475,7 @@ func (s *ImageService) ListImagesPaginated(ctx context.Context, params paginatio
config := s.getImagePaginationConfig()
result := pagination.SearchOrderAndPaginate(items, params, config)
-
- totalPages := int64(0)
- if params.Limit > 0 {
- totalPages = (int64(result.TotalCount) + int64(params.Limit) - 1) / int64(params.Limit)
- }
-
- page := 1
- if params.Limit > 0 {
- page = (params.Start / params.Limit) + 1
- }
-
- paginationResp := pagination.Response{
- TotalPages: totalPages,
- TotalItems: int64(result.TotalCount),
- CurrentPage: page,
- ItemsPerPage: params.Limit,
- GrandTotalItems: int64(result.TotalAvailable),
- }
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, nil
}
@@ -720,14 +703,23 @@ func (s *ImageService) getImagePaginationConfig() pagination.Config[imagetypes.S
{
Key: "updates",
Fn: func(i imagetypes.Summary, filterValue string) bool {
- hasUpdate := i.UpdateInfo != nil && i.UpdateInfo.HasUpdate
- if filterValue == "true" {
- return hasUpdate
+ switch filterValue {
+ case "has_update":
+ return i.UpdateInfo != nil && i.UpdateInfo.HasUpdate
+ case "up_to_date":
+ return i.UpdateInfo != nil && !i.UpdateInfo.HasUpdate && i.UpdateInfo.Error == ""
+ case "error":
+ return i.UpdateInfo != nil && i.UpdateInfo.Error != ""
+ case "unknown":
+ return i.UpdateInfo == nil
+ // Legacy boolean support
+ case "true":
+ return i.UpdateInfo != nil && i.UpdateInfo.HasUpdate
+ case "false":
+ return i.UpdateInfo == nil || !i.UpdateInfo.HasUpdate
+ default:
+ return true
}
- if filterValue == "false" {
- return !hasUpdate
- }
- return true
},
},
},
diff --git a/backend/internal/services/network_service.go b/backend/internal/services/network_service.go
index efe5dd70d..072b7e9b0 100644
--- a/backend/internal/services/network_service.go
+++ b/backend/internal/services/network_service.go
@@ -145,7 +145,7 @@ func (s *NetworkService) ListNetworksPaginated(ctx context.Context, params pagin
config := s.buildNetworkPaginationConfig()
result := pagination.SearchOrderAndPaginate(items, params, config)
counts := s.calculateNetworkUsageCounts(items)
- paginationResp := s.buildPaginationResponse(result, params)
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, counts, nil
}
@@ -272,23 +272,3 @@ func (s *NetworkService) calculateNetworkUsageCounts(items []networktypes.Summar
}
return counts
}
-
-func (s *NetworkService) buildPaginationResponse(result pagination.FilterResult[networktypes.Summary], params pagination.QueryParams) pagination.Response {
- totalPages := int64(0)
- if params.Limit > 0 {
- totalPages = (int64(result.TotalCount) + int64(params.Limit) - 1) / int64(params.Limit)
- }
-
- page := 1
- if params.Limit > 0 {
- page = (params.Start / params.Limit) + 1
- }
-
- return pagination.Response{
- TotalPages: totalPages,
- TotalItems: int64(result.TotalCount),
- CurrentPage: page,
- ItemsPerPage: params.Limit,
- GrandTotalItems: int64(result.TotalAvailable),
- }
-}
diff --git a/backend/internal/services/project_service.go b/backend/internal/services/project_service.go
index 921d30141..0765c6277 100644
--- a/backend/internal/services/project_service.go
+++ b/backend/internal/services/project_service.go
@@ -1389,24 +1389,7 @@ func (s *ProjectService) listProjectsByStatus(
}
result := pagination.SearchOrderAndPaginate(items, params, config)
-
- totalPages := int64(0)
- if params.Limit > 0 {
- totalPages = (int64(result.TotalCount) + int64(params.Limit) - 1) / int64(params.Limit)
- }
-
- page := 1
- if params.Limit > 0 {
- page = (params.Start / params.Limit) + 1
- }
-
- paginationResp := pagination.Response{
- TotalPages: totalPages,
- TotalItems: int64(result.TotalCount),
- CurrentPage: page,
- ItemsPerPage: params.Limit,
- GrandTotalItems: int64(result.TotalAvailable),
- }
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, nil
}
diff --git a/backend/internal/services/template_service.go b/backend/internal/services/template_service.go
index f861682db..786a75543 100644
--- a/backend/internal/services/template_service.go
+++ b/backend/internal/services/template_service.go
@@ -218,24 +218,7 @@ func (s *TemplateService) GetAllTemplatesPaginated(ctx context.Context, params p
}
result := pagination.SearchOrderAndPaginate(items, params, config)
-
- totalPages := int64(0)
- if params.Limit > 0 {
- totalPages = (int64(result.TotalCount) + int64(params.Limit) - 1) / int64(params.Limit)
- }
-
- currentPage := 1
- if params.Limit > 0 && params.Start > 0 {
- currentPage = (params.Start / params.Limit) + 1
- }
-
- paginationResp := pagination.Response{
- TotalPages: totalPages,
- TotalItems: int64(result.TotalCount),
- CurrentPage: currentPage,
- ItemsPerPage: params.Limit,
- GrandTotalItems: int64(result.TotalAvailable),
- }
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, nil
}
diff --git a/backend/internal/services/volume_service.go b/backend/internal/services/volume_service.go
index e9b33a12e..6e43c1891 100644
--- a/backend/internal/services/volume_service.go
+++ b/backend/internal/services/volume_service.go
@@ -1699,10 +1699,6 @@ func (s *VolumeService) calculateVolumeUsageCountsInternal(items []volumetypes.V
return counts
}
-func (s *VolumeService) buildPaginationResponseInternal(result pagination.FilterResult[volumetypes.Volume], params pagination.QueryParams) pagination.Response {
- return s.buildPaginationResponseFromCountsInternal(result.TotalCount, result.TotalAvailable, params)
-}
-
func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params pagination.QueryParams) ([]volumetypes.Volume, pagination.Response, volumetypes.UsageCounts, error) {
slog.DebugContext(ctx, "volume service: list volumes paginated", "search", params.Search, "sort", params.Sort, "order", params.Order, "start", params.Start, "limit", params.Limit)
dockerClient, err := s.dockerService.GetClient()
@@ -1777,7 +1773,7 @@ func (s *VolumeService) ListVolumesPaginated(ctx context.Context, params paginat
config := s.buildVolumePaginationConfigInternal()
result := pagination.SearchOrderAndPaginate(items, params, config)
counts := s.calculateVolumeUsageCountsInternal(items)
- paginationResp := s.buildPaginationResponseInternal(result, params)
+ paginationResp := pagination.BuildResponseFromFilterResult(result, params)
return result.Items, paginationResp, counts, nil
}
diff --git a/backend/internal/utils/pagination/pagination_test.go b/backend/internal/utils/pagination/pagination_test.go
new file mode 100644
index 000000000..6325c9d2f
--- /dev/null
+++ b/backend/internal/utils/pagination/pagination_test.go
@@ -0,0 +1,172 @@
+package pagination
+
+import (
+ "testing"
+
+ "github.com/stretchr/testify/assert"
+)
+
+func TestBuildResponseFromFilterResult(t *testing.T) {
+ tests := []struct {
+ name string
+ result FilterResult[int]
+ params QueryParams
+ expected Response
+ }{
+ {
+ name: "show all mode (limit = -1)",
+ result: FilterResult[int]{
+ Items: []int{1, 2, 3, 4, 5},
+ TotalCount: 5,
+ TotalAvailable: 10,
+ },
+ params: QueryParams{
+ PaginationParams: PaginationParams{
+ Start: 0,
+ Limit: -1,
+ },
+ },
+ expected: Response{
+ TotalPages: 1,
+ TotalItems: 5,
+ CurrentPage: 1,
+ ItemsPerPage: 5,
+ GrandTotalItems: 10,
+ },
+ },
+ {
+ name: "show all mode with zero items",
+ result: FilterResult[int]{
+ Items: []int{},
+ TotalCount: 0,
+ TotalAvailable: 0,
+ },
+ params: QueryParams{
+ PaginationParams: PaginationParams{
+ Start: 0,
+ Limit: -1,
+ },
+ },
+ expected: Response{
+ TotalPages: 1,
+ TotalItems: 0,
+ CurrentPage: 1,
+ ItemsPerPage: 0,
+ GrandTotalItems: 0,
+ },
+ },
+ {
+ name: "normal pagination (limit > 0)",
+ result: FilterResult[int]{
+ Items: []int{1, 2, 3},
+ TotalCount: 25,
+ TotalAvailable: 100,
+ },
+ params: QueryParams{
+ PaginationParams: PaginationParams{
+ Start: 0,
+ Limit: 10,
+ },
+ },
+ expected: Response{
+ TotalPages: 3,
+ TotalItems: 25,
+ CurrentPage: 1,
+ ItemsPerPage: 10,
+ GrandTotalItems: 100,
+ },
+ },
+ {
+ name: "normal pagination second page",
+ result: FilterResult[int]{
+ Items: []int{11, 12, 13},
+ TotalCount: 25,
+ TotalAvailable: 100,
+ },
+ params: QueryParams{
+ PaginationParams: PaginationParams{
+ Start: 10,
+ Limit: 10,
+ },
+ },
+ expected: Response{
+ TotalPages: 3,
+ TotalItems: 25,
+ CurrentPage: 2,
+ ItemsPerPage: 10,
+ GrandTotalItems: 100,
+ },
+ },
+ {
+ name: "invalid limit (zero) falls back to show all",
+ result: FilterResult[int]{
+ Items: []int{1, 2, 3},
+ TotalCount: 3,
+ TotalAvailable: 3,
+ },
+ params: QueryParams{
+ PaginationParams: PaginationParams{
+ Start: 0,
+ Limit: 0,
+ },
+ },
+ expected: Response{
+ TotalPages: 1,
+ TotalItems: 3,
+ CurrentPage: 1,
+ ItemsPerPage: 3,
+ GrandTotalItems: 3,
+ },
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ result := BuildResponseFromFilterResult(tt.result, tt.params)
+ assert.Equal(t, tt.expected, result)
+ })
+ }
+}
+
+func TestPaginateItemsFunction(t *testing.T) {
+ items := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
+
+ tests := []struct {
+ name string
+ params PaginationParams
+ expected []int
+ }{
+ {
+ name: "show all mode (limit = -1)",
+ params: PaginationParams{Start: 0, Limit: -1},
+ expected: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
+ },
+ {
+ name: "show all mode (limit = 0)",
+ params: PaginationParams{Start: 0, Limit: 0},
+ expected: []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
+ },
+ {
+ name: "normal pagination first page",
+ params: PaginationParams{Start: 0, Limit: 3},
+ expected: []int{1, 2, 3},
+ },
+ {
+ name: "normal pagination second page",
+ params: PaginationParams{Start: 3, Limit: 3},
+ expected: []int{4, 5, 6},
+ },
+ {
+ name: "pagination at end of list",
+ params: PaginationParams{Start: 8, Limit: 5},
+ expected: []int{9, 10},
+ },
+ }
+
+ for _, tt := range tests {
+ t.Run(tt.name, func(t *testing.T) {
+ result := paginateItemsFunction(items, tt.params)
+ assert.Equal(t, tt.expected, result)
+ })
+ }
+}
diff --git a/backend/internal/utils/pagination/reflect.go b/backend/internal/utils/pagination/reflect.go
index 570c41440..631a859df 100644
--- a/backend/internal/utils/pagination/reflect.go
+++ b/backend/internal/utils/pagination/reflect.go
@@ -33,6 +33,10 @@ func PaginateAndSortDB(params QueryParams, query *gorm.DB, result interface{}) (
}
limit := params.Limit
+ // limit = -1 means "show all" - skip pagination
+ if limit == -1 {
+ return paginateDBAll(query, result)
+ }
if limit <= 0 {
limit = 20
} else if limit > 100 {
@@ -47,6 +51,25 @@ func PaginateAndSortDB(params QueryParams, query *gorm.DB, result interface{}) (
return paginateDB(page, limit, query, result)
}
+// paginateDBAll returns all results without pagination limits
+func paginateDBAll(query *gorm.DB, result interface{}) (Response, error) {
+ var totalItems int64
+ if err := query.Count(&totalItems).Error; err != nil {
+ return Response{}, err
+ }
+
+ if err := query.Find(result).Error; err != nil {
+ return Response{}, err
+ }
+
+ return Response{
+ TotalPages: 1,
+ TotalItems: totalItems,
+ CurrentPage: 1,
+ ItemsPerPage: int(totalItems),
+ }, nil
+}
+
func paginateDB(page int, pageSize int, query *gorm.DB, result interface{}) (Response, error) {
if page < 1 {
page = 1
diff --git a/backend/internal/utils/pagination/types.go b/backend/internal/utils/pagination/types.go
index 5aac560b4..b780547f6 100644
--- a/backend/internal/utils/pagination/types.go
+++ b/backend/internal/utils/pagination/types.go
@@ -7,3 +7,43 @@ type Response struct {
ItemsPerPage int `json:"itemsPerPage"`
GrandTotalItems int64 `json:"grandTotalItems,omitempty"`
}
+
+// BuildResponseFromFilterResult creates a pagination Response from a FilterResult.
+// Handles the special case where limit = -1 means "show all".
+func BuildResponseFromFilterResult[T any](result FilterResult[T], params QueryParams) Response {
+ limit := params.Limit
+ totalCount := result.TotalCount
+
+ var totalPages int64
+ var page int
+ var itemsPerPage int
+
+ switch {
+ case limit == -1:
+ // "Show all" mode: single page with all items
+ totalPages = 1
+ page = 1
+ itemsPerPage = int(totalCount)
+ case limit > 0:
+ totalPages = (totalCount + int64(limit) - 1) / int64(limit)
+ page = (params.Start / limit) + 1
+ itemsPerPage = limit
+ default:
+ // Fallback for invalid limit values
+ totalPages = 1
+ page = 1
+ itemsPerPage = int(totalCount)
+ }
+
+ if totalPages == 0 {
+ totalPages = 1
+ }
+
+ return Response{
+ TotalPages: totalPages,
+ TotalItems: totalCount,
+ CurrentPage: page,
+ ItemsPerPage: itemsPerPage,
+ GrandTotalItems: result.TotalAvailable,
+ }
+}
diff --git a/codecov.yml b/codecov.yml
deleted file mode 100644
index a4a72f55c..000000000
--- a/codecov.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-ignore:
- - "backend/internal/huma/**"
- - "backend/internal/database/**"
- - "backend/internal/models/**"
- - "backend/internal/api/**"
- - "backend/internal/bootstrap/**"
- - "backend/internal/bootstrap/**"
- - "backend/internal/common/**"
- - "backend/internal/middleware/**"
- - "cli/**
- - "backend/resources/**"
- - "backend/cli/**"
- - "backend/frontend/**"
diff --git a/frontend/messages/en.json b/frontend/messages/en.json
index 9e7238081..97213bab2 100644
--- a/frontend/messages/en.json
+++ b/frontend/messages/en.json
@@ -56,6 +56,7 @@
"common_port_mappings": "Port Mappings",
"common_exposed_ports": "Exposed Ports",
"common_open_menu": "Open menu",
+ "common_actions": "Actions",
"common_inspect": "Inspect",
"common_view": "View",
"common_scope": "Scope",
@@ -110,6 +111,7 @@
"common_loading": "Loading…",
"common_enabled": "Enabled",
"common_disabled": "Disabled",
+ "common_error": "Error",
"common_enable": "Enable",
"common_disable": "Disable",
"common_current": "Current",
@@ -134,6 +136,7 @@
"common_select_row": "Select row",
"common_showing_of_total": "Showing {shown} of {total} item(s).",
"common_rows_per_page": "Rows per page",
+ "common_all": "All",
"common_go_first_page": "Go to first page",
"common_go_prev_page": "Go to previous page",
"common_go_next_page": "Go to next page",
@@ -365,7 +368,7 @@
"containers_check_updates": "Update Containers",
"containers_check_updates_failed": "Failed to Check Containers for Updates",
"containers_check_updates_success": "Containers Updated Successfully.",
- "containers_update_column": "Update",
+ "containers_update_column": "Updates",
"containers_update_container": "Update Container",
"containers_update_confirm_title": "Update Container",
"containers_update_confirm_message": "This will pull the latest image and restart the container \"{name}\". Do you want to continue?",
diff --git a/frontend/package.json b/frontend/package.json
index 5e6161b99..72de80c30 100644
--- a/frontend/package.json
+++ b/frontend/package.json
@@ -41,7 +41,6 @@
"svelte-motion": "^0.12.2"
},
"devDependencies": {
- "@codecov/sveltekit-plugin": "^1.9.1",
"@iconify/json": "^2.2.431",
"@inlang/paraglide-js": "2.9.1",
"@internationalized/date": "^3.10.1",
diff --git a/frontend/src/app.css b/frontend/src/app.css
index 64dd1d7e2..8c6b9fa4a 100644
--- a/frontend/src/app.css
+++ b/frontend/src/app.css
@@ -180,6 +180,49 @@
'liga' 0,
'clig' 0;
}
+
+ * {
+ scrollbar-width: thin;
+ scrollbar-color: transparent transparent;
+ }
+
+ *:hover {
+ scrollbar-color: var(--muted-foreground) transparent;
+ }
+
+ *::-webkit-scrollbar {
+ width: 8px;
+ height: 8px;
+ }
+
+ *::-webkit-scrollbar-track {
+ background: transparent;
+ border-radius: 4px;
+ }
+
+ *::-webkit-scrollbar-thumb {
+ background: transparent;
+ border-radius: 4px;
+ border: 2px solid transparent;
+ background-clip: content-box;
+ transition: background 0.2s ease;
+ }
+
+ *:hover::-webkit-scrollbar-thumb {
+ background: var(--muted-foreground);
+ border: 2px solid transparent;
+ background-clip: content-box;
+ }
+
+ *::-webkit-scrollbar-thumb:hover {
+ background: var(--foreground) !important;
+ border: 2px solid transparent;
+ background-clip: content-box;
+ }
+
+ *::-webkit-scrollbar-corner {
+ background: transparent;
+ }
}
body.glass-enabled {
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
index a2a9dda62..2a601ff59 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-desktop-view.svelte
@@ -1,30 +1,116 @@
<script lang="ts">
- import { type Table as TableType } from '@tanstack/table-core';
+ import { type Table as TableType, type Header, type Cell } from '@tanstack/table-core';
import * as Table from '$lib/components/ui/table/index.js';
import * as Empty from '$lib/components/ui/empty/index.js';
import FlexRender from '$lib/components/ui/data-table/flex-render.svelte';
- import { FolderXIcon } from '$lib/icons';
+ import { FolderXIcon, ArrowRightIcon, ArrowDownIcon } from '$lib/icons';
import { m } from '$lib/paraglide/messages';
import { cn } from '$lib/utils';
+ import type { ColumnWidth, ColumnAlign, GroupedData, GroupSelectionState } from './arcane-table.types.svelte.ts';
+ import TableCheckbox from './arcane-table-checkbox.svelte';
+ import type { Component } from 'svelte';
let {
table,
selectedIds,
- columnsCount
+ columnsCount,
+ groupedRows = null,
+ groupIcon,
+ groupCollapsedState = {},
+ selectionDisabled = false,
+ onGroupToggle,
+ getGroupSelectionState,
+ onToggleGroupSelection,
+ onToggleRowSelection,
+ unstyled = false
}: {
table: TableType<any>;
selectedIds: string[];
columnsCount: number;
+ groupedRows?: GroupedData<any>[] | null;
+ groupIcon?: (groupName: string) => Component;
+ groupCollapsedState?: Record<string, boolean>;
+ selectionDisabled?: boolean;
+ onGroupToggle?: (groupName: string) => void;
+ getGroupSelectionState?: (groupItems: any[]) => GroupSelectionState;
+ onToggleGroupSelection?: (groupItems: any[]) => void;
+ onToggleRowSelection?: (id: string, selected: boolean) => void;
+ unstyled?: boolean;
} = $props();
+
+ // Get column width class from meta
+ function getWidthClass(width?: ColumnWidth): string {
+ if (!width || width === 'auto') return '';
+ if (width === 'min') return 'w-0';
+ if (width === 'max') return 'w-full';
+ if (typeof width === 'number') return `w-[${width}px]`;
+ return '';
+ }
+
+ // Get column alignment class from meta
+ function getAlignClass(align?: ColumnAlign): string {
+ if (!align || align === 'left') return '';
+ if (align === 'center') return 'text-center';
+ if (align === 'right') return 'text-right';
+ return '';
+ }
+
+ const stickyActionsClasses = 'sticky right-0 z-10 transition-colors';
+ const stickySelectClasses = 'w-0 pr-6!';
+
+ function shouldIgnoreRowClick(event: MouseEvent): boolean {
+ const target = event.target as HTMLElement | null;
+ return !!target?.closest('a, button, input, [role="checkbox"], [data-slot="checkbox"], [data-row-select-ignore]');
+ }
+
+ function handleRowClick(event: MouseEvent, rowId: string) {
+ if (selectionDisabled || shouldIgnoreRowClick(event)) return;
+ const isSelected = (selectedIds ?? []).includes(rowId);
+ onToggleRowSelection?.(rowId, !isSelected);
+ }
+
+ // Get cell classes based on column metadata
+ function getCellClasses(cell: Cell<any, unknown>, isGrouped: boolean, isFirstCell: boolean): string {
+ const meta = cell.column.columnDef.meta as { width?: ColumnWidth; align?: ColumnAlign; truncate?: boolean } | undefined;
+ return cn(
+ cell.column.id === 'actions' && 'text-right whitespace-nowrap',
+ cell.column.id === 'select' && stickySelectClasses,
+ cell.column.id === 'actions' && stickyActionsClasses,
+ getWidthClass(meta?.width),
+ getAlignClass(meta?.align),
+ meta?.truncate && 'max-w-0 truncate',
+ isGrouped && isFirstCell && cell.column.id !== 'select' && 'pl-10'
+ );
+ }
+
+ // Get rows for a specific group from the table model
+ function getRowsForGroup(groupItems: any[]) {
+ const groupIds = new Set(groupItems.map((item) => item.id));
+ return table.getRowModel().rows.filter((row) => groupIds.has((row.original as any).id));
+ }
+
+ const isGrouped = $derived(groupedRows !== null && groupedRows.length > 0);
</script>
-<div class="h-full w-full">
- <Table.Root class="relative">
+<div
+ class={cn(
+ 'h-full w-full',
+ unstyled &&
+ '[&_tr]:border-border/40! [&_thead]:bg-transparent! [&_thead]:backdrop-blur-none [&_tr]:bg-transparent! [&_tr]:hover:bg-transparent! [&_tr:hover_td]:bg-transparent! [&_tr[data-state=selected]]:bg-transparent! [&_tr[data-state=selected]_td]:bg-transparent!'
+ )}
+>
+ <Table.Root>
<Table.Header>
{#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
<Table.Row>
{#each headerGroup.headers as header (header.id)}
- <Table.Head colspan={header.colSpan}>
+ <Table.Head
+ colspan={header.colSpan}
+ class={cn(
+ header.column.id === 'select' && stickySelectClasses,
+ header.column.id === 'actions' && stickyActionsClasses
+ )}
+ >
{#if !header.isPlaceholder}
<FlexRender content={header.column.columnDef.header} context={header.getContext()} />
{/if}
@@ -34,28 +120,143 @@
{/each}
</Table.Header>
<Table.Body>
- {#each table.getRowModel().rows as row (row.id)}
- <Table.Row data-state={(selectedIds ?? []).includes((row.original as any).id) && 'selected'}>
- {#each row.getVisibleCells() as cell (cell.id)}
- <Table.Cell>
- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
+ {#if isGrouped && groupedRows}
+ {#each groupedRows as group (group.groupName)}
+ {@const isCollapsed = groupCollapsedState[group.groupName] ?? true}
+ {@const groupRows = getRowsForGroup(group.items)}
+ {@const selectionState = getGroupSelectionState?.(group.items) ?? 'none'}
+ {@const hasSelection = selectionState !== 'none'}
+ {@const IconComponent = groupIcon?.(group.groupName)}
+
+ <Table.Row
+ class={cn(
+ 'cursor-pointer transition-colors',
+ !unstyled && (hasSelection ? 'bg-primary/10 hover:bg-primary/15' : 'bg-background hover:bg-primary/15')
+ )}
+ onclick={() => onGroupToggle?.(group.groupName)}
+ >
+ {#if !selectionDisabled}
+ <Table.Cell class={stickySelectClasses}>
+ <TableCheckbox
+ checked={selectionState === 'all'}
+ indeterminate={selectionState === 'some'}
+ onCheckedChange={() => onToggleGroupSelection?.(group.items)}
+ onclick={(e: MouseEvent) => e.stopPropagation()}
+ aria-label={m.common_select_all()}
+ />
+ </Table.Cell>
+ {/if}
+ <Table.Cell colspan={columnsCount - (selectionDisabled ? 0 : 1)} class="py-3 font-medium">
+ <div class="flex items-center gap-2">
+ {#if isCollapsed}
+ <ArrowRightIcon class="text-muted-foreground size-4" />
+ {:else}
+ <ArrowDownIcon class="text-muted-foreground size-4" />
+ {/if}
+ {#if IconComponent}
+ <IconComponent class="text-muted-foreground size-4" />
+ {/if}
+ <span>{group.groupName}</span>
+ <span class="text-muted-foreground text-xs font-normal">({group.items.length})</span>
+ </div>
</Table.Cell>
- {/each}
- </Table.Row>
+ </Table.Row>
+
+ <!-- Group Items (if not collapsed) -->
+ {#if !isCollapsed}
+ {#each groupRows as row (row.id)}
+ {@const rowId = (row.original as any).id}
+ <Table.Row
+ data-state={(selectedIds ?? []).includes(rowId) && 'selected'}
+ onclick={(event) => handleRowClick(event, rowId)}
+ >
+ {#each row.getVisibleCells() as cell, cellIndex (cell.id)}
+ {@const isFirstDataCell = !selectionDisabled ? cellIndex === 1 : cellIndex === 0}
+ <Table.Cell class={getCellClasses(cell, true, isFirstDataCell)}>
+ {#if cell.column.id === 'actions'}
+ <div class="flex items-center justify-end" data-row-select-ignore>
+ <div
+ class={cn(
+ 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-full border px-2 py-1 shadow-sm',
+ unstyled && 'border-transparent bg-transparent shadow-none'
+ )}
+ >
+ <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
+ </div>
+ </div>
+ {:else}
+ <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
+ {/if}
+ </Table.Cell>
+ {/each}
+ </Table.Row>
+ {/each}
+ {/if}
+ {/each}
+
+ {#if groupedRows.length === 0}
+ <Table.Row>
+ <Table.Cell colspan={columnsCount} class="h-48">
+ <Empty.Root
+ class={cn('rounded-lg py-12', unstyled ? 'bg-transparent' : 'bg-card/30 backdrop-blur-sm')}
+ role="status"
+ aria-live="polite"
+ >
+ <Empty.Header>
+ <Empty.Media variant="icon">
+ <FolderXIcon class="text-muted-foreground/40 size-10" />
+ </Empty.Media>
+ <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>
+ </Empty.Header>
+ </Empty.Root>
+ </Table.Cell>
+ </Table.Row>
+ {/if}
{:else}
- <Table.Row>
- <Table.Cell colspan={columnsCount} class="h-48">
- <Empty.Root class="border border-dashed">
- <Empty.Header>
- <Empty.Media variant="icon">
- <FolderXIcon />
- </Empty.Media>
- <Empty.Title>{m.common_no_results_found()}</Empty.Title>
- </Empty.Header>
- </Empty.Root>
- </Table.Cell>
- </Table.Row>
- {/each}
+ {#each table.getRowModel().rows as row (row.id)}
+ {@const rowId = (row.original as any).id}
+ <Table.Row
+ data-state={(selectedIds ?? []).includes(rowId) && 'selected'}
+ onclick={(event) => handleRowClick(event, rowId)}
+ >
+ {#each row.getVisibleCells() as cell (cell.id)}
+ <Table.Cell class={getCellClasses(cell, false, false)}>
+ {#if cell.column.id === 'actions'}
+ <div class="flex items-center justify-end" data-row-select-ignore>
+ <div
+ class={cn(
+ 'border-border/40 bg-background pointer-events-auto flex items-center gap-1 rounded-full border px-2 py-1 shadow-sm',
+ unstyled && 'border-transparent bg-transparent shadow-none'
+ )}
+ >
+ <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
+ </div>
+ </div>
+ {:else}
+ <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
+ {/if}
+ </Table.Cell>
+ {/each}
+ </Table.Row>
+ {:else}
+ <Table.Row>
+ <Table.Cell colspan={columnsCount} class="h-48">
+ <Empty.Root
+ class={cn('rounded-lg py-12', unstyled ? 'bg-transparent' : 'backdrop-blur-sm bg-card/30')}
+ role="status"
+ aria-live="polite"
+ >
+ <Empty.Header>
+ <Empty.Media variant="icon">
+ <FolderXIcon class="text-muted-foreground/40 size-10" />
+ </Empty.Media>
+ <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>
+ </Empty.Header>
+ </Empty.Root>
+ </Table.Cell>
+ </Table.Row>
+ {/each}
+ {/if}
</Table.Body>
</Table.Root>
</div>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
index f2da9cba3..90492532e 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-mobile-view.svelte
@@ -1,33 +1,110 @@
<script lang="ts">
import { type Table as TableType } from '@tanstack/table-core';
import * as Empty from '$lib/components/ui/empty/index.js';
+ import DropdownCard from '$lib/components/dropdown-card.svelte';
import { FolderXIcon } from '$lib/icons';
import { m } from '$lib/paraglide/messages';
- import type { Snippet } from 'svelte';
import { cn } from '$lib/utils';
+ import type { Snippet, Component } from 'svelte';
+ import type { GroupedData } from './arcane-table.types.svelte.ts';
let {
table,
mobileCard,
- mobileFieldVisibility
+ mobileFieldVisibility,
+ groupedRows = null,
+ groupIcon,
+ onGroupToggle,
+ groupCollapsedState = {},
+ unstyled = false
}: {
table: TableType<any>;
mobileCard: Snippet<[{ row: any; item: any; mobileFieldVisibility: Record<string, boolean> }]>;
mobileFieldVisibility: Record<string, boolean>;
+ groupedRows?: GroupedData<any>[] | null;
+ groupIcon?: (groupName: string) => Component;
+ onGroupToggle?: (groupName: string) => void;
+ groupCollapsedState?: Record<string, boolean>;
+ unstyled?: boolean;
} = $props();
+
+ // Get rows for a specific group from the table model
+ function getRowsForGroup(groupItems: any[]) {
+ const groupIds = new Set(groupItems.map((item) => item.id));
+ return table.getRowModel().rows.filter((row) => groupIds.has((row.original as any).id));
+ }
+
+ // Check if we should render grouped view
+ const isGrouped = $derived(groupedRows !== null && groupedRows.length > 0);
</script>
-<div class="divide-border/40 divide-y">
- {#each table.getRowModel().rows as row (row.id)}
- {@render mobileCard({ row, item: row.original as any, mobileFieldVisibility })}
+<div class="divide-border/30 divide-y">
+ {#if isGrouped && groupedRows}
+ <div class="space-y-4 py-2">
+ {#each groupedRows as group (group.groupName)}
+ {@const groupRows = getRowsForGroup(group.items)}
+ {@const IconComponent = groupIcon?.(group.groupName)}
+
+ <DropdownCard
+ id={`mobile-group-${group.groupName}`}
+ title={group.groupName}
+ description={`${group.items.length} ${group.items.length === 1 ? 'item' : 'items'}`}
+ icon={IconComponent}
+ >
+ <div class="divide-border/30 divide-y">
+ {#each groupRows as row (row.id)}
+ {@render mobileCard({ row, item: row.original as any, mobileFieldVisibility })}
+ {:else}
+ <div class="text-muted-foreground flex h-24 items-center justify-center text-center">
+ {m.common_no_results_found()}
+ </div>
+ {/each}
+ </div>
+ </DropdownCard>
+ {/each}
+ </div>
+
+ {#if groupedRows.length === 0}
+ <div class="p-4">
+ <Empty.Root
+ class={cn(
+ 'min-h-48 rounded-xl border-0 py-12',
+ unstyled ? 'bg-transparent' : 'bg-card/30 backdrop-blur-sm'
+ )}
+ role="status"
+ aria-live="polite"
+ >
+ <Empty.Header>
+ <Empty.Media variant="icon">
+ <FolderXIcon class="text-muted-foreground/40 size-10" />
+ </Empty.Media>
+ <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>
+ </Empty.Header>
+ </Empty.Root>
+ </div>
+ {/if}
{:else}
- <Empty.Root class="min-h-48 border-0">
- <Empty.Header>
- <Empty.Media variant="icon">
- <FolderXIcon />
- </Empty.Media>
- <Empty.Title>{m.common_no_results_found()}</Empty.Title>
- </Empty.Header>
- </Empty.Root>
- {/each}
+ <!-- Non-grouped view (original behavior) -->
+ {#each table.getRowModel().rows as row (row.id)}
+ {@render mobileCard({ row, item: row.original as any, mobileFieldVisibility })}
+ {:else}
+ <div class="p-4">
+ <Empty.Root
+ class={cn(
+ 'min-h-48 rounded-xl border-0 py-12',
+ unstyled ? 'bg-transparent' : 'bg-card/30 backdrop-blur-sm'
+ )}
+ role="status"
+ aria-live="polite"
+ >
+ <Empty.Header>
+ <Empty.Media variant="icon">
+ <FolderXIcon class="text-muted-foreground/40 size-10" />
+ </Empty.Media>
+ <Empty.Title class="text-base font-medium">{m.common_no_results_found()}</Empty.Title>
+ </Empty.Header>
+ </Empty.Root>
+ </div>
+ {/each}
+ {/if}
</div>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte b/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte
index 0f1fec2d7..8e94d961e 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-pagination.svelte
@@ -7,7 +7,6 @@
import type { Paginated } from '$lib/types/pagination.type';
let {
- table,
items,
currentPage,
totalPages,
@@ -29,6 +28,19 @@
setPage: (page: number) => void;
setPageSize: (limit: number) => void;
} = $props();
+
+ const pageSizeOptions = [10, 20, 30, 40, 50];
+ const isAllSelected = $derived(pageSize === -1);
+ const displayValue = $derived(isAllSelected ? m.common_all() : String(pageSize));
+ const selectValue = $derived(isAllSelected ? 'all' : String(pageSize));
+
+ function handlePageSizeChange(value: string) {
+ if (value === 'all') {
+ setPageSize(-1);
+ } else {
+ setPageSize(Number(value));
+ }
+ }
</script>
<div class="flex w-full flex-col gap-4 px-2 sm:flex-row sm:items-center sm:justify-between">
@@ -38,21 +50,19 @@
<div class="order-1 flex flex-col gap-4 sm:order-2 sm:flex-row sm:items-center sm:space-x-6 lg:space-x-8">
<div class="flex items-center justify-between space-x-2 sm:justify-start">
<p class="text-sm font-medium">{m.common_rows_per_page()}</p>
- <Select.Root
- allowDeselect={false}
- type="single"
- value={`${pageSize}`}
- onValueChange={(value) => setPageSize(Number(value))}
- >
- <Select.Trigger class="h-8 w-[70px]">
- {String(pageSize)}
+ <Select.Root allowDeselect={false} type="single" value={selectValue} onValueChange={handlePageSizeChange}>
+ <Select.Trigger class="h-11 w-[70px] sm:h-8">
+ {displayValue}
</Select.Trigger>
<Select.Content side="top">
- {#each [10, 20, 30, 40, 50] as size (size)}
+ {#each pageSizeOptions as size (size)}
<Select.Item value={`${size}`}>
{size}
</Select.Item>
{/each}
+ <Select.Item value="all">
+ {m.common_all()}
+ </Select.Item>
</Select.Content>
</Select.Root>
</div>
@@ -76,7 +86,7 @@
tone="outline"
size="icon"
icon={ArrowLeftIcon}
- class="size-8"
+ class="size-11 sm:size-8"
onclick={() => setPage(currentPage - 1)}
disabled={!canPrev}
aria-label={m.common_go_prev_page()}
@@ -86,7 +96,7 @@
tone="outline"
size="icon"
icon={ArrowRightIcon}
- class="size-8"
+ class="size-11 sm:size-8"
onclick={() => setPage(currentPage + 1)}
disabled={!canNext}
aria-label={m.common_go_next_page()}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
index 1f2524f58..775b978b1 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-toolbar.svelte
@@ -8,8 +8,9 @@
import { m } from '$lib/paraglide/messages';
import type { Snippet } from 'svelte';
import { cn } from '$lib/utils';
- import { ResetIcon } from '$lib/icons';
+ import { ResetIcon, SearchIcon, FilterIcon } from '$lib/icons';
import type { BulkAction } from './arcane-table.types.svelte';
+ import * as Popover from '$lib/components/ui/popover/index.js';
let {
table,
@@ -50,33 +51,36 @@
const debouncedSetGlobal = debounced((v: string) => table.setGlobalFilter(v), 300);
const hasSelection = $derived(!selectionDisabled && (selectedIds?.length ?? 0) > 0);
const hasBulkActions = $derived(bulkActions && bulkActions.length > 0);
-</script>
-<div class={cn('flex flex-col gap-2 px-2 py-2 sm:flex-row sm:items-center sm:justify-between', className)}>
- <div class="flex flex-col gap-2 sm:flex-1 sm:flex-row sm:items-center sm:justify-between">
- <div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:space-x-2">
- <div class="flex items-center gap-2">
- <Input
- placeholder={m.common_search()}
- value={(table.getState().globalFilter as string) ?? ''}
- oninput={(e) => debouncedSetGlobal(e.currentTarget.value)}
- onchange={(e) => table.setGlobalFilter(e.currentTarget.value)}
- onkeydown={(e) => {
- if (e.key === 'Enter') table.setGlobalFilter((e.currentTarget as HTMLInputElement).value);
- }}
- class="h-8 w-full sm:w-[150px] lg:w-[250px]"
- />
+ // Check if any filter columns exist
+ const hasFilterColumns = $derived(
+ !!(typeColumn && !severityColumn) ||
+ !!usageColumn ||
+ !!updatesColumn ||
+ !!severityColumn ||
+ !!(statusColumn && serviceCountColumn)
+ );
+ const activeFilterCount = $derived(table.getState().columnFilters.length);
+</script>
- <div class="md:hidden">
- {#if mobileFields.length > 0 && onToggleMobileField}
- <DataTableViewOptions fields={mobileFields} onToggleField={onToggleMobileField} {customViewOptions} />
- {:else}
- <DataTableViewOptions {table} {customViewOptions} />
- {/if}
- </div>
- </div>
+<div class={cn('flex items-center justify-between gap-2 px-3 py-2.5', className)}>
+ <div class="flex min-w-0 flex-1 items-center gap-2 md:flex-none">
+ <div class="relative min-w-0 flex-1 md:w-64 md:flex-none">
+ <SearchIcon class="text-muted-foreground pointer-events-none absolute top-1/2 left-2.5 size-4 -translate-y-1/2" />
+ <Input
+ placeholder={m.common_search()}
+ value={(table.getState().globalFilter as string) ?? ''}
+ oninput={(e) => debouncedSetGlobal(e.currentTarget.value)}
+ onchange={(e) => table.setGlobalFilter(e.currentTarget.value)}
+ onkeydown={(e) => {
+ if (e.key === 'Enter') table.setGlobalFilter((e.currentTarget as HTMLInputElement).value);
+ }}
+ class="h-9 w-full pl-8"
+ />
+ </div>
- <div class="flex flex-wrap items-center gap-2 sm:gap-0 sm:space-x-2">
+ {#if hasFilterColumns}
+ <div class="hidden items-center gap-1.5 md:flex">
{#if typeColumn && !severityColumn}
<DataTableFacetedFilter column={typeColumn} title={m.common_type()} options={templateTypeFilters} />
{/if}
@@ -92,52 +96,99 @@
{#if statusColumn && serviceCountColumn}
<DataTableFacetedFilter column={statusColumn} title={m.common_status()} options={projectStatusFilters} />
{/if}
+ </div>
- {#if isFiltered}
+ <div class="md:hidden">
+ <Popover.Root>
+ <Popover.Trigger>
+ {#snippet child({ props })}
+ <ArcaneButton {...props} action="base" tone="outline" size="icon" class="relative size-9">
+ <FilterIcon class="size-4" />
+ {#if activeFilterCount > 0}
+ <span
+ class="bg-primary text-primary-foreground absolute -top-1 -right-1 flex size-4 items-center justify-center rounded-full text-[10px] font-medium"
+ >
+ {activeFilterCount}
+ </span>
+ {/if}
+ </ArcaneButton>
+ {/snippet}
+ </Popover.Trigger>
+ <Popover.Content align="end" class="w-56 p-2">
+ <div class="flex flex-col gap-1.5">
+ {#if typeColumn && !severityColumn}
+ <DataTableFacetedFilter column={typeColumn} title={m.common_type()} options={templateTypeFilters} />
+ {/if}
+ {#if usageColumn}
+ <DataTableFacetedFilter column={usageColumn} title={m.common_usage()} options={usageFilters} />
+ {/if}
+ {#if updatesColumn}
+ <DataTableFacetedFilter column={updatesColumn} title={m.images_updates()} options={imageUpdateFilters} />
+ {/if}
+ {#if severityColumn}
+ <DataTableFacetedFilter column={severityColumn} title={m.events_col_severity()} options={severityFilters} />
+ {/if}
+ {#if statusColumn && serviceCountColumn}
+ <DataTableFacetedFilter column={statusColumn} title={m.common_status()} options={projectStatusFilters} />
+ {/if}
+ </div>
+ </Popover.Content>
+ </Popover.Root>
+ </div>
+ {/if}
+
+ {#if isFiltered}
+ <ArcaneButton
+ action="base"
+ tone="ghost"
+ size="sm"
+ icon={ResetIcon}
+ customLabel={m.common_reset()}
+ onclick={() => {
+ table.setColumnFilters([]);
+ table.setGlobalFilter('');
+ }}
+ class="h-9 shrink-0"
+ />
+ {/if}
+ </div>
+
+ <div class="flex shrink-0 items-center gap-2">
+ {#if hasSelection && hasBulkActions}
+ <div class="flex items-center gap-1.5">
+ {#each bulkActions as bulkAction (bulkAction.id)}
+ {@const actionType = bulkAction.action === 'up' ? 'start' : bulkAction.action === 'down' ? 'stop' : bulkAction.action}
<ArcaneButton
- action="base"
- tone="ghost"
+ action={actionType}
size="sm"
- icon={ResetIcon}
- customLabel={m.common_reset()}
- onclick={() => {
- table.setColumnFilters([]);
- table.setGlobalFilter('');
- }}
- class="h-8 px-2 lg:px-3"
+ icon={bulkAction.icon}
+ customLabel={bulkAction.label}
+ onclick={() => bulkAction.onClick(selectedIds!)}
+ disabled={bulkAction.disabled || bulkAction.loading}
+ loading={bulkAction.loading}
+ class="h-9"
/>
- {/if}
+ {/each}
</div>
- </div>
- </div>
+ {/if}
- <!-- Bulk actions and View options -->
- <div class="flex items-center gap-2">
- {#if hasSelection}
- {#if hasBulkActions}
- <div class="flex flex-wrap items-center gap-2">
- {#each bulkActions as bulkAction (bulkAction.id)}
- {@const actionType = bulkAction.action === 'up' ? 'start' : bulkAction.action === 'down' ? 'stop' : bulkAction.action}
- <ArcaneButton
- action={actionType}
- icon={bulkAction.icon}
- customLabel={bulkAction.label}
- onclick={() => bulkAction.onClick(selectedIds!)}
- disabled={bulkAction.disabled || bulkAction.loading}
- loading={bulkAction.loading}
- />
- {/each}
- </div>
- {/if}
+ {#if customToolbarActions}
+ {@render customToolbarActions()}
{/if}
{#if customToolbarActions}
{@render customToolbarActions()}
{/if}
- <!-- View options - desktop only, always on the right -->
<div class="hidden md:block">
<DataTableViewOptions {table} {customViewOptions} />
</div>
+ <div class="md:hidden">
+ {#if mobileFields.length > 0 && onToggleMobileField}
+ <DataTableViewOptions fields={mobileFields} onToggleField={onToggleMobileField} {customViewOptions} />
+ {:else}
+ <DataTableViewOptions {table} {customViewOptions} />
+ {/if}
+ </div>
</div>
</div>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
index 0a1c86dcf..b11c1be80 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table-view-options.svelte
@@ -4,7 +4,7 @@
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { m } from '$lib/paraglide/messages';
import type { Snippet } from 'svelte';
- import { ViewOptionsIcon } from '$lib/icons';
+ import { EyeOnIcon } from '$lib/icons';
let {
table,
@@ -26,7 +26,7 @@
{...props}
action="base"
tone="ghost"
- icon={ViewOptionsIcon}
+ icon={EyeOnIcon}
customLabel={m.common_view()}
class="border-input hover:bg-card/60 border hover:text-inherit"
/>
diff --git a/frontend/src/lib/components/arcane-table/arcane-table.svelte b/frontend/src/lib/components/arcane-table/arcane-table.svelte
index 061e3da61..487f43feb 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table.svelte
+++ b/frontend/src/lib/components/arcane-table/arcane-table.svelte
@@ -1,6 +1,5 @@
<script lang="ts" generics="TData extends {id: string}">
import {
- type Column,
type ColumnDef,
type ColumnFiltersState,
type Row,
@@ -12,10 +11,8 @@
} from '@tanstack/table-core';
import { createSvelteTable } from '$lib/components/ui/data-table/data-table.svelte.js';
import DataTableToolbar from './arcane-table-toolbar.svelte';
- import * as Card from '$lib/components/ui/card/index.js';
import { renderComponent, renderSnippet } from '$lib/components/ui/data-table/render-helpers.js';
- import { untrack } from 'svelte';
-
+ import { onMount, untrack } from 'svelte';
import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
import type { Snippet } from 'svelte';
import type { ColumnSpec } from './arcane-table.types.svelte';
@@ -25,6 +22,8 @@
import {
type CompactTablePrefs,
type FieldSpec,
+ type GroupedData,
+ type GroupSelectionState,
encodeHidden,
applyHiddenPatch,
encodeFilters,
@@ -32,6 +31,7 @@
buildMobileVisibility,
type BulkAction
} from './arcane-table.types.svelte';
+ import type { Component } from 'svelte';
import { extractPersistedPreferences, filterMapsEqual, toFilterMap } from './arcane-table.utils';
import ArcaneTablePagination from './arcane-table-pagination.svelte';
import ArcaneTableHeader from './arcane-table-header.svelte';
@@ -59,7 +59,12 @@
customToolbarActions,
customTableView,
customSettings = $bindable<Record<string, unknown>>({}),
- columnVisibility = $bindable<VisibilityState>({})
+ columnVisibility = $bindable<VisibilityState>({}),
+ // Grouping props
+ groupBy,
+ groupIcon,
+ groupCollapsedState = $bindable<Record<string, boolean>>({}),
+ onGroupToggle
}: {
items: Paginated<TData>;
requestOptions: SearchPaginationSortRequest;
@@ -90,15 +95,23 @@
>;
customSettings?: Record<string, unknown>;
columnVisibility?: VisibilityState;
+ // Grouping props
+ groupBy?: (item: TData) => string;
+ groupIcon?: (groupName: string) => Component;
+ groupCollapsedState?: Record<string, boolean>;
+ onGroupToggle?: (groupName: string) => void;
} = $props();
+ // Default page size constant
+ const DEFAULT_LIMIT = 20;
+
let rowSelection = $state<RowSelectionState>({});
let columnFilters = $state<ColumnFiltersState>([]);
let sorting = $state<SortingState>([]);
let globalFilter = $state<string>('');
const enablePersist = $derived(!!persistKey);
- const getDefaultLimit = () => requestOptions?.pagination?.limit ?? items?.pagination?.itemsPerPage ?? 20;
+ const getEffectiveLimit = () => requestOptions?.pagination?.limit ?? items?.pagination?.itemsPerPage ?? DEFAULT_LIMIT;
let prefs = $state<PersistedState<CompactTablePrefs> | null>(null);
const passAllGlobal: (row: unknown, columnId: string, filterValue: unknown) => boolean = () => true;
@@ -106,24 +119,23 @@
const currentPage = $derived(items.pagination?.currentPage ?? requestOptions?.pagination?.page ?? 1);
const totalPages = $derived(items.pagination?.totalPages ?? 1);
const totalItems = $derived(items.pagination?.totalItems ?? 0);
- const pageSize = $derived(requestOptions?.pagination?.limit ?? items?.pagination?.itemsPerPage ?? 20);
+ const pageSize = $derived(requestOptions?.pagination?.limit ?? items?.pagination?.itemsPerPage ?? DEFAULT_LIMIT);
const canPrev = $derived(currentPage > 1);
const canNext = $derived(currentPage < totalPages);
- import { onMount } from 'svelte';
onMount(() => {
// Initialize prefs first
if (persistKey && !prefs) {
prefs = new PersistedState<CompactTablePrefs>(
persistKey,
- { v: [], f: [], g: '', l: getDefaultLimit() },
+ { v: [], f: [], g: '', l: getEffectiveLimit() },
{ syncTabs: false }
);
}
// Then restore preferences
if (!enablePersist) return;
- const snapshot = extractPersistedPreferences(prefs?.current, getDefaultLimit());
+ const snapshot = extractPersistedPreferences(prefs?.current, getEffectiveLimit());
const patchedVisibility = { ...columnVisibility };
applyHiddenPatch(patchedVisibility, snapshot.hiddenColumns);
@@ -139,7 +151,7 @@
requestOptions = {
...requestOptions,
filters: filtersMap,
- pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getDefaultLimit() }
+ pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getEffectiveLimit() }
};
shouldRefresh = true;
}
@@ -147,7 +159,7 @@
requestOptions = {
...requestOptions,
filters: undefined,
- pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getDefaultLimit() }
+ pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getEffectiveLimit() }
};
shouldRefresh = true;
}
@@ -162,7 +174,7 @@
requestOptions = {
...requestOptions,
search: persistedSearch,
- pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getDefaultLimit() }
+ pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getEffectiveLimit() }
};
shouldRefresh = true;
}
@@ -170,13 +182,13 @@
requestOptions = {
...requestOptions,
search: undefined,
- pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getDefaultLimit() }
+ pagination: { page: 1, limit: requestOptions?.pagination?.limit ?? getEffectiveLimit() }
};
shouldRefresh = true;
}
- const persistedLimit = snapshot.limit ?? getDefaultLimit();
- const currentLimit = requestOptions?.pagination?.limit ?? getDefaultLimit();
+ const persistedLimit = snapshot.limit ?? getEffectiveLimit();
+ const currentLimit = requestOptions?.pagination?.limit ?? getEffectiveLimit();
if (persistedLimit !== currentLimit) {
requestOptions = { ...requestOptions, pagination: { page: 1, limit: persistedLimit } };
shouldRefresh = true;
@@ -276,7 +288,12 @@
id,
...(accessorKey ? { accessorKey } : {}),
...(accessorFn ? { accessorFn } : {}),
- meta: { title: spec.title },
+ meta: {
+ title: spec.title,
+ width: spec.width,
+ align: spec.align,
+ truncate: spec.truncate
+ },
header: ({ column }) => {
if (spec.header) return renderSnippet(spec.header, { column, title: spec.title, class: spec.class });
return renderComponent(ArcaneTableHeader, {
@@ -331,7 +348,26 @@
}
});
- const columnsDef = $derived(buildColumns(columns, selectionDisabled));
+ // Memoize column definitions - only rebuild when structure changes
+ // Generate a key based on column structure, not data
+ function getColumnsKey(specs: ColumnSpec<TData>[], hasRowActions: boolean, isSelectionDisabled: boolean): string {
+ const colIds = specs.map((s, i) => s.id ?? s.accessorKey ?? `col_${i}`).join(',');
+ return `${colIds}:${hasRowActions}:${isSelectionDisabled}`;
+ }
+
+ let cachedColumnsDef = $state<ColumnDef<TData>[]>([]);
+ let lastColumnsKey = '';
+
+ // Use $effect to rebuild columns only when structure changes
+ $effect(() => {
+ const key = getColumnsKey(columns, !!rowActions, selectionDisabled);
+ if (key !== lastColumnsKey) {
+ cachedColumnsDef = buildColumns(columns, selectionDisabled);
+ lastColumnsKey = key;
+ }
+ });
+
+ const columnsDef = $derived(cachedColumnsDef.length > 0 ? cachedColumnsDef : buildColumns(columns, selectionDisabled));
const table = createSvelteTable({
get data() {
@@ -447,6 +483,65 @@
}))
);
+ // Compute grouped rows when groupBy is provided
+ const groupedRows = $derived.by((): GroupedData<TData>[] | null => {
+ if (!groupBy) return null;
+
+ const groups = new Map<string, TData[]>();
+ for (const item of items.data ?? []) {
+ const groupName = groupBy(item);
+ if (!groups.has(groupName)) {
+ groups.set(groupName, []);
+ }
+ groups.get(groupName)!.push(item);
+ }
+
+ return Array.from(groups.entries()).map(([groupName, groupItems]) => ({
+ groupName,
+ items: groupItems
+ }));
+ });
+
+ // Get selection state for a group
+ function getGroupSelectionState(groupItems: TData[]): GroupSelectionState {
+ const groupIds = groupItems.map((item) => item.id);
+ const selectedSet = new Set(selectedIds ?? []);
+ const selectedCount = groupIds.filter((id) => selectedSet.has(id)).length;
+
+ if (selectedCount === 0) return 'none';
+ if (selectedCount === groupIds.length) return 'all';
+ return 'some';
+ }
+
+ // Toggle selection for all items in a group
+ function onToggleGroupSelection(groupItems: TData[]) {
+ const groupIds = groupItems.map((item) => item.id);
+ const state = getGroupSelectionState(groupItems);
+
+ if (state === 'all') {
+ // Deselect all in group
+ const groupSet = new Set(groupIds);
+ selectedIds = (selectedIds ?? []).filter((id) => !groupSet.has(id));
+ } else {
+ // Select all in group
+ const set = new Set([...(selectedIds ?? []), ...groupIds]);
+ selectedIds = Array.from(set);
+ }
+ }
+
+ // Handle group collapse toggle
+ function handleGroupToggle(groupName: string) {
+ if (onGroupToggle) {
+ onGroupToggle(groupName);
+ } else {
+ // Default behavior: toggle collapsed state
+ groupCollapsedState = {
+ ...groupCollapsedState,
+ [groupName]: !groupCollapsedState[groupName]
+ };
+ }
+ }
+
$effect(() => {
const s = requestOptions?.sort;
const currentSort = untrack(() => sorting[0]);
@@ -520,7 +615,7 @@
{:else if unstyled}
<div class="flex h-full min-h-0 flex-col">
{#if !withoutSearch}
- <div class="shrink-0 border-b">
+ <div class="w-full shrink-0 border-b">
<DataTableToolbar
{table}
{selectedIds}
@@ -535,13 +630,34 @@
{/if}
<div class="hidden h-full min-h-0 flex-1 overflow-auto md:block">
- <ArcaneTableDesktopView {table} {selectedIds} columnsCount={columnsDef.length} />
+ <ArcaneTableDesktopView
+ {table}
+ {selectedIds}
+ columnsCount={columnsDef.length}
+ {groupedRows}
+ {groupIcon}
+ {groupCollapsedState}
+ {selectionDisabled}
+ onGroupToggle={handleGroupToggle}
+ {getGroupSelectionState}
+ {onToggleGroupSelection}
+ onToggleRowSelection={(id, selected) => onToggleRow(selected, id)}
+ {unstyled}
+ />
</div>
- <!-- Mobile Card View -->
<div class="block flex-1 overflow-auto md:hidden">
<div class="divide-border/40 divide-y">
- <ArcaneTableMobileView {table} {mobileCard} {mobileFieldVisibility} />
+ <ArcaneTableMobileView
+ {table}
+ {mobileCard}
+ {mobileFieldVisibility}
+ {groupedRows}
+ {groupIcon}
+ {groupCollapsedState}
+ onGroupToggle={handleGroupToggle}
+ {unstyled}
+ />
</div>
</div>
@@ -552,37 +668,54 @@
{/if}
</div>
{:else}
- <Card.Root class="flex h-full min-h-0 flex-col overflow-hidden">
- {#snippet children()}
- {#if !withoutSearch}
- <Card.Header class="border-b px-2 py-2">
- <DataTableToolbar
- {table}
- {selectedIds}
- {selectionDisabled}
- {bulkActions}
- mobileFields={mobileFieldsForOptions}
- {onToggleMobileField}
- {customViewOptions}
- {customToolbarActions}
- />
- </Card.Header>
- {/if}
-
- <Card.Content class="hidden h-full min-h-0 flex-1 overflow-auto p-0 md:block">
- <ArcaneTableDesktopView {table} {selectedIds} columnsCount={columnsDef.length} />
- </Card.Content>
-
- <!-- Mobile Card View -->
- <Card.Content class="block flex-1 overflow-auto p-0 md:hidden">
- <ArcaneTableMobileView {table} {mobileCard} {mobileFieldVisibility} />
- </Card.Content>
-
- {#if !withoutPagination}
- <Card.Footer class="shrink-0 border-t px-2 py-4">
- {@render PaginationSnippet()}
- </Card.Footer>
- {/if}
- {/snippet}
- </Card.Root>
+ <div class="bg-background/60 flex h-full min-h-0 flex-col overflow-hidden rounded-xl border backdrop-blur-sm">
+ {#if !withoutSearch}
+ <div class="border-border/50 w-full shrink-0 border-b">
+ <DataTableToolbar
+ {table}
+ {selectedIds}
+ {selectionDisabled}
+ {bulkActions}
+ mobileFields={mobileFieldsForOptions}
+ {onToggleMobileField}
+ {customViewOptions}
+ {customToolbarActions}
+ />
+ </div>
+ {/if}
+
+ <div class="hidden h-full min-h-0 flex-1 overflow-auto md:block">
+ <ArcaneTableDesktopView
+ {table}
+ {selectedIds}
+ columnsCount={columnsDef.length}
+ {groupedRows}
+ {groupIcon}
+ {groupCollapsedState}
+ {selectionDisabled}
+ onGroupToggle={handleGroupToggle}
+ {getGroupSelectionState}
+ {onToggleGroupSelection}
+ onToggleRowSelection={(id, selected) => onToggleRow(selected, id)}
+ />
+ </div>
+
+ <div class="block flex-1 overflow-auto md:hidden">
+ <ArcaneTableMobileView
+ {table}
+ {mobileCard}
+ {mobileFieldVisibility}
+ {groupedRows}
+ {groupIcon}
+ {groupCollapsedState}
+ onGroupToggle={handleGroupToggle}
+ />
+ </div>
+
+ {#if !withoutPagination}
+ <div class="border-border/50 shrink-0 border-t px-2 py-4">
+ {@render PaginationSnippet()}
+ </div>
+ {/if}
+ </div>
{/if}
diff --git a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
index fb0e00d2c..ec5143f03 100644
--- a/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
+++ b/frontend/src/lib/components/arcane-table/arcane-table.types.svelte.ts
@@ -9,6 +9,9 @@ export type FieldSpec = {
export type MobileFieldVisibility = Record<string, boolean>;
+export type ColumnWidth = 'auto' | 'min' | 'max' | number;
+export type ColumnAlign = 'left' | 'center' | 'right';
+
export type ColumnSpec<T> = {
accessorKey?: keyof T & string;
accessorFn?: (row: T) => any;
@@ -20,6 +23,9 @@ export type ColumnSpec<T> = {
header?: Snippet<[{ column: Column<T>; title: string; class?: string }]>;
class?: string;
filterFn?: FilterFn<T>;
+ width?: ColumnWidth;
+ align?: ColumnAlign;
+ truncate?: boolean;
};
// Compact persisted prefs to reduce JSON size
@@ -103,3 +109,11 @@ export type BulkAction = {
loading?: boolean;
icon?: any;
};
+
+// Grouping types
+export type GroupedData<T> = {
+ groupName: string;
+ items: T[];
+};
+
+export type GroupSelectionState = 'none' | 'some' | 'all';
diff --git a/frontend/src/lib/components/arcane-table/cards/universal-mobile-card.svelte b/frontend/src/lib/components/arcane-table/cards/universal-mobile-card.svelte
index 70380ec95..bbf5dce49 100644
--- a/frontend/src/lib/components/arcane-table/cards/universal-mobile-card.svelte
+++ b/frontend/src/lib/components/arcane-table/cards/universal-mobile-card.svelte
@@ -118,15 +118,14 @@
)}
onclick={onclick ? () => onclick(item) : undefined}
>
- <Card.Content class={cn('flex flex-col text-left', compact ? 'gap-2 p-3' : 'gap-2.5 p-3')}>
- <!-- Header Row: Icon + Title/Subtitle + Actions -->
- <div class={cn('flex gap-2.5', hasSubtitle ? 'items-start' : 'items-center')}>
+ <Card.Content class={cn('flex flex-col text-left', compact ? 'gap-2.5 p-3' : 'gap-3 p-3.5')}>
+ <div class={cn('flex gap-3', hasSubtitle ? 'items-start' : 'items-center')}>
{#if resolvedIcon}
{@const IconComponent = resolvedIcon.component}
<div
class={cn(
- 'flex shrink-0 items-center justify-center rounded-lg ring-1 backdrop-blur-sm transition-transform duration-200 ring-inset group-hover:scale-105',
- compact ? 'size-8' : 'size-9',
+ 'flex shrink-0 items-center justify-center rounded-xl ring-1 backdrop-blur-sm transition-transform duration-200 ring-inset group-hover:scale-105',
+ compact ? 'size-10' : 'size-11',
getIconBgClass(resolvedIcon.variant),
'ring-white/5'
)}
@@ -142,31 +141,28 @@
onerror={() => (errorImageUrl = resolvedIcon?.imageUrl)}
/>
{:else}
- <IconComponent class={cn(getIconTextClass(resolvedIcon.variant), compact ? 'size-3.5' : 'size-4')} />
+ <IconComponent class={cn(getIconTextClass(resolvedIcon.variant), compact ? 'size-4' : 'size-5')} />
{/if}
</div>
{/if}
<div class="min-w-0 flex-1">
<h3
- class={cn('line-clamp-2 leading-snug font-semibold break-all', compact ? 'text-sm' : 'text-sm')}
+ class={cn('line-clamp-2 leading-tight font-semibold wrap-break-word', compact ? 'text-sm' : 'text-base')}
title={title(item)}
>
{title(item)}
</h3>
{#if hasSubtitle}
- <p class={cn('text-muted-foreground truncate font-mono', compact ? 'text-[10px]' : 'text-[11px]')}>
+ <p class={cn('text-muted-foreground mt-0.5 truncate font-mono', compact ? 'text-[10px]' : 'text-xs')}>
{subtitleValue}
</p>
{/if}
</div>
{#if rowActions}
- <div class="shrink-0">
- {@render rowActions({ item })}
- </div>
+ {@render rowActions({ item })}
{/if}
</div>
- <!-- Badges Row -->
{#if resolvedBadges.length > 0}
<div class="flex flex-wrap items-center gap-1">
{#each resolvedBadges as badge}
@@ -178,33 +174,33 @@
<!-- Additional Fields -->
{#if visibleFields.length > 0}
{#if !compact}
- <div class="flex flex-wrap gap-x-4 gap-y-2">
+ <div class="flex flex-wrap gap-x-4 gap-y-2.5">
{#each visibleFields as field}
{@const value = field.getValue(item)}
{#if value !== null && value !== undefined}
- <div class="flex min-w-0 flex-1 basis-[140px] items-center gap-2">
+ <div class="flex min-w-0 flex-1 basis-[140px] items-center gap-2.5">
{#if field.icon}
{@const FieldIcon = field.icon}
<div
class={cn(
- 'flex size-6 shrink-0 items-center justify-center rounded-md ring-1 ring-white/5 ring-inset',
+ 'flex size-7 shrink-0 items-center justify-center rounded-lg ring-1 ring-white/5 ring-inset',
field.iconVariant ? getIconBgClass(field.iconVariant) : 'bg-muted/40'
)}
>
<FieldIcon
- class={cn(field.iconVariant ? getIconTextClass(field.iconVariant) : 'text-muted-foreground', 'size-3')}
+ class={cn(field.iconVariant ? getIconTextClass(field.iconVariant) : 'text-muted-foreground', 'size-3.5')}
/>
</div>
{/if}
<div class="min-w-0 flex-1">
- <div class="text-muted-foreground/70 text-[9px] font-medium tracking-wide uppercase">
+ <div class="text-muted-foreground text-[11px] font-medium tracking-wide uppercase">
{field.label}
</div>
- <div class="truncate text-xs leading-snug font-medium">
+ <div class="truncate text-sm leading-snug font-medium">
{#if field.type === 'badge' && field.badgeVariant}
<StatusBadge variant={field.badgeVariant} text={String(value)} size="sm" />
{:else if field.type === 'mono'}
- <span class="font-mono text-[11px]">{value}</span>
+ <span class="font-mono text-xs">{value}</span>
{:else if field.type === 'component' && field.component}
{@render field.component(value)}
{:else}
@@ -221,17 +217,17 @@
{@const value = field.getValue(item)}
{#if value !== null && value !== undefined}
<div class="flex items-baseline gap-2">
- <span class="text-muted-foreground/70 text-[10px] font-semibold tracking-wider uppercase">{field.label}:</span>
+ <span class="text-muted-foreground text-[11px] font-semibold tracking-wide uppercase">{field.label}:</span>
{#if field.type === 'badge' && field.badgeVariant}
<StatusBadge variant={field.badgeVariant} text={String(value)} size="sm" />
{:else if field.type === 'mono'}
- <span class="text-muted-foreground truncate font-mono text-[11px] leading-tight">{value}</span>
+ <span class="text-muted-foreground truncate font-mono text-xs leading-tight">{value}</span>
{:else if field.type === 'component' && field.component}
- <span class="text-muted-foreground min-w-0 flex-1 text-[11px] leading-tight">
+ <span class="text-muted-foreground min-w-0 flex-1 text-xs leading-tight">
{@render field.component(value)}
</span>
{:else}
- <span class="text-muted-foreground min-w-0 flex-1 truncate text-[11px] leading-tight">
+ <span class="text-muted-foreground min-w-0 flex-1 truncate text-xs leading-tight">
{value}
</span>
{/if}
@@ -251,12 +247,12 @@
{@const footerValue = footer.getValue(item)}
{#if footerValue}
{@const FooterIcon = footer.icon}
- <Card.Footer class="bg-muted/30 border-border/40 flex items-center gap-2 border-t px-3 !py-2">
- <FooterIcon class="text-muted-foreground size-3.5" />
- <span class="text-muted-foreground/70 text-[9px] font-medium tracking-wide uppercase">
+ <Card.Footer class="bg-muted/30 border-border/40 flex items-center gap-2.5 border-t px-3.5 py-2.5!">
+ <FooterIcon class="text-muted-foreground size-4" />
+ <span class="text-muted-foreground text-[11px] font-medium tracking-wide uppercase">
{footer.label}
</span>
- <span class="text-foreground ml-auto font-mono text-[11px] font-medium">
+ <span class="text-foreground ml-auto font-mono text-xs font-medium">
{footerValue}
</span>
</Card.Footer>
diff --git a/frontend/src/lib/components/arcane-table/data.ts b/frontend/src/lib/components/arcane-table/data.ts
index bff9f7d37..335ff9ca5 100644
--- a/frontend/src/lib/components/arcane-table/data.ts
+++ b/frontend/src/lib/components/arcane-table/data.ts
@@ -27,14 +27,24 @@ export const usageFilters = [
export const imageUpdateFilters = [
{
- value: true,
+ value: 'has_update',
label: m.images_has_updates(),
icon: UpdateIcon
},
{
- value: false,
+ value: 'up_to_date',
label: m.images_no_updates(),
icon: VerifiedCheckIcon
+ },
+ {
+ value: 'error',
+ label: m.common_error(),
+ icon: CloseIcon
+ },
+ {
+ value: 'unknown',
+ label: m.common_unknown(),
+ icon: InfoIcon
}
];
diff --git a/frontend/src/lib/components/ui/card/card.svelte b/frontend/src/lib/components/ui/card/card.svelte
index 4304d0547..015c5e473 100644
--- a/frontend/src/lib/components/ui/card/card.svelte
+++ b/frontend/src/lib/components/ui/card/card.svelte
@@ -32,7 +32,7 @@
case 'subtle':
return 'backdrop-blur-sm bg-white/10 dark:bg-surface/10';
case 'outlined':
- return 'backdrop-blur-lg bg-white/10 dark:bg-surface/10';
+ return 'backdrop-blur-sm bg-white/10 dark:bg-surface/10 border border-border/60';
default:
return 'backdrop-blur-sm bg-white/10 shadow-sm dark:bg-surface/10';
}
@@ -46,7 +46,7 @@
'text-card-foreground group relative isolate gap-0 overflow-hidden rounded-xl border border-white/80 p-0 transition-all duration-300 dark:border-surface/80',
getVariantClasses(variant),
onclick
- ? '[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:bg-muted/50 cursor-pointer [&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:shadow-md'
+ ? '[&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:bg-muted/60 cursor-pointer [&:not(:has(button:hover,a:hover,[role=button]:hover))]:hover:shadow-md'
: '',
className
)}
diff --git a/frontend/src/lib/components/ui/table/table-cell.svelte b/frontend/src/lib/components/ui/table/table-cell.svelte
index 96fa2ad87..7708c7daf 100644
--- a/frontend/src/lib/components/ui/table/table-cell.svelte
+++ b/frontend/src/lib/components/ui/table/table-cell.svelte
@@ -8,7 +8,11 @@
<td
bind:this={ref}
data-slot="table-cell"
- class={cn('px-4 py-3 align-middle whitespace-nowrap first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0', className)}
+ class={cn(
+ 'bg-transparent px-4 py-3 align-middle whitespace-nowrap',
+ 'first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0',
+ className
+ )}
{...restProps}
>
{@render children?.()}
diff --git a/frontend/src/lib/components/ui/table/table-head.svelte b/frontend/src/lib/components/ui/table/table-head.svelte
index bf71a8c2c..a5fe162aa 100644
--- a/frontend/src/lib/components/ui/table/table-head.svelte
+++ b/frontend/src/lib/components/ui/table/table-head.svelte
@@ -9,7 +9,8 @@
bind:this={ref}
data-slot="table-head"
class={cn(
- 'text-muted-foreground h-12 px-4 text-left align-middle text-xs font-medium whitespace-nowrap uppercase first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0',
+ 'text-muted-foreground h-11 px-4 text-left align-middle text-[11px] font-semibold tracking-wide whitespace-nowrap uppercase',
+ 'first:pl-6 last:pr-6 [&:has([role=checkbox])]:pr-0',
className
)}
{...restProps}
diff --git a/frontend/src/lib/components/ui/table/table-header.svelte b/frontend/src/lib/components/ui/table/table-header.svelte
index d72e3d3be..c840a2bcc 100644
--- a/frontend/src/lib/components/ui/table/table-header.svelte
+++ b/frontend/src/lib/components/ui/table/table-header.svelte
@@ -10,6 +10,11 @@
}: WithElementRef<HTMLAttributes<HTMLTableSectionElement>> = $props();
</script>
-<thead bind:this={ref} data-slot="table-header" class={cn('[&_tr]:border-b', className)} {...restProps}>
+<thead
+ bind:this={ref}
+ data-slot="table-header"
+ class={cn('bg-primary/10 [&_tr]:border-border/50 backdrop-blur-sm [&_tr]:border-b', className)}
+ {...restProps}
+>
{@render children?.()}
</thead>
diff --git a/frontend/src/lib/components/ui/table/table-row.svelte b/frontend/src/lib/components/ui/table/table-row.svelte
index 1a36d35fa..d03d26d8f 100644
--- a/frontend/src/lib/components/ui/table/table-row.svelte
+++ b/frontend/src/lib/components/ui/table/table-row.svelte
@@ -13,7 +13,11 @@
<tr
bind:this={ref}
data-slot="table-row"
- class={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className)}
+ class={cn(
+ 'group/row border-border/40 bg-background cursor-pointer border-b transition-colors',
+ 'hover:bg-primary/15 data-[state=selected]:bg-primary/10',
+ className
+ )}
{...restProps}
>
{@render children?.()}
diff --git a/frontend/src/routes/(app)/containers/components/container-stats-manager.svelte.ts b/frontend/src/routes/(app)/containers/components/container-stats-manager.svelte.ts
index 30c01ad1f..52fe10b33 100644
--- a/frontend/src/routes/(app)/containers/components/container-stats-manager.svelte.ts
+++ b/frontend/src/routes/(app)/containers/components/container-stats-manager.svelte.ts
@@ -6,27 +6,30 @@ import {
calculateMemoryUsage
} from '$lib/utils/container-stats.utils';
import type { ReconnectingWebSocket } from '$lib/utils/ws';
+import { SvelteMap, SvelteSet } from 'svelte/reactivity';
export class ContainerStatsManager {
- private connections = new Map<string, ReconnectingWebSocket<ContainerStats>>();
- private stats = $state(new Map<string, ContainerStats>());
- private loadingStates = $state(new Map<string, boolean>());
+ private connections = new SvelteMap<string, ReconnectingWebSocket<ContainerStats>>();
+ private stats = new SvelteMap<string, ContainerStats>();
+ private loadingStates = new SvelteMap<string, boolean>();
+ private desiredIds = new SvelteSet<string>();
+ private currentEnvId: string | null = null;
connect(containerId: string, envId: string): void {
if (this.connections.has(containerId)) return;
- this.loadingStates = new Map(this.loadingStates).set(containerId, true);
+ this.loadingStates.set(containerId, true);
const ws = createContainerStatsWebSocket({
getEnvId: () => envId,
containerId,
onMessage: (data: ContainerStats) => {
- this.stats = new Map(this.stats).set(containerId, data);
- this.loadingStates = new Map(this.loadingStates).set(containerId, false);
+ this.stats.set(containerId, data);
+ this.loadingStates.set(containerId, false);
},
onError: (err) => {
console.error(`[ContainerStatsManager] Stats error for container ${containerId}:`, err);
- this.loadingStates = new Map(this.loadingStates).set(containerId, false);
+ this.loadingStates.set(containerId, false);
},
shouldReconnect: () => this.connections.has(containerId)
});
@@ -40,12 +43,8 @@ export class ContainerStatsManager {
if (ws) {
ws.close();
this.connections.delete(containerId);
- const newStats = new Map(this.stats);
- newStats.delete(containerId);
- this.stats = newStats;
- const newLoadingStates = new Map(this.loadingStates);
- newLoadingStates.delete(containerId);
- this.loadingStates = newLoadingStates;
+ this.stats.delete(containerId);
+ this.loadingStates.delete(containerId);
}
}
@@ -82,12 +81,48 @@ export class ContainerStatsManager {
return Array.from(this.connections.keys());
}
+ set envId(value: string) {
+ if (this.currentEnvId === value) return;
+ this.currentEnvId = value;
+ this.resetConnections();
+ this.syncConnections();
+ }
+
+ set targetIds(value: Set<string>) {
+ this.desiredIds = new SvelteSet(value);
+ this.syncConnections();
+ }
+
+ private resetConnections(): void {
+ const ids = Array.from(this.connections.keys());
+ for (const id of ids) {
+ this.disconnect(id);
+ }
+ }
+
+ private syncConnections(): void {
+ if (!this.currentEnvId) return;
+ const connectedIds = new SvelteSet(this.connections.keys());
+
+ for (const id of this.desiredIds) {
+ if (!connectedIds.has(id)) {
+ this.connect(id, this.currentEnvId);
+ }
+ }
+
+ for (const id of connectedIds) {
+ if (!this.desiredIds.has(id)) {
+ this.disconnect(id);
+ }
+ }
+ }
+
destroy(): void {
for (const ws of this.connections.values()) {
ws.close();
}
this.connections.clear();
- this.stats = new Map();
- this.loadingStates = new Map();
+ this.stats.clear();
+ this.loadingStates.clear();
}
}
diff --git a/frontend/src/routes/(app)/containers/container-table.actions.ts b/frontend/src/routes/(app)/containers/container-table.actions.ts
new file mode 100644
index 000000000..37cd85799
--- /dev/null
+++ b/frontend/src/routes/(app)/containers/container-table.actions.ts
@@ -0,0 +1,320 @@
+import { openConfirmDialog } from '$lib/components/confirm-dialog';
+import { m } from '$lib/paraglide/messages';
+import { containerService } from '$lib/services/container-service';
+import type { ContainerSummaryDto } from '$lib/types/container.type';
+import type { Paginated, SearchPaginationSortRequest } from '$lib/types/pagination.type';
+import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
+import { tryCatch } from '$lib/utils/try-catch';
+import { toast } from 'svelte-sonner';
+import { getContainerDisplayName, type ActionStatus } from './container-table.helpers';
+
+type BulkLoadingState = {
+ start: boolean;
+ stop: boolean;
+ restart: boolean;
+ remove: boolean;
+};
+
+type ActionDeps = {
+ getRequestOptions: () => SearchPaginationSortRequest;
+ setContainers: (next: Paginated<ContainerSummaryDto>) => void;
+ setSelectedIds: (next: string[]) => void;
+ actionStatus: Record<string, ActionStatus>;
+ isBulkLoading: BulkLoadingState;
+};
+
+type ContainerActionKind = 'start' | 'stop' | 'restart';
+
+type ContainerActionConfig = {
+ status: ActionStatus;
+ run: (id: string) => Promise<unknown>;
+ success: () => string;
+ failure: () => string;
+};
+
+type BulkActionConfig = {
+ title: (count: number) => string;
+ message: (count: number) => string;
+ label: string;
+ loadingKey: keyof BulkLoadingState;
+ run: (id: string) => Promise<unknown>;
+ success: (count: number) => string;
+ partial: (success: number, total: number, failed: number) => string;
+ failure: () => string;
+ destructive?: boolean;
+};
+
+const containerActionConfigs: Record<ContainerActionKind, ContainerActionConfig> = {
+ start: {
+ status: 'starting',
+ run: (id) => containerService.startContainer(id),
+ success: () => m.containers_start_success(),
+ failure: () => m.containers_start_failed()
+ },
+ stop: {
+ status: 'stopping',
+ run: (id) => containerService.stopContainer(id),
+ success: () => m.containers_stop_success(),
+ failure: () => m.containers_stop_failed()
+ },
+ restart: {
+ status: 'restarting',
+ run: (id) => containerService.restartContainer(id),
+ success: () => m.containers_restart_success(),
+ failure: () => m.containers_restart_failed()
+ }
+};
+
+export function createContainerActions({
+ getRequestOptions,
+ setContainers,
+ setSelectedIds,
+ actionStatus,
+ isBulkLoading
+}: ActionDeps) {
+ const refreshContainers = async () => {
+ const result = await containerService.getContainers(getRequestOptions());
+ setContainers(result);
+ return result;
+ };
+
+ async function performContainerAction(action: ContainerActionKind, id: string) {
+ const config = containerActionConfigs[action];
+ actionStatus[id] = config.status;
+
+ try {
+ handleApiResultWithCallbacks({
+ result: await tryCatch(config.run(id)),
+ message: config.failure(),
+ setLoadingState: (value) => {
+ actionStatus[id] = value ? config.status : '';
+ },
+ async onSuccess() {
+ toast.success(config.success());
+ await refreshContainers();
+ }
+ });
+ } catch (error) {
+ console.error('Container action failed:', error);
+ toast.error(m.containers_action_error());
+ actionStatus[id] = '';
+ }
+ }
+
+ async function handleRemoveContainer(id: string, name: string) {
+ openConfirmDialog({
+ title: m.containers_remove_confirm_title(),
+ message: m.containers_remove_confirm_message({ resource: name }),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.containers_remove_force_label(),
+ initialState: false
+ },
+ {
+ id: 'volumes',
+ label: m.containers_remove_volumes_label(),
+ initialState: false
+ }
+ ],
+ confirm: {
+ label: m.common_remove(),
+ destructive: true,
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
+ const volumes = !!checkboxStates.volumes;
+ actionStatus[id] = 'removing';
+ handleApiResultWithCallbacks({
+ result: await tryCatch(containerService.deleteContainer(id, { force, volumes })),
+ message: m.containers_remove_failed(),
+ setLoadingState: (value) => {
+ actionStatus[id] = value ? 'removing' : '';
+ },
+ async onSuccess() {
+ toast.success(m.containers_remove_success());
+ await refreshContainers();
+ }
+ });
+ }
+ }
+ });
+ }
+
+ async function handleUpdateContainer(container: ContainerSummaryDto) {
+ const containerName = getContainerDisplayName(container);
+
+ openConfirmDialog({
+ title: m.containers_update_confirm_title(),
+ message: m.containers_update_confirm_message({ name: containerName }),
+ confirm: {
+ label: m.containers_update_container(),
+ destructive: false,
+ action: async () => {
+ actionStatus[container.id] = 'updating';
+ try {
+ toast.info(m.containers_update_pulling_image());
+
+ const result = await containerService.updateContainer(container.id);
+
+ if (result.failed > 0) {
+ const failedItem = result.items?.find((item: { status?: string; error?: string }) => item.status === 'failed');
+ toast.error(
+ m.containers_update_failed({ name: containerName }) +
+ (failedItem?.error ? `: ${failedItem.error}` : '')
+ );
+ } else if (result.updated > 0) {
+ toast.success(m.containers_update_success({ name: containerName }));
+ } else {
+ toast.info(m.image_update_up_to_date_title());
+ }
+
+ await refreshContainers();
+ } catch (error) {
+ console.error('Container update failed:', error);
+ toast.error(m.containers_update_failed({ name: containerName }));
+ } finally {
+ actionStatus[container.id] = '';
+ }
+ }
+ }
+ });
+ }
+
+ async function runBulkAction(ids: string[], config: BulkActionConfig) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: config.title(ids.length),
+ message: config.message(ids.length),
+ confirm: {
+ label: config.label,
+ destructive: config.destructive ?? false,
+ action: async () => {
+ isBulkLoading[config.loadingKey] = true;
+
+ const results = await Promise.allSettled(ids.map((id) => config.run(id)));
+
+ const successCount = results.filter((result) => result.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading[config.loadingKey] = false;
+
+ if (successCount === ids.length) {
+ toast.success(config.success(successCount));
+ } else if (successCount > 0) {
+ toast.warning(config.partial(successCount, ids.length, failureCount));
+ } else {
+ toast.error(config.failure());
+ }
+
+ await refreshContainers();
+ setSelectedIds([]);
+ }
+ }
+ });
+ }
+
+ async function handleBulkStart(ids: string[]) {
+ await runBulkAction(ids, {
+ title: (count) => m.containers_bulk_start_confirm_title({ count }),
+ message: (count) => m.containers_bulk_start_confirm_message({ count }),
+ label: m.common_start(),
+ loadingKey: 'start',
+ run: (id) => containerService.startContainer(id),
+ success: (count) => m.containers_bulk_start_success({ count }),
+ partial: (success, total, failed) =>
+ m.containers_bulk_start_partial({ success, total, failed }),
+ failure: () => m.containers_start_failed()
+ });
+ }
+
+ async function handleBulkStop(ids: string[]) {
+ await runBulkAction(ids, {
+ title: (count) => m.containers_bulk_stop_confirm_title({ count }),
+ message: (count) => m.containers_bulk_stop_confirm_message({ count }),
+ label: m.common_stop(),
+ loadingKey: 'stop',
+ run: (id) => containerService.stopContainer(id),
+ success: (count) => m.containers_bulk_stop_success({ count }),
+ partial: (success, total, failed) =>
+ m.containers_bulk_stop_partial({ success, total, failed }),
+ failure: () => m.containers_stop_failed()
+ });
+ }
+
+ async function handleBulkRestart(ids: string[]) {
+ await runBulkAction(ids, {
+ title: (count) => m.containers_bulk_restart_confirm_title({ count }),
+ message: (count) => m.containers_bulk_restart_confirm_message({ count }),
+ label: m.common_restart(),
+ loadingKey: 'restart',
+ run: (id) => containerService.restartContainer(id),
+ success: (count) => m.containers_bulk_restart_success({ count }),
+ partial: (success, total, failed) =>
+ m.containers_bulk_restart_partial({ success, total, failed }),
+ failure: () => m.containers_restart_failed()
+ });
+ }
+
+ async function handleBulkRemove(ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ openConfirmDialog({
+ title: m.containers_bulk_remove_confirm_title({ count: ids.length }),
+ message: m.containers_bulk_remove_confirm_message({ count: ids.length }),
+ checkboxes: [
+ {
+ id: 'force',
+ label: m.containers_remove_force_label(),
+ initialState: false
+ },
+ {
+ id: 'volumes',
+ label: m.containers_remove_volumes_label(),
+ initialState: false
+ }
+ ],
+ confirm: {
+ label: m.common_remove(),
+ destructive: true,
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
+ const volumes = !!checkboxStates.volumes;
+ isBulkLoading.remove = true;
+
+ const results = await Promise.allSettled(
+ ids.map((id) => containerService.deleteContainer(id, { force, volumes }))
+ );
+
+ const successCount = results.filter((result) => result.status === 'fulfilled').length;
+ const failureCount = results.length - successCount;
+
+ isBulkLoading.remove = false;
+
+ if (successCount === ids.length) {
+ toast.success(m.containers_bulk_remove_success({ count: successCount }));
+ } else if (successCount > 0) {
+ toast.warning(
+ m.containers_bulk_remove_partial({ success: successCount, total: ids.length, failed: failureCount })
+ );
+ } else {
+ toast.error(m.containers_remove_failed());
+ }
+
+ await refreshContainers();
+ setSelectedIds([]);
+ }
+ }
+ });
+ }
+
+ return {
+ performContainerAction,
+ handleRemoveContainer,
+ handleUpdateContainer,
+ handleBulkStart,
+ handleBulkStop,
+ handleBulkRestart,
+ handleBulkRemove
+ };
+}
diff --git a/frontend/src/routes/(app)/containers/container-table.helpers.ts b/frontend/src/routes/(app)/containers/container-table.helpers.ts
new file mode 100644
index 000000000..9db7f7686
--- /dev/null
+++ b/frontend/src/routes/(app)/containers/container-table.helpers.ts
@@ -0,0 +1,65 @@
+import { m } from '$lib/paraglide/messages';
+import type { ContainerSummaryDto } from '$lib/types/container.type';
+
+export type ActionStatus = 'starting' | 'stopping' | 'restarting' | 'updating' | 'removing' | '';
+export type StateBadgeVariant = 'green' | 'red' | 'amber';
+
+export function parseImageRef(imageRef: string): { repo: string; tag: string } {
+ // Handle images like "nginx:latest", "library/nginx:1.0", "ghcr.io/org/image:tag"
+ const lastColon = imageRef.lastIndexOf(':');
+ // Check if colon is part of a tag (not a port in registry URL)
+ const hasTag = lastColon > 0 && !imageRef.substring(lastColon).includes('/');
+
+ if (hasTag) {
+ return {
+ repo: imageRef.substring(0, lastColon),
+ tag: imageRef.substring(lastColon + 1)
+ };
+ }
+ return { repo: imageRef, tag: 'latest' };
+}
+
+export function getContainerDisplayName(container: ContainerSummaryDto): string {
+ if (container.names && container.names.length > 0) {
+ return container.names[0].replace(/^\//, '');
+ }
+ return container.id.substring(0, 12);
+}
+
+const actionStatusMessages: Record<ActionStatus, () => string> = {
+ starting: () => m.common_action_starting(),
+ stopping: () => m.common_action_stopping(),
+ restarting: () => m.common_action_restarting(),
+ updating: () => m.common_action_updating(),
+ removing: () => m.common_action_removing(),
+ '': () => ''
+};
+
+export function getActionStatusMessage(status: ActionStatus): string {
+ return actionStatusMessages[status]();
+}
+
+export function getStateBadgeVariant(state: string): StateBadgeVariant {
+ if (state === 'running') return 'green';
+ if (state === 'exited') return 'red';
+ return 'amber';
+}
+
+export function getContainerIpAddress(container: ContainerSummaryDto): string | null {
+ const networks = container.networkSettings?.networks;
+ if (!networks) return null;
+ for (const networkName in networks) {
+ const network = networks[networkName];
+ if (network?.ipAddress) return network.ipAddress;
+ }
+ return null;
+}
+
+export function getProjectName(container: ContainerSummaryDto): string {
+ const projectLabel = container.labels?.['com.docker.compose.project'];
+ return projectLabel || 'No Project';
+}
+
+export function groupContainerByProject(container: ContainerSummaryDto): string {
+ return getProjectName(container);
+}
diff --git a/frontend/src/routes/(app)/containers/container-table.svelte b/frontend/src/routes/(app)/containers/container-table.svelte
index e207b8a66..e1fa9c4bf 100644
--- a/frontend/src/routes/(app)/containers/container-table.svelte
+++ b/frontend/src/routes/(app)/containers/container-table.svelte
@@ -3,11 +3,7 @@
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import { Spinner } from '$lib/components/ui/spinner/index.js';
import { goto } from '$app/navigation';
- import { toast } from 'svelte-sonner';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
- import { openConfirmDialog } from '$lib/components/confirm-dialog';
- import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
- import { tryCatch } from '$lib/utils/try-catch';
import type { SearchPaginationSortRequest, Paginated } from '$lib/types/pagination.type';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { format } from 'date-fns';
@@ -18,11 +14,6 @@
import { PortBadge } from '$lib/components/badges/index.js';
import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
import { containerService } from '$lib/services/container-service';
- import DropdownCard from '$lib/components/dropdown-card.svelte';
- import type { Table as TableType } from '@tanstack/table-core';
- import * as Table from '$lib/components/ui/table/index.js';
- import FlexRender from '$lib/components/ui/data-table/flex-render.svelte';
- import DataTableToolbar from '$lib/components/arcane-table/arcane-table-toolbar.svelte';
import * as ArcaneTooltip from '$lib/components/arcane-tooltip';
import ImageUpdateItem from '$lib/components/image-update-item.svelte';
import { PersistedState } from 'runed';
@@ -32,14 +23,22 @@
import { environmentStore } from '$lib/stores/environment.store.svelte';
import IconImage from '$lib/components/icon-image.svelte';
import { getArcaneIconUrlFromLabels } from '$lib/utils/arcane-labels';
+ import { createContainerActions } from './container-table.actions';
+ import {
+ getActionStatusMessage,
+ getContainerDisplayName,
+ getContainerIpAddress,
+ getStateBadgeVariant,
+ groupContainerByProject,
+ parseImageRef,
+ type ActionStatus
+ } from './container-table.helpers';
import {
StartIcon,
StopIcon,
RefreshIcon,
TrashIcon,
EllipsisIcon,
- ArrowDownIcon,
- ArrowRightIcon,
BoxIcon,
ClockIcon,
ImagesIcon,
@@ -62,7 +61,6 @@
} = $props();
// Track action status per container ID (e.g., "starting", "stopping", "updating", "")
- type ActionStatus = 'starting' | 'stopping' | 'restarting' | 'updating' | 'removing' | '';
let actionStatus = $state<Record<string, ActionStatus>>({});
let isBulkLoading = $state({
@@ -72,48 +70,7 @@
remove: false
});
- let statsManager = $state<ContainerStatsManager | null>(null);
-
- // Parse image reference into repo and tag
- function parseImageRef(imageRef: string): { repo: string; tag: string } {
- // Handle images like "nginx:latest", "library/nginx:1.0", "ghcr.io/org/image:tag"
- const lastColon = imageRef.lastIndexOf(':');
- // Check if colon is part of a tag (not a port in registry URL)
- const hasTag = lastColon > 0 && !imageRef.substring(lastColon).includes('/');
-
- if (hasTag) {
- return {
- repo: imageRef.substring(0, lastColon),
- tag: imageRef.substring(lastColon + 1)
- };
- }
- return { repo: imageRef, tag: 'latest' };
- }
-
- function getContainerDisplayName(container: ContainerSummaryDto): string {
- if (container.names && container.names.length > 0) {
- return container.names[0].replace(/^\//, '');
- }
- return container.id.substring(0, 12);
- }
-
- function getActionStatusMessage(status: ActionStatus): string {
- const messages: Record<ActionStatus, () => string> = {
- starting: () => m.common_action_starting(),
- stopping: () => m.common_action_stopping(),
- restarting: () => m.common_action_restarting(),
- updating: () => m.common_action_updating(),
- removing: () => m.common_action_removing(),
- '': () => ''
- };
- return messages[status]();
- }
-
- function getStateBadgeVariant(state: string): 'green' | 'red' | 'amber' {
- if (state === 'running') return 'green';
- if (state === 'exited') return 'red';
- return 'amber';
- }
+ const statsManager = new ContainerStatsManager();
async function refreshContainers(options: SearchPaginationSortRequest) {
const result = await containerService.getContainers(options);
@@ -126,6 +83,10 @@
}
function setShowInternal(value: boolean) {
+ const currentSetting = (customSettings.showInternalContainers as boolean) ?? false;
+ const currentRequest = requestOptions?.includeInternal ?? false;
+ if (value === currentSetting && value === currentRequest) return;
+
customSettings = { ...customSettings, showInternalContainers: value };
const nextOptions: SearchPaginationSortRequest = {
...requestOptions,
@@ -136,290 +97,25 @@
refreshContainers(nextOptions);
}
- async function performContainerAction(action: 'start' | 'stop' | 'restart', id: string) {
- // Set action status for this specific container
- if (action === 'start') {
- actionStatus[id] = 'starting';
- } else if (action === 'stop') {
- actionStatus[id] = 'stopping';
- } else if (action === 'restart') {
- actionStatus[id] = 'restarting';
- }
-
- try {
- if (action === 'start') {
- handleApiResultWithCallbacks({
- result: await tryCatch(containerService.startContainer(id)),
- message: m.containers_start_failed(),
- setLoadingState: (value) => {
- actionStatus[id] = value ? 'starting' : '';
- },
- async onSuccess() {
- toast.success(m.containers_start_success());
- containers = await containerService.getContainers(requestOptions);
- }
- });
- } else if (action === 'stop') {
- handleApiResultWithCallbacks({
- result: await tryCatch(containerService.stopContainer(id)),
- message: m.containers_stop_failed(),
- setLoadingState: (value) => {
- actionStatus[id] = value ? 'stopping' : '';
- },
- async onSuccess() {
- toast.success(m.containers_stop_success());
- containers = await containerService.getContainers(requestOptions);
- }
- });
- } else if (action === 'restart') {
- handleApiResultWithCallbacks({
- result: await tryCatch(containerService.restartContainer(id)),
- message: m.containers_restart_failed(),
- setLoadingState: (value) => {
- actionStatus[id] = value ? 'restarting' : '';
- },
- async onSuccess() {
- toast.success(m.containers_restart_success());
- containers = await containerService.getContainers(requestOptions);
- }
- });
- }
- } catch (error) {
- console.error('Container action failed:', error);
- toast.error(m.containers_action_error());
- actionStatus[id] = '';
- }
- }
-
- async function handleRemoveContainer(id: string, name: string) {
- openConfirmDialog({
- title: m.containers_remove_confirm_title(),
- message: m.containers_remove_confirm_message({ resource: name }),
- checkboxes: [
- {
- id: 'force',
- label: m.containers_remove_force_label(),
- initialState: false
- },
- {
- id: 'volumes',
- label: m.containers_remove_volumes_label(),
- initialState: false
- }
- ],
- confirm: {
- label: m.common_remove(),
- destructive: true,
- action: async (checkboxStates) => {
- const force = !!checkboxStates.force;
- const volumes = !!checkboxStates.volumes;
- actionStatus[id] = 'removing';
- handleApiResultWithCallbacks({
- result: await tryCatch(containerService.deleteContainer(id, { force, volumes })),
- message: m.containers_remove_failed(),
- setLoadingState: (value) => {
- actionStatus[id] = value ? 'removing' : '';
- },
- async onSuccess() {
- toast.success(m.containers_remove_success());
- containers = await containerService.getContainers(requestOptions);
- }
- });
- }
- }
- });
- }
-
- async function handleUpdateContainer(container: ContainerSummaryDto) {
- const containerName = getContainerDisplayName(container);
-
- openConfirmDialog({
- title: m.containers_update_confirm_title(),
- message: m.containers_update_confirm_message({ name: containerName }),
- confirm: {
- label: m.containers_update_container(),
- destructive: false,
- action: async () => {
- actionStatus[container.id] = 'updating';
- try {
- toast.info(m.containers_update_pulling_image());
-
- // Use the new single container update endpoint
- const result = await containerService.updateContainer(container.id);
-
- if (result.failed > 0) {
- const failedItem = result.items?.find((item: any) => item.status === 'failed');
- toast.error(
- m.containers_update_failed({ name: containerName }) + (failedItem?.error ? `: ${failedItem.error}` : '')
- );
- } else if (result.updated > 0) {
- toast.success(m.containers_update_success({ name: containerName }));
- } else {
- toast.info(m.image_update_up_to_date_title());
- }
-
- // Refresh containers
- containers = await containerService.getContainers(requestOptions);
- } catch (error) {
- console.error('Container update failed:', error);
- toast.error(m.containers_update_failed({ name: containerName }));
- } finally {
- actionStatus[container.id] = '';
- }
- }
- }
- });
- }
-
- async function handleBulkStart(ids: string[]) {
- if (!ids || ids.length === 0) return;
-
- openConfirmDialog({
- title: m.containers_bulk_start_confirm_title({ count: ids.length }),
- message: m.containers_bulk_start_confirm_message({ count: ids.length }),
- confirm: {
- label: m.common_start(),
- destructive: false,
- action: async () => {
- isBulkLoading.start = true;
-
- const results = await Promise.allSettled(ids.map((id) => containerService.startContainer(id)));
-
- const successCount = results.filter((r) => r.status === 'fulfilled').length;
- const failureCount = results.length - successCount;
-
- isBulkLoading.start = false;
-
- if (successCount === ids.length) {
- toast.success(m.containers_bulk_start_success({ count: successCount }));
- } else if (successCount > 0) {
- toast.warning(m.containers_bulk_start_partial({ success: successCount, total: ids.length, failed: failureCount }));
- } else {
- toast.error(m.containers_start_failed());
- }
-
- containers = await containerService.getContainers(requestOptions);
- selectedIds = [];
- }
- }
- });
- }
-
- async function handleBulkStop(ids: string[]) {
- if (!ids || ids.length === 0) return;
-
- openConfirmDialog({
- title: m.containers_bulk_stop_confirm_title({ count: ids.length }),
- message: m.containers_bulk_stop_confirm_message({ count: ids.length }),
- confirm: {
- label: m.common_stop(),
- destructive: false,
- action: async () => {
- isBulkLoading.stop = true;
-
- const results = await Promise.allSettled(ids.map((id) => containerService.stopContainer(id)));
-
- const successCount = results.filter((r) => r.status === 'fulfilled').length;
- const failureCount = results.length - successCount;
-
- isBulkLoading.stop = false;
-
- if (successCount === ids.length) {
- toast.success(m.containers_bulk_stop_success({ count: successCount }));
- } else if (successCount > 0) {
- toast.warning(m.containers_bulk_stop_partial({ success: successCount, total: ids.length, failed: failureCount }));
- } else {
- toast.error(m.containers_stop_failed());
- }
-
- containers = await containerService.getContainers(requestOptions);
- selectedIds = [];
- }
- }
- });
- }
-
- async function handleBulkRestart(ids: string[]) {
- if (!ids || ids.length === 0) return;
-
- openConfirmDialog({
- title: m.containers_bulk_restart_confirm_title({ count: ids.length }),
- message: m.containers_bulk_restart_confirm_message({ count: ids.length }),
- confirm: {
- label: m.common_restart(),
- destructive: false,
- action: async () => {
- isBulkLoading.restart = true;
-
- const results = await Promise.allSettled(ids.map((id) => containerService.restartContainer(id)));
-
- const successCount = results.filter((r) => r.status === 'fulfilled').length;
- const failureCount = results.length - successCount;
-
- isBulkLoading.restart = false;
-
- if (successCount === ids.length) {
- toast.success(m.containers_bulk_restart_success({ count: successCount }));
- } else if (successCount > 0) {
- toast.warning(m.containers_bulk_restart_partial({ success: successCount, total: ids.length, failed: failureCount }));
- } else {
- toast.error(m.containers_restart_failed());
- }
-
- containers = await containerService.getContainers(requestOptions);
- selectedIds = [];
- }
- }
- });
- }
-
- async function handleBulkRemove(ids: string[]) {
- if (!ids || ids.length === 0) return;
-
- openConfirmDialog({
- title: m.containers_bulk_remove_confirm_title({ count: ids.length }),
- message: m.containers_bulk_remove_confirm_message({ count: ids.length }),
- checkboxes: [
- {
- id: 'force',
- label: m.containers_remove_force_label(),
- initialState: false
- },
- {
- id: 'volumes',
- label: m.containers_remove_volumes_label(),
- initialState: false
- }
- ],
- confirm: {
- label: m.common_remove(),
- destructive: true,
- action: async (checkboxStates) => {
- const force = !!checkboxStates.force;
- const volumes = !!checkboxStates.volumes;
- isBulkLoading.remove = true;
-
- const results = await Promise.allSettled(ids.map((id) => containerService.deleteContainer(id, { force, volumes })));
-
- const successCount = results.filter((r) => r.status === 'fulfilled').length;
- const failureCount = results.length - successCount;
-
- isBulkLoading.remove = false;
-
- if (successCount === ids.length) {
- toast.success(m.containers_bulk_remove_success({ count: successCount }));
- } else if (successCount > 0) {
- toast.warning(m.containers_bulk_remove_partial({ success: successCount, total: ids.length, failed: failureCount }));
- } else {
- toast.error(m.containers_remove_failed());
- }
-
- containers = await containerService.getContainers(requestOptions);
- selectedIds = [];
- }
- }
- });
- }
+ const {
+ performContainerAction,
+ handleRemoveContainer,
+ handleUpdateContainer,
+ handleBulkStart,
+ handleBulkStop,
+ handleBulkRestart,
+ handleBulkRemove
+ } = createContainerActions({
+ getRequestOptions: () => requestOptions,
+ setContainers: (next) => {
+ containers = next;
+ },
+ setSelectedIds: (next) => {
+ selectedIds = next;
+ },
+ actionStatus,
+ isBulkLoading
+ });
const isAnyLoading = $derived(
Object.values(actionStatus).some((status) => status !== '') || Object.values(isBulkLoading).some((loading) => loading)
@@ -434,56 +130,37 @@
let collapsedGroups = $derived(collapsedGroupsState?.current ?? {});
let columnVisibility = $state<Record<string, boolean>>({});
- onMount(() => {
- collapsedGroupsState = new PersistedState<Record<string, boolean>>('container-groups-collapsed', {});
-
- statsManager = new ContainerStatsManager();
-
- // Derive which containers should be connected based on current state
- const shouldConnect = $derived.by(() => {
- const cpuVisible = columnVisibility.cpuUsage !== false;
- const memoryVisible = columnVisibility.memoryUsage !== false;
- const statsVisible = cpuVisible || memoryVisible;
-
- if (!statsVisible) {
- return new Set<string>();
- }
-
- const runningContainers = containers.data?.filter((c) => c.state === 'running') ?? [];
- return new Set(runningContainers.map((c) => c.id));
- });
+ const shouldConnect = $derived.by(() => {
+ const cpuVisible = columnVisibility.cpuUsage !== false;
+ const memoryVisible = columnVisibility.memoryUsage !== false;
+ const statsVisible = cpuVisible || memoryVisible;
- const currentEnvId = $derived(environmentStore.selected?.id || '0');
+ if (!statsVisible) {
+ return new Set<string>();
+ }
- // Effect ONLY for side effects - connecting/disconnecting websockets
- const unsubscribe = $effect.root(() => {
- $effect(() => {
- if (!statsManager) return;
+ const runningContainers = containers.data?.filter((c) => c.state === 'running') ?? [];
+ return new Set(runningContainers.map((c) => c.id));
+ });
- const targetIds = shouldConnect;
- const connectedIds = new Set(statsManager.getConnectedIds());
+ const currentEnvId = $derived(environmentStore.selected?.id || '0');
- // Connect new containers
- for (const id of targetIds) {
- if (!connectedIds.has(id)) {
- statsManager.connect(id, currentEnvId);
- }
- }
+ $effect(() => {
+ statsManager.envId = currentEnvId;
+ statsManager.targetIds = shouldConnect;
+ });
- // Disconnect removed containers
- for (const id of connectedIds) {
- if (!targetIds.has(id)) {
- statsManager.disconnect(id);
- }
- }
- });
+ onMount(() => {
+ collapsedGroupsState = new PersistedState<Record<string, boolean>>('container-groups-collapsed', {});
- return () => {};
- });
+ const persistedInternal = (customSettings.showInternalContainers as boolean) ?? false;
+ const currentInternal = requestOptions?.includeInternal ?? false;
+ if (persistedInternal !== currentInternal) {
+ setShowInternal(persistedInternal);
+ }
return () => {
- unsubscribe();
- statsManager?.destroy();
+ statsManager.destroy();
};
});
@@ -495,15 +172,6 @@
customSettings = { ...customSettings, groupByProject: value };
}
- $effect(() => {
- const current = requestOptions?.includeInternal;
- if (showInternal && current !== true) {
- setShowInternal(true);
- } else if (!showInternal && current === true) {
- setShowInternal(false);
- }
- });
-
function toggleGroup(groupName: string) {
if (!collapsedGroupsState) return;
collapsedGroupsState.current = {
@@ -512,37 +180,38 @@
};
}
- function getContainerIpAddress(container: ContainerSummaryDto): string | null {
- const networks = container.networkSettings?.networks;
- if (!networks) return null;
- for (const networkName in networks) {
- const network = networks[networkName];
- if (network?.ipAddress) return network.ipAddress;
- }
- return null;
- }
-
const columns = $derived([
{ accessorKey: 'id', title: m.common_id(), cell: IdCell, hidden: true },
{ accessorKey: 'names', id: 'name', title: m.common_name(), sortable: !groupByProject, cell: NameCell },
- { accessorKey: 'state', title: m.common_state(), sortable: !groupByProject, cell: StateCell },
{ accessorKey: 'image', title: m.common_image(), sortable: !groupByProject, cell: ImageCell },
+ { accessorKey: 'state', title: m.common_state(), sortable: !groupByProject, cell: StateCell },
{
- accessorFn: (row) => statsManager?.getCPUPercent(row.id) ?? -1,
+ id: 'updates',
+ accessorFn: (row) => {
+ if (row.updateInfo?.hasUpdate) return 'has_update';
+ if (row.updateInfo?.error) return 'error';
+ if (row.updateInfo) return 'up_to_date';
+ return 'unknown';
+ },
+ title: m.containers_update_column(),
+ sortable: false,
+ cell: UpdatesCell
+ },
+ {
+ accessorFn: (row) => statsManager.getCPUPercent(row.id) ?? -1,
id: 'cpuUsage',
title: m.containers_cpu_usage(),
sortable: false,
cell: CPUCell
},
{
- accessorFn: (row) => statsManager?.getMemoryPercent(row.id) ?? -1,
+ accessorFn: (row) => statsManager.getMemoryPercent(row.id) ?? -1,
id: 'memoryUsage',
title: m.containers_memory_usage(),
sortable: false,
cell: MemoryCell
},
{ accessorKey: 'status', title: m.common_status() },
- { accessorKey: 'imageId', id: 'update', title: m.containers_update_column(), cell: UpdateCell },
{ accessorKey: 'networkSettings', id: 'ipAddress', title: m.containers_ip_address(), sortable: false, cell: IPAddressCell },
{ accessorKey: 'ports', title: m.common_ports(), cell: PortsCell },
{ accessorKey: 'created', title: m.common_created(), sortable: !groupByProject, cell: CreatedCell }
@@ -551,6 +220,7 @@
const mobileFields = [
{ id: 'id', label: m.common_id(), defaultVisible: false },
{ id: 'state', label: m.common_state(), defaultVisible: true },
+ { id: 'updates', label: m.containers_update_column(), defaultVisible: true },
{ id: 'cpuUsage', label: m.containers_cpu_usage(), defaultVisible: false },
{ id: 'memoryUsage', label: m.containers_memory_usage(), defaultVisible: false },
{ id: 'status', label: m.common_status(), defaultVisible: true },
@@ -599,32 +269,10 @@
}
]);
- function getProjectName(container: ContainerSummaryDto): string {
- const projectLabel = container.labels?.['com.docker.compose.project'];
- return projectLabel || 'No Project';
+ // Icon for each group
+ function getGroupIcon(_groupName: string) {
+ return ProjectsIcon;
}
-
- const groupedContainers = $derived(() => {
- if (!groupByProject) return null;
-
- const groups = new Map<string, ContainerSummaryDto[]>();
-
- for (const container of containers.data ?? []) {
- const projectName = getProjectName(container);
- if (!groups.has(projectName)) {
- groups.set(projectName, []);
- }
- groups.get(projectName)!.push(container);
- }
-
- const sortedGroups = Array.from(groups.entries()).sort(([a], [b]) => {
- if (a === 'No Project') return 1;
- if (b === 'No Project') return -1;
- return a.localeCompare(b);
- });
-
- return sortedGroups.length > 0 ? sortedGroups : null;
- });
</script>
{#snippet IPAddressCell({ item }: { item: ContainerSummaryDto })}
@@ -634,15 +282,15 @@
{#snippet CPUCell({ item }: { item: ContainerSummaryDto })}
<ContainerStatsCell
- value={statsManager?.getCPUPercent(item.id)}
- loading={statsManager?.isLoading(item.id) ?? false}
+ value={statsManager.getCPUPercent(item.id)}
+ loading={statsManager.isLoading(item.id) ?? false}
stopped={item.state !== 'running'}
type="cpu"
/>
{/snippet}
{#snippet MemoryCell({ item }: { item: ContainerSummaryDto })}
- {@const memoryData = statsManager?.getMemoryUsage(item.id)}
+ {@const memoryData = statsManager.getMemoryUsage(item.id)}
<ContainerStatsCell value={memoryData?.usage} limit={memoryData?.limit} stopped={item.state !== 'running'} type="memory" />
{/snippet}
@@ -716,6 +364,18 @@
</div>
{/snippet}
+{#snippet UpdatesCell({ item }: { item: ContainerSummaryDto })}
+ {@const imageRef = parseImageRef(item.image)}
+ <ImageUpdateItem
+ updateInfo={item.updateInfo}
+ imageId={item.imageId}
+ repo={imageRef.repo}
+ tag={imageRef.tag}
+ onUpdateContainer={() => handleUpdateContainer(item)}
+ debugHasUpdate={false}
+ />
+{/snippet}
+
{#snippet ImageCell({ item }: { item: ContainerSummaryDto })}
<ArcaneTooltip.Root>
<ArcaneTooltip.Trigger>
@@ -735,18 +395,6 @@
</span>
{/snippet}
-{#snippet UpdateCell({ item }: { item: ContainerSummaryDto })}
- {@const imageRef = parseImageRef(item.image)}
- <ImageUpdateItem
- updateInfo={item.updateInfo}
- imageId={item.imageId}
- repo={imageRef.repo}
- tag={imageRef.tag}
- onUpdateContainer={() => handleUpdateContainer(item)}
- debugHasUpdate={false}
- />
-{/snippet}
-
{#snippet ContainerMobileCardSnippet({
item,
mobileFieldVisibility
@@ -766,18 +414,13 @@
alt: getContainerDisplayName(item)
};
}}
- title={(item) => {
- if (item.names && item.names.length > 0) {
- return item.names[0].startsWith('/') ? item.names[0].substring(1) : item.names[0];
- }
- return item.id.substring(0, 12);
- }}
+ title={(item) => getContainerDisplayName(item)}
subtitle={(item) => ((mobileFieldVisibility.id ?? true) ? (item.id.length > 12 ? item.id : null) : null)}
badges={[
(item) =>
(mobileFieldVisibility.state ?? true)
? {
- variant: item.state === 'running' ? 'green' : item.state === 'exited' ? 'red' : 'amber',
+ variant: getStateBadgeVariant(item.state),
text: capitalizeFirstLetter(item.state)
}
: null
@@ -804,6 +447,30 @@
iconVariant: 'sky' as const,
type: 'mono' as const,
show: mobileFieldVisibility.ipAddress ?? false
+ },
+ {
+ label: m.containers_cpu_usage(),
+ getValue: (item: ContainerSummaryDto) => {
+ const cpu = statsManager.getCPUPercent(item.id);
+ if (item.state !== 'running') return m.common_na();
+ if (cpu === undefined) return '...';
+ return `${cpu.toFixed(1)}%`;
+ },
+ icon: ClockIcon,
+ iconVariant: 'orange' as const,
+ show: mobileFieldVisibility.cpuUsage ?? false
+ },
+ {
+ label: m.containers_memory_usage(),
+ getValue: (item: ContainerSummaryDto) => {
+ const memData = statsManager.getMemoryUsage(item.id);
+ if (item.state !== 'running') return m.common_na();
+ if (!memData?.usage) return '...';
+ return `${(memData.usage / 1024 / 1024).toFixed(0)} MB`;
+ },
+ icon: ClockIcon,
+ iconVariant: 'purple' as const,
+ show: mobileFieldVisibility.memoryUsage ?? false
}
]}
footer={(mobileFieldVisibility.created ?? true)
@@ -816,9 +483,10 @@
rowActions={RowActions}
onclick={(item: ContainerSummaryDto) => goto(`/containers/${item.id}`)}
>
- {#snippet children()}
+ {#if ((mobileFieldVisibility.ports ?? true) && item.ports && item.ports.length > 0) || (mobileFieldVisibility.updates ?? true)}
+ <div class="flex flex-row gap-4 border-t pt-3">
{#if (mobileFieldVisibility.ports ?? true) && item.ports && item.ports.length > 0}
- <div class="flex items-start gap-2.5 border-t pt-3">
+ <div class="flex min-w-0 flex-1 items-start gap-2.5">
<div class="flex size-7 shrink-0 items-center justify-center rounded-lg bg-sky-500/10">
<NetworksIcon class="size-3.5 text-sky-500" />
</div>
@@ -832,8 +500,29 @@
</div>
</div>
{/if}
- {/snippet}
- </UniversalMobileCard>
+ {#if mobileFieldVisibility.updates ?? true}
+ {@const imageRef = parseImageRef(item.image)}
+ <div class="flex min-w-0 flex-1 items-start gap-2.5">
+ <div class="flex min-w-0 flex-col">
+ <div class="text-muted-foreground text-[10px] font-medium tracking-wide uppercase">
+ {m.images_updates()}
+ </div>
+ <div class="mt-1">
+ <ImageUpdateItem
+ updateInfo={item.updateInfo}
+ imageId={item.id}
+ repo={imageRef.repo}
+ tag={imageRef.tag}
+ onUpdateContainer={() => handleUpdateContainer(item)}
+ debugHasUpdate={false}
+ />
+ </div>
+ </div>
+ </div>
+ {/if}
+ </div>
+ {/if}
+</UniversalMobileCard>
{/snippet}
{#snippet RowActions({ item }: { item: ContainerSummaryDto })}
@@ -841,9 +530,9 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
+ <EllipsisIcon class="size-4" />
</ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
@@ -854,17 +543,18 @@
{m.common_inspect()}
</DropdownMenu.Item>
+ <DropdownMenu.Separator />
+
{#if item.updateInfo?.hasUpdate}
<DropdownMenu.Item onclick={() => handleUpdateContainer(item)} disabled={status === 'updating' || isAnyLoading}>
{#if status === 'updating'}
<Spinner class="size-4" />
{:else}
<UpdateIcon class="size-4" />
+ {m.common_update()}
{/if}
- {m.containers_update_container()}
</DropdownMenu.Item>
{/if}
-
{#if item.state !== 'running'}
<DropdownMenu.Item
onclick={() => performContainerAction('start', item.id)}
@@ -879,27 +569,27 @@
</DropdownMenu.Item>
{:else}
<DropdownMenu.Item
- onclick={() => performContainerAction('restart', item.id)}
- disabled={status === 'restarting' || isAnyLoading}
+ onclick={() => performContainerAction('stop', item.id)}
+ disabled={status === 'stopping' || isAnyLoading}
>
- {#if status === 'restarting'}
+ {#if status === 'stopping'}
<Spinner class="size-4" />
{:else}
- <RefreshIcon class="size-4" />
+ <StopIcon class="size-4" />
{/if}
- {m.common_restart()}
+ {m.common_stop()}
</DropdownMenu.Item>
<DropdownMenu.Item
- onclick={() => performContainerAction('stop', item.id)}
- disabled={status === 'stopping' || isAnyLoading}
+ onclick={() => performContainerAction('restart', item.id)}
+ disabled={status === 'restarting' || isAnyLoading}
>
- {#if status === 'stopping'}
+ {#if status === 'restarting'}
<Spinner class="size-4" />
{:else}
- <StopIcon class="size-4" />
+ <RefreshIcon class="size-4" />
{/if}
- {m.common_stop()}
+ {m.common_restart()}
</DropdownMenu.Item>
{/if}
@@ -937,7 +627,10 @@
rowActions={RowActions}
mobileCard={ContainerMobileCardSnippet}
customViewOptions={CustomViewOptions}
- customTableView={groupByProject && groupedContainers() ? GroupedTableView : undefined}
+ groupBy={groupByProject ? groupContainerByProject : undefined}
+ groupIcon={groupByProject ? getGroupIcon : undefined}
+ groupCollapsedState={collapsedGroups}
+ onGroupToggle={toggleGroup}
/>
{#snippet CustomViewOptions()}
@@ -948,117 +641,3 @@
{`${m.common_show()} ${m.internal()} ${m.containers_title()}`}
</DropdownMenu.CheckboxItem>
{/snippet}
-
-{#snippet GroupedTableView({
- table,
- renderPagination,
- mobileFieldsForOptions,
- onToggleMobileField
-}: {
- table: TableType<ContainerSummaryDto>;
- renderPagination: import('svelte').Snippet;
- mobileFieldsForOptions: { id: string; label: string; visible: boolean }[];
- onToggleMobileField: (fieldId: string) => void;
-})}
- <div class="flex h-full flex-col">
- <div class="shrink-0 border-b">
- <DataTableToolbar
- {table}
- {selectedIds}
- {bulkActions}
- mobileFields={mobileFieldsForOptions}
- {onToggleMobileField}
- customViewOptions={CustomViewOptions}
- />
- </div>
-
- <div class="hidden flex-1 overflow-auto px-6 py-8 md:block">
- <div class="overflow-x-auto rounded-md border">
- <Table.Root>
- <Table.Header>
- {#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
- <Table.Row>
- {#each headerGroup.headers as header (header.id)}
- <Table.Head colspan={header.colSpan}>
- {#if !header.isPlaceholder}
- <FlexRender content={header.column.columnDef.header} context={header.getContext()} />
- {/if}
- </Table.Head>
- {/each}
- </Table.Row>
- {/each}
- </Table.Header>
- <Table.Body>
- {#each groupedContainers() ?? [] as [projectName, projectContainers] (projectName)}
- <Table.Row
- class="bg-muted/50 hover:bg-muted/60 cursor-pointer transition-colors"
- onclick={() => toggleGroup(projectName)}
- >
- <Table.Cell colspan={table.getAllColumns().length} class="py-3 font-medium">
- <div class="flex items-center gap-2">
- {#if collapsedGroups[projectName]}
- <ArrowRightIcon class="text-muted-foreground size-4" />
- {:else}
- <ArrowDownIcon class="text-muted-foreground size-4" />
- {/if}
- <ProjectsIcon class="text-muted-foreground size-4" />
- <span>{projectName}</span>
- <span class="text-muted-foreground text-xs font-normal">({projectContainers.length})</span>
- </div>
- </Table.Cell>
- </Table.Row>
-
- {#if !collapsedGroups[projectName]}
- {@const projectContainerIds = new Set(projectContainers.map((c) => c.id))}
- {@const projectRows = table
- .getRowModel()
- .rows.filter((row) => projectContainerIds.has((row.original as ContainerSummaryDto).id))}
-
- {#each projectRows as row (row.id)}
- <Table.Row
- data-state={(selectedIds ?? []).includes((row.original as ContainerSummaryDto).id) && 'selected'}
- class="hover:bg-primary/5 transition-colors"
- >
- {#each row.getVisibleCells() as cell, i (cell.id)}
- <Table.Cell class={i === 0 ? 'pl-12' : ''}>
- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
- </Table.Cell>
- {/each}
- </Table.Row>
- {/each}
- {/if}
- {/each}
- </Table.Body>
- </Table.Root>
- </div>
- </div>
-
- <div class="space-y-4 py-2 md:hidden">
- {#each groupedContainers() ?? [] as [projectName, projectContainers] (projectName)}
- {@const projectContainerIds = new Set(projectContainers.map((c) => c.id))}
- {@const projectRows = table
- .getRowModel()
- .rows.filter((row) => projectContainerIds.has((row.original as ContainerSummaryDto).id))}
-
- <DropdownCard
- id={`container-project-${projectName}`}
- title={projectName}
- description={`${projectContainers.length} ${projectContainers.length === 1 ? 'container' : 'containers'}`}
- icon={ProjectsIcon}
- >
- {#each projectRows as row (row.id)}
- {@render ContainerMobileCardSnippet({ item: row.original as ContainerSummaryDto, mobileFieldVisibility })}
- {:else}
- <div class="flex h-24 items-center justify-center text-center text-muted-foreground">
- {m.common_no_results_found()}
- </div>
- {/each}
- </DropdownCard>
- {/each}
- </div>
-
- <div class="shrink-0 border-t px-2 py-4">
- {@render renderPagination()}
- </div>
- </div>
-{/snippet}
diff --git a/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte b/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
index 6d043eaf6..2b309c7e5 100644
--- a/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
+++ b/frontend/src/routes/(app)/customize/git-repositories/repository-table.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
- import { Button } from '$lib/components/ui/button/index.js';
+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import { toast } from 'svelte-sonner';
@@ -15,13 +15,13 @@
import { m } from '$lib/paraglide/messages';
import { gitRepositoryService } from '$lib/services/git-repository-service';
import {
- EllipsisIcon,
EditIcon as PencilIcon,
TestIcon as TestTubeIcon,
TrashIcon as Trash2Icon,
GitBranchIcon,
ApiKeyIcon as KeyIcon,
- ExternalLinkIcon as LinkIcon
+ ExternalLinkIcon as LinkIcon,
+ EllipsisIcon
} from '$lib/icons';
type FieldVisibility = Record<string, boolean>;
@@ -251,10 +251,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <Button {...props} variant="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
- </Button>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -263,10 +263,14 @@
<TestTubeIcon class="size-4" />
{m.git_repository_test_connection()}
</DropdownMenu.Item>
+
<DropdownMenu.Item onclick={() => onEditRepository(item)}>
<PencilIcon class="size-4" />
{m.common_edit()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteOne(item.id, item.name)}
diff --git a/frontend/src/routes/(app)/customize/registries/registry-table.svelte b/frontend/src/routes/(app)/customize/registries/registry-table.svelte
index fa87026ef..d86219c97 100644
--- a/frontend/src/routes/(app)/customize/registries/registry-table.svelte
+++ b/frontend/src/routes/(app)/customize/registries/registry-table.svelte
@@ -2,8 +2,8 @@
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
- import { Spinner } from '$lib/components/ui/spinner/index.js';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import { Spinner } from '$lib/components/ui/spinner/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import { toast } from 'svelte-sonner';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -15,7 +15,7 @@
import { format } from 'date-fns';
import { m } from '$lib/paraglide/messages';
import { containerRegistryService } from '$lib/services/container-registry-service';
- import { RegistryIcon, UserIcon, ExternalLinkIcon, EllipsisIcon, EditIcon, TrashIcon, TestIcon } from '$lib/icons';
+ import { RegistryIcon, UserIcon, ExternalLinkIcon, EditIcon, TrashIcon, TestIcon, EllipsisIcon } from '$lib/icons';
let {
registries = $bindable(),
@@ -242,9 +242,9 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
+ <EllipsisIcon class="size-4" />
</ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
@@ -258,11 +258,14 @@
{/if}
{m.registries_test_connection()}
</DropdownMenu.Item>
+
<DropdownMenu.Item onclick={() => onEditRegistry(item)}>
<EditIcon class="size-4" />
{m.common_edit()}
</DropdownMenu.Item>
+
<DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteOne(item.id, item.url)}
diff --git a/frontend/src/routes/(app)/customize/templates/template-table.svelte b/frontend/src/routes/(app)/customize/templates/template-table.svelte
index 54d8052bc..df5fcd667 100644
--- a/frontend/src/routes/(app)/customize/templates/template-table.svelte
+++ b/frontend/src/routes/(app)/customize/templates/template-table.svelte
@@ -4,9 +4,6 @@
import { Badge } from '$lib/components/ui/badge';
import { Spinner } from '$lib/components/ui/spinner/index.js';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
- import type { Table as TableType } from '@tanstack/table-core';
- import * as Table from '$lib/components/ui/table/index.js';
- import FlexRender from '$lib/components/ui/data-table/flex-render.svelte';
import { goto } from '$app/navigation';
import { toast } from 'svelte-sonner';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
@@ -19,12 +16,9 @@
import { m } from '$lib/paraglide/messages';
import { templateService } from '$lib/services/template-service';
import { truncateString } from '$lib/utils/string.utils';
- import DropdownCard from '$lib/components/dropdown-card.svelte';
- import DataTableToolbar from '$lib/components/arcane-table/arcane-table-toolbar.svelte';
import { PersistedState } from 'runed';
import { onMount } from 'svelte';
import {
- EllipsisIcon,
InspectIcon,
FolderOpenIcon,
GlobeIcon,
@@ -32,13 +26,10 @@
DownloadIcon,
TagIcon,
MoveToFolderIcon,
- ArrowDownIcon,
- ArrowRightIcon,
- RegistryIcon
+ RegistryIcon,
+ EllipsisIcon
} from '$lib/icons';
- type TemplateTable = TableType<Template>;
-
let {
templates = $bindable(),
selectedIds = $bindable(),
@@ -155,30 +146,18 @@
return m.templates_local_templates();
}
- const groupedTemplates = $derived.by(() => {
- if (!groupByRegistry) return null;
-
- const groups = new Map<string, Template[]>();
- const localName = m.templates_local_templates();
- const unknownName = m.templates_unknown_registry();
+ // Group by function for templates
+ function groupTemplateByRegistry(template: Template): string {
+ return getRegistryName(template);
+ }
- for (const template of templates.data ?? []) {
- const registryName = getRegistryName(template);
- const group = groups.get(registryName) ?? [];
- group.push(template);
- if (!groups.has(registryName)) {
- groups.set(registryName, group);
- }
+ // Icon for each group
+ function getGroupIcon(groupName: string) {
+ if (groupName === m.templates_local_templates()) {
+ return FolderOpenIcon;
}
-
- return Array.from(groups.entries()).sort(([a], [b]) => {
- if (a === localName) return -1;
- if (b === localName) return 1;
- if (a === unknownName) return 1;
- if (b === unknownName) return -1;
- return a.localeCompare(b);
- });
- });
+ return RegistryIcon;
+ }
</script>
{#snippet NameCell({ item }: { item: Template })}
@@ -277,9 +256,9 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
+ <EllipsisIcon class="size-4" />
</ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
@@ -295,6 +274,8 @@
{m.compose_create_project()}
</DropdownMenu.Item>
+ <DropdownMenu.Separator />
+
{#if item.isRemote}
<DropdownMenu.Item onclick={() => handleDownloadTemplate(item.id, item.name)} disabled={downloadingId === item.id}>
{#if downloadingId === item.id}
@@ -305,7 +286,6 @@
{m.templates_download()}
</DropdownMenu.Item>
{:else}
- <DropdownMenu.Separator />
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteTemplate(item.id, item.name)}
@@ -338,7 +318,10 @@
mobileCard={TemplateMobileCardSnippet}
selectionDisabled
customViewOptions={CustomViewOptions}
- customTableView={groupByRegistry && groupedTemplates ? GroupedTableView : undefined}
+ groupBy={groupByRegistry ? groupTemplateByRegistry : undefined}
+ groupIcon={groupByRegistry ? getGroupIcon : undefined}
+ groupCollapsedState={collapsedGroups}
+ onGroupToggle={toggleGroup}
/>
{#snippet CustomViewOptions()}
@@ -348,119 +331,3 @@
{m.templates_group_by_registry()}
</DropdownMenu.CheckboxItem>
{/snippet}
-
-{#snippet GroupedTableView({
- table,
- renderPagination,
- mobileFieldsForOptions,
- onToggleMobileField
-}: {
- table: TemplateTable;
- renderPagination: import('svelte').Snippet;
- mobileFieldsForOptions: { id: string; label: string; visible: boolean }[];
- onToggleMobileField: (fieldId: string) => void;
-})}
- <div class="flex h-full flex-col">
- <div class="shrink-0 border-b">
- <DataTableToolbar
- {table}
- {selectedIds}
- selectionDisabled={true}
- mobileFields={mobileFieldsForOptions}
- {onToggleMobileField}
- customViewOptions={CustomViewOptions}
- />
- </div>
-
- <div class="hidden flex-1 overflow-auto px-6 py-8 md:block">
- <div class="overflow-x-auto rounded-md border">
- <Table.Root>
- <Table.Header>
- {#each table.getHeaderGroups() as headerGroup (headerGroup.id)}
- <Table.Row>
- {#each headerGroup.headers as header (header.id)}
- <Table.Head colspan={header.colSpan}>
- {#if !header.isPlaceholder}
- <FlexRender content={header.column.columnDef.header} context={header.getContext()} />
- {/if}
- </Table.Head>
- {/each}
- </Table.Row>
- {/each}
- </Table.Header>
- <Table.Body>
- {#each groupedTemplates ?? [] as [registryName, registryTemplates] (registryName)}
- <Table.Row
- class="bg-muted/50 hover:bg-muted/60 cursor-pointer transition-colors"
- onclick={() => toggleGroup(registryName)}
- >
- <Table.Cell colspan={table.getAllColumns().length} class="py-3 font-medium">
- <div class="flex items-center gap-2">
- {#if collapsedGroups[registryName]}
- <ArrowRightIcon class="text-muted-foreground size-4" />
- {:else}
- <ArrowDownIcon class="text-muted-foreground size-4" />
- {/if}
- {#if registryName === m.templates_local_templates()}
- <FolderOpenIcon class="text-muted-foreground size-4" />
- {:else}
- <RegistryIcon class="text-muted-foreground size-4" />
- {/if}
- <span>{registryName}</span>
- <span class="text-muted-foreground text-xs font-normal">({registryTemplates.length})</span>
- </div>
- </Table.Cell>
- </Table.Row>
-
- {#if !collapsedGroups[registryName]}
- {@const registryTemplateIds = new Set(registryTemplates.map((t) => t.id))}
- {@const registryRows = table
- .getRowModel()
- .rows.filter((row) => registryTemplateIds.has((row.original as Template).id))}
-
- {#each registryRows as row (row.id)}
- <Table.Row
- data-state={(selectedIds ?? []).includes((row.original as Template).id) && 'selected'}
- class="hover:bg-primary/5 transition-colors"
- >
- {#each row.getVisibleCells() as cell, i (cell.id)}
- <Table.Cell class={i === 0 ? 'pl-12' : ''}>
- <FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />
- </Table.Cell>
- {/each}
- </Table.Row>
- {/each}
- {/if}
- {/each}
- </Table.Body>
- </Table.Root>
- </div>
- </div>
-
- <div class="space-y-4 py-2 md:hidden">
- {#each groupedTemplates ?? [] as [registryName, registryTemplates] (registryName)}
- {@const registryTemplateIds = new Set(registryTemplates.map((t) => t.id))}
- {@const registryRows = table.getRowModel().rows.filter((row) => registryTemplateIds.has((row.original as Template).id))}
-
- <DropdownCard
- id={`template-registry-${registryName}`}
- title={registryName}
- description={`${registryTemplates.length} ${registryTemplates.length === 1 ? m.resource_template() : m.resource_templates()}`}
- icon={registryName === m.templates_local_templates() ? FolderOpenIcon : RegistryIcon}
- >
- {#each registryRows as row (row.id)}
- {@render TemplateMobileCardSnippet({ item: row.original as Template, mobileFieldVisibility })}
- {:else}
- <div class="flex h-24 items-center justify-center text-center text-muted-foreground">
- {m.common_no_results_found()}
- </div>
- {/each}
- </DropdownCard>
- {/each}
- </div>
-
- <div class="shrink-0 border-t px-2 py-4">
- {@render renderPagination()}
- </div>
- </div>
-{/snippet}
diff --git a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
index 43be660e2..4ecd143fe 100644
--- a/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-container-table.svelte
@@ -155,7 +155,7 @@
<div class="flex flex-1 items-center justify-between">
<div class="flex flex-col space-y-1.5">
<Card.Title>
- <h2>{m.containers_title()}</h2>
+ <h2><a class="hover:underline" href="/containers">{m.containers_title()}</a></h2>
</Card.Title>
<Card.Description>{m.containers_recent()}</Card.Description>
</div>
@@ -171,12 +171,12 @@
bind:requestOptions
bind:selectedIds
onRefresh={async (options) => (containers = await containerService.getContainers(options))}
- withoutSearch={true}
- withoutPagination={true}
- selectionDisabled={true}
- unstyled={true}
{columns}
mobileCard={DashContainerMobileCard}
+ withoutSearch
+ withoutPagination
+ selectionDisabled
+ unstyled
/>
</Card.Content>
{#if containers.data.length >= calculatedLimit && containers.pagination.totalItems > calculatedLimit}
diff --git a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
index e919c6264..a3cb7af06 100644
--- a/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
+++ b/frontend/src/routes/(app)/dashboard/dash-image-table.svelte
@@ -176,12 +176,12 @@
bind:requestOptions
bind:selectedIds
onRefresh={async (options) => (images = await imageService.getImages(options))}
- withoutSearch={true}
- selectionDisabled={true}
- withoutPagination={true}
- unstyled={true}
{columns}
mobileCard={DashImageMobileCard}
+ withoutSearch
+ selectionDisabled
+ withoutPagination
+ unstyled
/>
</Card.Content>
{#if images.data.length >= calculatedLimit && images.pagination.totalItems > calculatedLimit}
diff --git a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
index 560ed3cfd..3a3d906e2 100644
--- a/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
+++ b/frontend/src/routes/(app)/environments/[id]/gitops/sync-table.svelte
@@ -1,7 +1,7 @@
<script lang="ts">
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
- import { Button } from '$lib/components/ui/button/index.js';
+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';
import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import { toast } from 'svelte-sonner';
@@ -17,17 +17,15 @@
import { gitOpsSyncService } from '$lib/services/gitops-sync-service';
import { toGitCommitUrl } from '$lib/utils/git';
import {
- EllipsisIcon,
EditIcon as PencilIcon,
StartIcon as PlayIcon,
TrashIcon as Trash2Icon,
RefreshIcon as RefreshCwIcon,
GitBranchIcon,
ProjectsIcon as FolderIcon,
- HashIcon
+ HashIcon,
+ EllipsisIcon
} from '$lib/icons';
- import { goto } from '$app/navigation';
- import * as Tooltip from '$lib/components/ui/tooltip/index.js';
type FieldVisibility = Record<string, boolean>;
@@ -307,10 +305,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <Button {...props} variant="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
- </Button>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -319,10 +317,14 @@
<PlayIcon class="size-4" />
{m.git_sync_perform()}
</DropdownMenu.Item>
+
<DropdownMenu.Item onclick={() => onEditSync(item)}>
<PencilIcon class="size-4" />
{m.common_edit()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteOne(item.id, item.name)}
diff --git a/frontend/src/routes/(app)/environments/environment-table.svelte b/frontend/src/routes/(app)/environments/environment-table.svelte
index 91bf2c1fe..980936c48 100644
--- a/frontend/src/routes/(app)/environments/environment-table.svelte
+++ b/frontend/src/routes/(app)/environments/environment-table.svelte
@@ -21,7 +21,6 @@
import { environmentStore } from '$lib/stores/environment.store.svelte';
import { capitalizeFirstLetter } from '$lib/utils/string.utils';
import {
- EllipsisIcon,
EyeOnIcon,
TrashIcon,
EnvironmentsIcon,
@@ -29,7 +28,8 @@
UpdateIcon,
StatsIcon,
EyeOffIcon,
- TestIcon
+ TestIcon,
+ EllipsisIcon
} from '$lib/icons';
let {
@@ -323,16 +323,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -355,18 +349,21 @@
<EnvironmentsIcon class="size-4" />
{environmentStore.selected?.id === item.id ? m.environments_current_environment() : m.environments_use_environment()}
</DropdownMenu.Item>
- <DropdownMenu.Separator />
+
<DropdownMenu.Item onclick={() => goto(`/environments/${item.id}`)}>
<InspectIcon class="size-4" />
{m.common_view_details()}
</DropdownMenu.Item>
+
<DropdownMenu.Item onclick={() => handleTest(item.id)} disabled={isLoading.testing}>
<TestIcon class="size-4" />
{m.environments_test_connection()}
</DropdownMenu.Item>
+
{#if item.id !== '0'}
+ <DropdownMenu.Separator />
+
{#if item.status === 'online'}
- <DropdownMenu.Separator />
<DropdownMenu.Item
onclick={() => handleUpgradeClick(item)}
disabled={isLoading.upgrading || upgradingEnvironmentId === item.id}
@@ -375,16 +372,19 @@
{upgradingEnvironmentId === item.id ? m.upgrade_in_progress() : m.upgrade_to_version({ version: 'Latest' })}
</DropdownMenu.Item>
{/if}
+
<DropdownMenu.Item onclick={() => handleToggleEnabled(item)} disabled={isLoading.toggling}>
{#if item.enabled}
<EyeOffIcon class="size-4" />
{m.common_disable()}
{:else}
<EyeOnIcon class="size-4" />
- {m.common_disable()}
+ {m.common_enable()}
{/if}
</DropdownMenu.Item>
+
<DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteOne(item.id, item.name)}
diff --git a/frontend/src/routes/(app)/events/event-table.svelte b/frontend/src/routes/(app)/events/event-table.svelte
index f72284fae..cbe1a62c0 100644
--- a/frontend/src/routes/(app)/events/event-table.svelte
+++ b/frontend/src/routes/(app)/events/event-table.svelte
@@ -16,7 +16,7 @@
import EventDetailsDialog from '$lib/components/dialogs/event-details-dialog.svelte';
import { m } from '$lib/paraglide/messages';
import { eventService } from '$lib/services/event-service';
- import { EllipsisIcon, TrashIcon, InfoIcon, NotificationsIcon, TagIcon, EnvironmentsIcon, UserIcon } from '$lib/icons';
+ import { TrashIcon, InfoIcon, NotificationsIcon, TagIcon, EnvironmentsIcon, UserIcon, EllipsisIcon } from '$lib/icons';
let {
events = $bindable(),
@@ -218,9 +218,9 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
+ <EllipsisIcon class="size-4" />
</ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
@@ -230,6 +230,9 @@
<InfoIcon class="size-4" />
{m.common_view_details()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteEvent(item.id, item.title)}
diff --git a/frontend/src/routes/(app)/images/image-table.svelte b/frontend/src/routes/(app)/images/image-table.svelte
index 657e3ff23..776f62a1c 100644
--- a/frontend/src/routes/(app)/images/image-table.svelte
+++ b/frontend/src/routes/(app)/images/image-table.svelte
@@ -1,11 +1,11 @@
<script lang="ts">
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { Spinner } from '$lib/components/ui/spinner/index.js';
import { goto } from '$app/navigation';
import { toast } from 'svelte-sonner';
import bytes from 'bytes';
- import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { Badge } from '$lib/components/ui/badge/index.js';
@@ -19,7 +19,7 @@
import type { ColumnSpec, MobileFieldVisibility, BulkAction } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { imageService } from '$lib/services/image-service';
- import { DownloadIcon, TrashIcon, EllipsisIcon, InspectIcon, ImagesIcon, VolumesIcon, ClockIcon } from '$lib/icons';
+ import { DownloadIcon, TrashIcon, InspectIcon, ImagesIcon, VolumesIcon, ClockIcon, EllipsisIcon } from '$lib/icons';
let {
images = $bindable(),
@@ -155,7 +155,12 @@
},
{
id: 'updates',
- accessorFn: (row) => row.updateInfo?.hasUpdate ?? false,
+ accessorFn: (row) => {
+ if (row.updateInfo?.hasUpdate) return 'has_update';
+ if (row.updateInfo?.error) return 'error';
+ if (row.updateInfo) return 'up_to_date';
+ return 'unknown';
+ },
title: m.images_updates(),
cell: UpdatesCell
},
@@ -167,7 +172,7 @@
{ id: 'id', label: m.common_id(), defaultVisible: false },
{ id: 'repoTags', label: m.common_tags(), defaultVisible: true },
{ id: 'inUse', label: m.common_status(), defaultVisible: true },
- { id: 'updates', label: m.images_updates(), defaultVisible: true },
+ { id: 'updates', label: m.images_updates(), defaultVisible: false },
{ id: 'size', label: m.common_size(), defaultVisible: true },
{ id: 'created', label: m.common_created(), defaultVisible: true }
];
@@ -265,7 +270,14 @@
? item.inUse
? { variant: 'green' as const, text: m.common_in_use() }
: { variant: 'amber' as const, text: m.common_unused() }
- : null
+ : null,
+ (item: ImageSummaryDto) => {
+ if (!(mobileFieldVisibility.updates ?? false)) return null;
+ if (item.updateInfo?.hasUpdate) return { variant: 'blue' as const, text: m.images_has_updates() };
+ if (item.updateInfo?.error) return { variant: 'red' as const, text: m.common_error() };
+ if (item.updateInfo) return { variant: 'green' as const, text: m.images_no_updates() };
+ return { variant: 'gray' as const, text: m.common_unknown() };
+ }
]}
fields={[
{
@@ -297,42 +309,17 @@
: undefined}
rowActions={RowActions}
onclick={(item: ImageSummaryDto) => goto(`/images/${item.id}`)}
- >
- {#if mobileFieldVisibility.updates ?? true}
- <div class="flex items-center gap-x-2 gap-y-2 border-t pt-2">
- <div class="flex min-w-0 shrink flex-col">
- <div class="text-muted-foreground text-[10px] font-medium tracking-wide uppercase">
- {m.images_updates()}
- </div>
- <div class="mt-0.5">
- <ImageUpdateItem
- updateInfo={item.updateInfo}
- imageId={item.id}
- repo={item.repo}
- tag={item.tag}
- onUpdated={(newInfo) => handleUpdateInfoChanged(item.id, newInfo)}
- />
- </div>
- </div>
- </div>
- {/if}
- </UniversalMobileCard>
+ />
{/snippet}
{#snippet RowActions({ item }: { item: ImageSummaryDto })}
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -340,20 +327,24 @@
<DropdownMenu.Item onclick={() => goto(`/images/${item.id}`)}>
<InspectIcon class="size-4" />
{m.common_inspect()}
- </DropdownMenu.Item>
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item
onclick={() => handleInlineImagePull(item.id, item.repoTags?.[0] || '')}
disabled={isPullingInline[item.id] || !item.repoTags?.[0]}
>
{#if isPullingInline[item.id]}
<Spinner class="size-4" />
- {m.common_action_pulling()}
{:else}
<DownloadIcon class="size-4" />
- {m.images_pull()}
{/if}
+ {m.images_pull()}
</DropdownMenu.Item>
+
<DropdownMenu.Separator />
+
<DropdownMenu.Item variant="destructive" onclick={() => deleteImage(item.id)} disabled={isLoading.removing}>
{#if isLoading.removing}
<Spinner class="size-4" />
diff --git a/frontend/src/routes/(app)/networks/network-table.svelte b/frontend/src/routes/(app)/networks/network-table.svelte
index f1f17daa2..126ef72da 100644
--- a/frontend/src/routes/(app)/networks/network-table.svelte
+++ b/frontend/src/routes/(app)/networks/network-table.svelte
@@ -2,9 +2,9 @@
import type { NetworkSummaryDto, NetworkUsageCounts } from '$lib/types/network.type';
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { goto } from '$app/navigation';
import { toast } from 'svelte-sonner';
- import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -16,7 +16,7 @@
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { m } from '$lib/paraglide/messages';
import { networkService } from '$lib/services/network-service';
- import { NetworksIcon, GlobeIcon, EllipsisIcon, InspectIcon, TrashIcon } from '$lib/icons';
+ import { NetworksIcon, GlobeIcon, InspectIcon, TrashIcon, EllipsisIcon } from '$lib/icons';
type FieldVisibility = Record<string, boolean>;
@@ -253,9 +253,9 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
<span class="sr-only">{m.common_open_menu()}</span>
- <EllipsisIcon />
+ <EllipsisIcon class="size-4" />
</ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
@@ -265,7 +265,9 @@
<InspectIcon class="size-4" />
{m.common_inspect()}
</DropdownMenu.Item>
+
<DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleDeleteNetwork(item.id, item.name)}
diff --git a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
index b3ed7d7fb..5ce4c6199 100644
--- a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
+++ b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte
@@ -23,7 +23,7 @@
import { toSafeHref } from '$lib/utils/url';
import { PersistedState } from 'runed';
import EditableName from '../components/EditableName.svelte';
- import ServicesGrid from '../components/ServicesGrid.svelte';
+ import ProjectContainersTable from '../components/ProjectContainersTable.svelte';
import CodePanel from '../components/CodePanel.svelte';
import ProjectsLogsPanel from '../components/ProjectLogsPanel.svelte';
import ResizableSplit from '$lib/components/resizable-split.svelte';
@@ -414,7 +414,7 @@
{#snippet tabContent()}
<Tabs.Content value="services" class="h-full">
- <ServicesGrid services={project.runtimeServices} {projectId} />
+ <ProjectContainersTable services={project.runtimeServices} {projectId} onRefresh={refreshProjectDetails} />
</Tabs.Content>
<Tabs.Content value="compose" class="h-full min-h-0">
@@ -467,7 +467,7 @@
</div>
</Alert.Root>
{/if}
- <div class="mb-4 flex-shrink-0">
+ <div class="mb-4 shrink-0">
<SwitchWithLabel
id="layout-mode-toggle"
checked={layoutMode === 'tree'}
@@ -488,7 +488,7 @@
{#if layoutMode === 'tree'}
<div class="flex h-full min-h-0 flex-col gap-4 lg:hidden">
<Card.Root class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
- <Card.Header icon={FileTextIcon} class="flex-shrink-0 items-center">
+ <Card.Header icon={FileTextIcon} class="shrink-0 items-center">
<Card.Title>
<h2>{m.project_files()}</h2>
</Card.Title>
@@ -581,7 +581,7 @@
>
{#snippet first()}
<Card.Root class="flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden">
- <Card.Header icon={FileTextIcon} class="flex-shrink-0 items-center">
+ <Card.Header icon={FileTextIcon} class="shrink-0 items-center">
<Card.Title>
<h2>{m.project_files()}</h2>
</Card.Title>
@@ -672,7 +672,7 @@
action="base"
tone={selectedIncludeTab === includeFile.relativePath ? 'outline-primary' : 'ghost'}
size="sm"
- class="flex-shrink-0"
+ class="shrink-0"
onclick={() => {
selectedIncludeTab =
selectedIncludeTab === includeFile.relativePath ? null : includeFile.relativePath;
diff --git a/frontend/src/routes/(app)/projects/components/ProjectContainersTable.svelte b/frontend/src/routes/(app)/projects/components/ProjectContainersTable.svelte
new file mode 100644
index 000000000..1a2723d06
--- /dev/null
+++ b/frontend/src/routes/(app)/projects/components/ProjectContainersTable.svelte
@@ -0,0 +1,578 @@
+<script lang="ts">
+ import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
+ import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import { Spinner } from '$lib/components/ui/spinner/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import * as Empty from '$lib/components/ui/empty/index.js';
+ import StatusBadge from '$lib/components/badges/status-badge.svelte';
+ import { PortBadge } from '$lib/components/badges/index.js';
+ import { UniversalMobileCard } from '$lib/components/arcane-table/index.js';
+ import { getStatusVariant } from '$lib/utils/status.utils';
+ import { capitalizeFirstLetter } from '$lib/utils/string.utils';
+ import type { RuntimeService } from '$lib/types/project.type';
+ import type { ColumnSpec, BulkAction } from '$lib/components/arcane-table';
+ import { m } from '$lib/paraglide/messages';
+ import { goto } from '$app/navigation';
+ import { toast } from 'svelte-sonner';
+ import { openConfirmDialog } from '$lib/components/confirm-dialog';
+ import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
+ import { tryCatch } from '$lib/utils/try-catch';
+ import { containerService } from '$lib/services/container-service';
+ import * as ArcaneTooltip from '$lib/components/arcane-tooltip';
+ import IconImage from '$lib/components/icon-image.svelte';
+ import { getArcaneIconUrlFromLabels } from '$lib/utils/arcane-labels';
+ import {
+ StartIcon,
+ StopIcon,
+ RefreshIcon,
+ TrashIcon,
+ EllipsisIcon,
+ ContainersIcon,
+ HealthIcon,
+ InspectIcon,
+ FolderXIcon,
+ BoxIcon
+ } from '$lib/icons';
+
+ interface Props {
+ services?: RuntimeService[];
+ projectId?: string;
+ onRefresh?: () => Promise<void>;
+ }
+
+ let { services = [], projectId, onRefresh }: Props = $props();
+
+ // Convert RuntimeService to a format compatible with ArcaneTable
+ type ServiceWithId = RuntimeService & { id: string };
+
+ const servicesWithIds = $derived<ServiceWithId[]>(
+ (services ?? []).map((service) => ({
+ ...service,
+ id: service.containerId || service.name
+ }))
+ );
+
+ // Track action status per container ID
+ type ActionStatus = 'starting' | 'stopping' | 'restarting' | 'removing' | '';
+ let actionStatus = $state<Record<string, ActionStatus>>({});
+
+ let isBulkLoading = $state({
+ start: false,
+ stop: false,
+ restart: false,
+ remove: false
+ });
+
+ let selectedIds = $state<string[]>([]);
+ let mobileFieldVisibility = $state<Record<string, boolean>>({});
+
+ // Fake request options and pagination for the table (we're using local data)
+ let requestOptions = $state({
+ pagination: { page: 1, limit: 100 },
+ sort: { column: 'name', direction: 'asc' as const }
+ });
+
+ const paginatedServices = $derived({
+ data: servicesWithIds,
+ pagination: {
+ currentPage: 1,
+ totalPages: 1,
+ totalItems: servicesWithIds.length,
+ itemsPerPage: 100
+ }
+ });
+
+ function getHealthColor(health: string | undefined): 'green' | 'red' | 'amber' {
+ if (!health) return 'amber';
+ const normalized = health.toLowerCase();
+ if (normalized === 'healthy') return 'green';
+ if (normalized === 'unhealthy') return 'red';
+ return 'amber';
+ }
+
+ function getContainerUrl(service: RuntimeService): string {
+ if (!service.containerId) return '#';
+ return projectId
+ ? `/containers/${service.containerId}?from=project&projectId=${projectId}`
+ : `/containers/${service.containerId}`;
+ }
+
+ async function performContainerAction(action: 'start' | 'stop' | 'restart', id: string) {
+ if (!id) return;
+
+ const statusMap = { start: 'starting', stop: 'stopping', restart: 'restarting' } as const;
+ actionStatus[id] = statusMap[action];
+
+ try {
+ const serviceCall =
+ action === 'start'
+ ? containerService.startContainer(id)
+ : action === 'stop'
+ ? containerService.stopContainer(id)
+ : containerService.restartContainer(id);
+
+ const messageMap = {
+ start: { failed: m.containers_start_failed(), success: m.containers_start_success() },
+ stop: { failed: m.containers_stop_failed(), success: m.containers_stop_success() },
+ restart: { failed: m.containers_restart_failed(), success: m.containers_restart_success() }
+ };
+
+ handleApiResultWithCallbacks({
+ result: await tryCatch(serviceCall),
+ message: messageMap[action].failed,
+ setLoadingState: (value) => {
+ actionStatus[id] = value ? statusMap[action] : '';
+ },
+ async onSuccess() {
+ toast.success(messageMap[action].success);
+ await onRefresh?.();
+ }
+ });
+ } catch (error) {
+ console.error('Container action failed:', error);
+ toast.error(m.containers_action_error());
+ actionStatus[id] = '';
+ }
+ }
+
+ async function handleRemoveContainer(id: string, name: string) {
+ openConfirmDialog({
+ title: m.containers_remove_confirm_title(),
+ message: m.containers_remove_confirm_message({ resource: name }),
+ checkboxes: [
+ { id: 'force', label: m.containers_remove_force_label(), initialState: false },
+ { id: 'volumes', label: m.containers_remove_volumes_label(), initialState: false }
+ ],
+ confirm: {
+ label: m.common_remove(),
+ destructive: true,
+ action: async (checkboxStates) => {
+ const force = !!checkboxStates.force;
+ const volumes = !!checkboxStates.volumes;
+ actionStatus[id] = 'removing';
+
+ handleApiResultWithCallbacks({
+ result: await tryCatch(containerService.deleteContainer(id, { force, volumes })),
+ message: m.containers_remove_failed(),
+ setLoadingState: (value) => {
+ actionStatus[id] = value ? 'removing' : '';
+ },
+ async onSuccess() {
+ toast.success(m.containers_remove_success());
+ await onRefresh?.();
+ }
+ });
+ }
+ }
+ });
+ }
+
+ async function handleBulkAction(action: 'start' | 'stop' | 'restart' | 'remove', ids: string[]) {
+ if (!ids || ids.length === 0) return;
+
+ const validIds = ids.filter((id) => servicesWithIds.find((s) => s.id === id)?.containerId);
+ if (validIds.length === 0) return;
+
+ const actionConfig = {
+ start: {
+ title: m.containers_bulk_start_confirm_title({ count: validIds.length }),
+ message: m.containers_bulk_start_confirm_message({ count: validIds.length }),
+ label: m.common_start(),
+ destructive: false,
+ fn: (id: string) => containerService.startContainer(id),
+ success: m.containers_bulk_start_success({ count: validIds.length }),
+ loadingKey: 'start' as const
+ },
+ stop: {
+ title: m.containers_bulk_stop_confirm_title({ count: validIds.length }),
+ message: m.containers_bulk_stop_confirm_message({ count: validIds.length }),
+ label: m.common_stop(),
+ destructive: false,
+ fn: (id: string) => containerService.stopContainer(id),
+ success: m.containers_bulk_stop_success({ count: validIds.length }),
+ loadingKey: 'stop' as const
+ },
+ restart: {
+ title: m.containers_bulk_restart_confirm_title({ count: validIds.length }),
+ message: m.containers_bulk_restart_confirm_message({ count: validIds.length }),
+ label: m.common_restart(),
+ destructive: false,
+ fn: (id: string) => containerService.restartContainer(id),
+ success: m.containers_bulk_restart_success({ count: validIds.length }),
+ loadingKey: 'restart' as const
+ },
+ remove: {
+ title: m.containers_bulk_remove_confirm_title({ count: validIds.length }),
+ message: m.containers_bulk_remove_confirm_message({ count: validIds.length }),
+ label: m.common_remove(),
+ destructive: true,
+ fn: (id: string) => containerService.deleteContainer(id, { force: false, volumes: false }),
+ success: m.containers_bulk_remove_success({ count: validIds.length }),
+ loadingKey: 'remove' as const
+ }
+ };
+
+ const config = actionConfig[action];
+
+ openConfirmDialog({
+ title: config.title,
+ message: config.message,
+ confirm: {
+ label: config.label,
+ destructive: config.destructive,
+ action: async () => {
+ isBulkLoading[config.loadingKey] = true;
+
+ const results = await Promise.allSettled(validIds.map((id) => config.fn(id)));
+ const successCount = results.filter((r) => r.status === 'fulfilled').length;
+
+ isBulkLoading[config.loadingKey] = false;
+
+ if (successCount === validIds.length) {
+ toast.success(config.success);
+ } else if (successCount > 0) {
+ toast.warning(`${successCount} of ${validIds.length} succeeded`);
+ } else {
+ toast.error(m.containers_action_error());
+ }
+
+ selectedIds = [];
+ await onRefresh?.();
+ }
+ }
+ });
+ }
+
+ const isAnyLoading = $derived(
+ Object.values(actionStatus).some((status) => status !== '') || Object.values(isBulkLoading).some((loading) => loading)
+ );
+
+ const showActionsColumn = $derived(servicesWithIds.some((service) => service.status === 'running'));
+
+ const columns = [
+ { accessorKey: 'containerName', id: 'name', title: m.common_name(), sortable: true, cell: NameCell },
+ { accessorKey: 'status', title: m.common_state(), cell: StateCell },
+ { accessorKey: 'image', title: m.common_image() },
+ { accessorKey: 'health', title: m.common_health_status(), cell: HealthCell },
+ { accessorKey: 'ports', title: m.common_ports(), cell: PortsCell }
+ ] satisfies ColumnSpec<ServiceWithId>[];
+
+ const mobileFields = [
+ { id: 'status', label: m.common_state(), defaultVisible: true },
+ { id: 'image', label: m.common_image(), defaultVisible: true },
+ { id: 'health', label: m.common_health_status(), defaultVisible: true },
+ { id: 'ports', label: m.common_ports(), defaultVisible: true }
+ ];
+
+ const bulkActions = $derived.by<BulkAction[]>(() => [
+ {
+ id: 'start',
+ label: m.containers_bulk_start({ count: selectedIds?.length ?? 0 }),
+ action: 'start',
+ onClick: (ids) => handleBulkAction('start', ids),
+ loading: isBulkLoading.start,
+ disabled: isAnyLoading,
+ icon: StartIcon
+ },
+ {
+ id: 'stop',
+ label: m.containers_bulk_stop({ count: selectedIds?.length ?? 0 }),
+ action: 'stop',
+ onClick: (ids) => handleBulkAction('stop', ids),
+ loading: isBulkLoading.stop,
+ disabled: isAnyLoading,
+ icon: StopIcon
+ },
+ {
+ id: 'restart',
+ label: m.containers_bulk_restart({ count: selectedIds?.length ?? 0 }),
+ action: 'restart',
+ onClick: (ids) => handleBulkAction('restart', ids),
+ loading: isBulkLoading.restart,
+ disabled: isAnyLoading,
+ icon: RefreshIcon
+ },
+ {
+ id: 'remove',
+ label: m.containers_bulk_remove({ count: selectedIds?.length ?? 0 }),
+ action: 'remove',
+ onClick: (ids) => handleBulkAction('remove', ids),
+ loading: isBulkLoading.remove,
+ disabled: isAnyLoading,
+ icon: TrashIcon
+ }
+ ]);
+</script>
+
+{#snippet NameCell({ item }: { item: ServiceWithId })}
+ {@const displayName = item.containerName || item.name}
+ {@const iconUrl = item.iconUrl ?? getArcaneIconUrlFromLabels(item.serviceConfig?.labels)}
+ <div class="flex items-center gap-2">
+ <IconImage src={iconUrl} alt={displayName} fallback={BoxIcon} class="size-4" containerClass="size-7" />
+ {#if item.containerId}
+ <a class="font-medium hover:underline" href={getContainerUrl(item)}>
+ {displayName}
+ </a>
+ {:else}
+ <span class="text-muted-foreground">{displayName}</span>
+ {/if}
+ </div>
+{/snippet}
+
+{#snippet StateCell({ item }: { item: ServiceWithId })}
+ {@const status = actionStatus[item.id]}
+ {#if status}
+ <div class="flex items-center gap-1.5">
+ <Spinner class="size-3.5" />
+ <span class="text-muted-foreground text-xs font-medium">
+ {status === 'starting'
+ ? m.common_action_starting()
+ : status === 'stopping'
+ ? m.common_action_stopping()
+ : status === 'restarting'
+ ? m.common_action_restarting()
+ : m.common_action_removing()}
+ </span>
+ </div>
+ {:else}
+ <StatusBadge variant={getStatusVariant(item.status)} text={capitalizeFirstLetter(item.status)} />
+ {/if}
+{/snippet}
+
+{#snippet HealthCell({ item }: { item: ServiceWithId })}
+ {#if item.health}
+ <div class="flex items-center gap-1.5">
+ <HealthIcon class="size-4 text-{getHealthColor(item.health)}-500" />
+ <span class="text-muted-foreground text-sm">{capitalizeFirstLetter(item.health)}</span>
+ </div>
+ {:else}
+ <span class="text-muted-foreground text-sm">—</span>
+ {/if}
+{/snippet}
+
+{#snippet PortsCell({ item }: { item: ServiceWithId })}
+ {#if item.serviceConfig?.ports && item.serviceConfig.ports.length > 0}
+ <PortBadge ports={item.serviceConfig.ports as any} />
+ {:else if item.ports && item.ports.length > 0}
+ {@const parsedPorts = item.ports.map((p) => {
+ const [numsPart, proto] = p.split('/');
+ const nums = numsPart.split(':');
+ if (nums.length === 2) {
+ return { publicPort: parseInt(nums[0]), privatePort: parseInt(nums[1]), type: proto || 'tcp' };
+ }
+ return { privatePort: parseInt(nums[0]), type: proto || 'tcp' };
+ })}
+ <PortBadge ports={parsedPorts} />
+ {:else}
+ <span class="text-muted-foreground text-sm">—</span>
+ {/if}
+{/snippet}
+
+{#snippet ContainerMobileCard({
+ item,
+ mobileFieldVisibility
+}: {
+ row: any;
+ item: ServiceWithId;
+ mobileFieldVisibility: Record<string, boolean>;
+})}
+ <UniversalMobileCard
+ {item}
+ icon={(item) => {
+ const iconUrl = item.iconUrl ?? getArcaneIconUrlFromLabels(item.serviceConfig?.labels);
+ return {
+ component: BoxIcon,
+ variant: item.status === 'running' ? 'emerald' : item.status === 'exited' ? 'red' : 'amber',
+ imageUrl: iconUrl ?? undefined,
+ alt: item.containerName || item.name
+ };
+ }}
+ title={(item) => item.containerName || item.name}
+ badges={[
+ (item) =>
+ (mobileFieldVisibility.status ?? true)
+ ? {
+ variant: item.status === 'running' ? 'green' : item.status === 'exited' ? 'red' : 'amber',
+ text: capitalizeFirstLetter(item.status)
+ }
+ : null,
+ (item) =>
+ (mobileFieldVisibility.health ?? true) && item.health
+ ? { variant: getHealthColor(item.health), text: capitalizeFirstLetter(item.health) }
+ : null
+ ]}
+ fields={[
+ {
+ label: m.common_image(),
+ getValue: (item: ServiceWithId) => item.image,
+ show: mobileFieldVisibility.image ?? true
+ }
+ ]}
+ rowActions={showActionsColumn ? MobileRowActions : undefined}
+ onclick={(item: ServiceWithId) => item.containerId && goto(getContainerUrl(item))}
+ />
+{/snippet}
+
+{#snippet MobileRowActions({ item }: { item: ServiceWithId })}
+ {#if item.status === 'running'}
+ {#if !item.containerId}
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger>
+ <ArcaneButton action="base" tone="ghost" size="icon" class="size-8" disabled>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content>
+ <p>{m.compose_service_not_created()}</p>
+ </ArcaneTooltip.Content>
+ </ArcaneTooltip.Root>
+ {:else}
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger>
+ {#snippet child({ props })}
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="relative size-8 p-0">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon />
+ </ArcaneButton>
+ {/snippet}
+ </DropdownMenu.Trigger>
+ <DropdownMenu.Content align="end">
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => goto(getContainerUrl(item))} disabled={isAnyLoading}>
+ <InspectIcon class="size-4" />
+ {m.common_inspect()}
+ </DropdownMenu.Item>
+ <DropdownMenu.Separator />
+ <DropdownMenu.Item
+ variant="destructive"
+ onclick={() => handleRemoveContainer(item.containerId!, item.containerName || item.name)}
+ disabled={actionStatus[item.id] === 'removing' || isAnyLoading}
+ >
+ {#if actionStatus[item.id] === 'removing'}
+ <Spinner class="size-4" />
+ {:else}
+ <TrashIcon class="size-4" />
+ {/if}
+ {m.common_remove()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ {/if}
+ {/if}
+{/snippet}
+
+{#snippet RowActions({ item }: { item: ServiceWithId })}
+ {@const status = actionStatus[item.id]}
+
+ {#if item.status === 'running'}
+ {#if !item.containerId}
+ <ArcaneTooltip.Root>
+ <ArcaneTooltip.Trigger>
+ <ArcaneButton action="base" tone="ghost" size="icon" class="size-8" disabled>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
+ </ArcaneTooltip.Trigger>
+ <ArcaneTooltip.Content>
+ <p>{m.compose_service_not_created()}</p>
+ </ArcaneTooltip.Content>
+ </ArcaneTooltip.Root>
+ {:else}
+ <DropdownMenu.Root>
+ <DropdownMenu.Trigger>
+ {#snippet child({ props })}
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ {#if status}
+ <Spinner class="size-4" />
+ {:else}
+ <EllipsisIcon class="size-4" />
+ {/if}
+ </ArcaneButton>
+ {/snippet}
+ </DropdownMenu.Trigger>
+ <DropdownMenu.Content align="end">
+ <DropdownMenu.Group>
+ <DropdownMenu.Item onclick={() => goto(getContainerUrl(item))} disabled={isAnyLoading}>
+ <InspectIcon class="size-4" />
+ {m.common_inspect()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
+ <DropdownMenu.Item
+ onclick={() => performContainerAction('stop', item.containerId!)}
+ disabled={status === 'stopping' || isAnyLoading}
+ >
+ {#if status === 'stopping'}
+ <Spinner class="size-4" />
+ {:else}
+ <StopIcon class="size-4" />
+ {/if}
+ {m.common_stop()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Item
+ onclick={() => performContainerAction('restart', item.containerId!)}
+ disabled={status === 'restarting' || isAnyLoading}
+ >
+ {#if status === 'restarting'}
+ <Spinner class="size-4" />
+ {:else}
+ <RefreshIcon class="size-4" />
+ {/if}
+ {m.common_restart()}
+ </DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
+ <DropdownMenu.Item
+ variant="destructive"
+ onclick={() => handleRemoveContainer(item.containerId!, item.containerName || item.name)}
+ disabled={status === 'removing' || isAnyLoading}
+ >
+ {#if status === 'removing'}
+ <Spinner class="size-4" />
+ {:else}
+ <TrashIcon class="size-4" />
+ {/if}
+ {m.common_remove()}
+ </DropdownMenu.Item>
+ </DropdownMenu.Group>
+ </DropdownMenu.Content>
+ </DropdownMenu.Root>
+ {/if}
+ {/if}
+{/snippet}
+
+{#if servicesWithIds.length > 0}
+ <ArcaneTable
+ items={paginatedServices}
+ bind:requestOptions
+ bind:selectedIds
+ bind:mobileFieldVisibility
+ selectionDisabled
+ onRefresh={async () => {
+ await onRefresh?.();
+ return paginatedServices;
+ }}
+ {columns}
+ {mobileFields}
+ {bulkActions}
+ rowActions={showActionsColumn ? RowActions : undefined}
+ mobileCard={ContainerMobileCard}
+ withoutSearch
+ withoutPagination
+ />
+{:else}
+ <div class="flex h-full items-center justify-center py-12">
+ <Empty.Root class="bg-card/30 rounded-lg py-12 backdrop-blur-sm" role="status" aria-live="polite">
+ <Empty.Header>
+ <Empty.Media variant="icon">
+ <FolderXIcon class="text-muted-foreground/40 size-10" />
+ </Empty.Media>
+ <Empty.Title class="text-base font-medium">{m.compose_no_services_found()}</Empty.Title>
+ </Empty.Header>
+ </Empty.Root>
+ </div>
+{/if}
diff --git a/frontend/src/routes/(app)/projects/components/ServicesGrid.svelte b/frontend/src/routes/(app)/projects/components/ServicesGrid.svelte
deleted file mode 100644
index 94c21934a..000000000
--- a/frontend/src/routes/(app)/projects/components/ServicesGrid.svelte
+++ /dev/null
@@ -1,161 +0,0 @@
-<script lang="ts">
- import * as Card from '$lib/components/ui/card';
- import StatusBadge from '$lib/components/badges/status-badge.svelte';
- import { PortBadge } from '$lib/components/badges';
- import { getStatusVariant } from '$lib/utils/status.utils';
- import { capitalizeFirstLetter } from '$lib/utils/string.utils';
- import { m } from '$lib/paraglide/messages';
- import { Badge } from '$lib/components/ui/badge';
- import type { RuntimeService } from '$lib/types/project.type';
- import { HealthIcon, ContainersIcon } from '$lib/icons';
- import IconImage from '$lib/components/icon-image.svelte';
- import { getArcaneIconUrlFromLabels } from '$lib/utils/arcane-labels';
-
- interface Props {
- services?: RuntimeService[];
- projectId?: string;
- }
-
- let { services, projectId }: Props = $props();
-
- function getHealthColor(health: string | undefined): string {
- if (!health) return 'text-amber-500';
- const normalized = health.toLowerCase();
- if (normalized === 'healthy') return 'text-green-500';
- if (normalized === 'unhealthy') return 'text-red-500';
- return 'text-amber-500';
- }
-
- function parseStringPorts(ports: string[]): any[] {
- return ports.map((p) => {
- const [numsPart, proto] = p.split('/');
- const nums = numsPart.split(':');
- if (nums.length === 2) {
- return {
- publicPort: parseInt(nums[0]),
- privatePort: parseInt(nums[1]),
- type: proto || 'tcp'
- };
- }
- return {
- privatePort: parseInt(nums[0]),
- type: proto || 'tcp'
- };
- });
- }
-</script>
-
-{#snippet portsDisplay(service: RuntimeService)}
- {#if service.serviceConfig?.ports && service.serviceConfig.ports.length > 0}
- <div class="mt-3">
- <PortBadge ports={service.serviceConfig.ports as any} />
- </div>
- {:else if service.ports && service.ports.length > 0}
- <div class="mt-3">
- <PortBadge ports={parseStringPorts(service.ports)} />
- </div>
- {/if}
-{/snippet}
-
-{#snippet serviceCard(service: RuntimeService)}
- {@const status = service.status || 'unknown'}
- {@const containerUrl = projectId
- ? `/containers/${service.containerId}?from=project&projectId=${projectId}`
- : `/containers/${service.containerId}`}
- {@const iconUrl = service.iconUrl || getArcaneIconUrlFromLabels(service.serviceConfig?.labels)}
-
- {#if service.containerId}
- <a href={containerUrl} class="group">
- <Card.Root
- variant="subtle"
- class="group-hover:border-border/60 group-hover:bg-muted/50 flex h-full cursor-pointer transition-all duration-200"
- >
- <Card.Content class="flex flex-col p-4">
- <div class="flex items-start gap-3">
- <IconImage
- src={iconUrl}
- alt={service.containerName || service.name}
- fallback={ContainersIcon}
- class="size-6 text-blue-500"
- containerClass="size-10 bg-blue-500/10 p-2 group-hover:bg-blue-500/15"
- />
- <div class="min-w-0 flex-1">
- <div class="mb-2 flex items-center gap-2">
- <h3 class="text-foreground text-base font-semibold transition-colors">
- {service.containerName || service.name}
- </h3>
- <Badge variant="outline" class="text-xs">
- {service.name}
- </Badge>
- </div>
- <div class="flex flex-wrap items-center gap-3">
- <StatusBadge variant={getStatusVariant(status)} text={capitalizeFirstLetter(status)} />
- {#if service.health}
- {@const healthColor = getHealthColor(service.health)}
- <div class="flex items-center gap-1.5">
- <HealthIcon class="{healthColor} size-4" />
- <span class="text-muted-foreground text-xs">{capitalizeFirstLetter(service.health)}</span>
- </div>
- {/if}
- </div>
- {@render portsDisplay(service)}
- </div>
- </div>
- </Card.Content>
- </Card.Root>
- </a>
- {:else}
- <Card.Root variant="subtle" class="flex h-full opacity-60">
- <Card.Content class="flex flex-col p-4">
- <div class="flex items-start gap-3">
- <IconImage
- src={iconUrl}
- alt={service.name}
- fallback={ContainersIcon}
- class="size-6 text-amber-500"
- containerClass="size-10 bg-amber-500/10 p-2"
- />
- <div class="min-w-0 flex-1">
- <h3 class="text-foreground mb-2 text-base font-semibold">
- {service.name}
- </h3>
- <StatusBadge variant={getStatusVariant(status)} text={capitalizeFirstLetter(status)} />
- <p class="text-muted-foreground mt-2 text-xs">
- {m.compose_service_not_created()}
- </p>
- {@render portsDisplay(service)}
- </div>
- </div>
- </Card.Content>
- </Card.Root>
- {/if}
-{/snippet}
-
-<Card.Root>
- <Card.Header icon={ContainersIcon}>
- <div class="flex flex-col space-y-1.5">
- <Card.Title>
- <h2>
- {m.compose_services()}
- </h2>
- </Card.Title>
- <Card.Description>{m.compose_services_description()}</Card.Description>
- </div>
- </Card.Header>
- <Card.Content class="p-4">
- {#if services && services.length > 0}
- <div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
- {#each services as service, i (service.containerId || service.name || i)}
- {@render serviceCard(service)}
- {/each}
- </div>
- {:else}
- <div class="rounded-lg border border-dashed py-12 text-center">
- <div class="bg-muted/50 mx-auto mb-4 flex size-16 items-center justify-center rounded-full">
- <ContainersIcon class="text-muted-foreground size-6" />
- </div>
- <div class="text-muted-foreground text-sm">{m.compose_no_services_found()}</div>
- </div>
- {/if}
- </Card.Content>
-</Card.Root>
diff --git a/frontend/src/routes/(app)/projects/projects-table.svelte b/frontend/src/routes/(app)/projects/projects-table.svelte
index 1ed38e8aa..91e364b81 100644
--- a/frontend/src/routes/(app)/projects/projects-table.svelte
+++ b/frontend/src/routes/(app)/projects/projects-table.svelte
@@ -2,11 +2,11 @@
import type { Project } from '$lib/types/project.type';
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
- import { EllipsisIcon, EditIcon, StartIcon, RestartIcon, StopIcon, TrashIcon, RedeployIcon } from '$lib/icons';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
+ import { EditIcon, StartIcon, RestartIcon, StopIcon, TrashIcon, RedeployIcon, EllipsisIcon } from '$lib/icons';
import { Spinner } from '$lib/components/ui/spinner/index.js';
import { goto } from '$app/navigation';
import { toast } from 'svelte-sonner';
- import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -420,16 +420,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -453,6 +447,8 @@
</DropdownMenu.Item>
{/if}
+ <DropdownMenu.Separator />
+
{#if item.status !== 'running'}
<DropdownMenu.Item onclick={() => performProjectAction('start', item.id)} disabled={isLoading.start || isAnyLoading}>
{#if isLoading.start}
@@ -463,6 +459,15 @@
{m.common_up()}
</DropdownMenu.Item>
{:else}
+ <DropdownMenu.Item onclick={() => performProjectAction('stop', item.id)} disabled={isLoading.stop || isAnyLoading}>
+ {#if isLoading.stop}
+ <Spinner class="size-4" />
+ {:else}
+ <StopIcon class="size-4" />
+ {/if}
+ {m.common_down()}
+ </DropdownMenu.Item>
+
<DropdownMenu.Item
onclick={() => performProjectAction('restart', item.id)}
disabled={isLoading.restart || isAnyLoading}
@@ -474,15 +479,6 @@
{/if}
{m.common_restart()}
</DropdownMenu.Item>
-
- <DropdownMenu.Item onclick={() => performProjectAction('stop', item.id)} disabled={isLoading.stop || isAnyLoading}>
- {#if isLoading.stop}
- <Spinner class="size-4" />
- {:else}
- <StopIcon class="size-4" />
- {/if}
- {m.common_down()}
- </DropdownMenu.Item>
{/if}
<DropdownMenu.Item onclick={() => performProjectAction('redeploy', item.id)} disabled={isLoading.pull || isAnyLoading}>
diff --git a/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte b/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
index 83f22114a..682dff157 100644
--- a/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
+++ b/frontend/src/routes/(app)/settings/api-keys/api-key-table.svelte
@@ -1,9 +1,9 @@
<script lang="ts">
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { CopyButton } from '$lib/components/ui/copy-button';
import { toast } from 'svelte-sonner';
- import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -14,7 +14,7 @@
import { UniversalMobileCard } from '$lib/components/arcane-table';
import { apiKeyService } from '$lib/services/api-key-service';
import * as m from '$lib/paraglide/messages.js';
- import { ApiKeyIcon, TrashIcon, EllipsisIcon, EditIcon } from '$lib/icons';
+ import { ApiKeyIcon, TrashIcon, EditIcon, EllipsisIcon } from '$lib/icons';
let {
apiKeys = $bindable(),
@@ -234,16 +234,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -252,6 +246,9 @@
<EditIcon class="size-4" />
{m.common_edit()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item variant="destructive" onclick={() => handleDeleteApiKey(item.id, item.name)}>
<TrashIcon class="size-4" />
{m.common_delete()}
diff --git a/frontend/src/routes/(app)/settings/users/user-table.svelte b/frontend/src/routes/(app)/settings/users/user-table.svelte
index e9d42eb38..9defcf161 100644
--- a/frontend/src/routes/(app)/settings/users/user-table.svelte
+++ b/frontend/src/routes/(app)/settings/users/user-table.svelte
@@ -192,16 +192,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -211,7 +205,10 @@
<EditIcon class="size-4" />
{m.common_edit()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
{/if}
+
<DropdownMenu.Item variant="destructive" onclick={() => handleDeleteUser(item.id, item.username)}>
<TrashIcon class="size-4" />
{m.common_delete()}
diff --git a/frontend/src/routes/(app)/volumes/volume-table.svelte b/frontend/src/routes/(app)/volumes/volume-table.svelte
index e977c812c..e5121cc8e 100644
--- a/frontend/src/routes/(app)/volumes/volume-table.svelte
+++ b/frontend/src/routes/(app)/volumes/volume-table.svelte
@@ -1,9 +1,9 @@
<script lang="ts">
import ArcaneTable from '$lib/components/arcane-table/arcane-table.svelte';
import { ArcaneButton } from '$lib/components/arcane-button/index.js';
+ import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { goto } from '$app/navigation';
import { toast } from 'svelte-sonner';
- import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js';
import { openConfirmDialog } from '$lib/components/confirm-dialog';
import StatusBadge from '$lib/components/badges/status-badge.svelte';
import { handleApiResultWithCallbacks } from '$lib/utils/api.util';
@@ -17,7 +17,7 @@
import { m } from '$lib/paraglide/messages';
import { volumeService } from '$lib/services/volume-service';
import bytes from 'bytes';
- import { TrashIcon, EllipsisIcon, InspectIcon, VolumesIcon, CalendarIcon } from '$lib/icons';
+ import { TrashIcon, InspectIcon, VolumesIcon, CalendarIcon, EllipsisIcon } from '$lib/icons';
import { Spinner } from '$lib/components/ui/spinner';
import settingsStore from '$lib/stores/config-store';
@@ -142,6 +142,7 @@
] satisfies ColumnSpec<VolumeSummaryDto>[];
const mobileFields = [
+ { id: 'id', label: m.common_id(), defaultVisible: false },
{ id: 'inUse', label: m.common_status(), defaultVisible: true },
{ id: 'size', label: m.common_size(), defaultVisible: true },
{ id: 'createdAt', label: m.common_created(), defaultVisible: true },
@@ -267,16 +268,10 @@
<DropdownMenu.Root>
<DropdownMenu.Trigger>
{#snippet child({ props })}
- <ArcaneButton
- {...props}
- action="base"
- tone="ghost"
- size="icon"
- class="relative size-8 p-0"
- icon={EllipsisIcon}
- showLabel={false}
- customLabel={m.common_open_menu()}
- />
+ <ArcaneButton {...props} action="base" tone="ghost" size="icon" class="size-8">
+ <span class="sr-only">{m.common_open_menu()}</span>
+ <EllipsisIcon class="size-4" />
+ </ArcaneButton>
{/snippet}
</DropdownMenu.Trigger>
<DropdownMenu.Content align="end">
@@ -285,6 +280,9 @@
<InspectIcon class="size-4" />
{m.common_inspect()}
</DropdownMenu.Item>
+
+ <DropdownMenu.Separator />
+
<DropdownMenu.Item
variant="destructive"
onclick={() => handleRemoveVolumeConfirm(item.name)}
diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts
index 81d78f8cd..dcc86dfd3 100644
--- a/frontend/vite.config.ts
+++ b/frontend/vite.config.ts
@@ -4,7 +4,6 @@ import tailwindcss from '@tailwindcss/vite';
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import Icons from 'unplugin-icons/vite';
-import { codecovSvelteKitPlugin } from '@codecov/sveltekit-plugin';
export default defineConfig({
plugins: [
@@ -20,13 +19,6 @@ export default defineConfig({
Icons({
compiler: 'svelte',
autoInstall: true
- }),
- codecovSvelteKitPlugin({
- enableBundleAnalysis: true,
- bundleName: 'arcane-frontend',
- oidc: {
- useGitHubOIDC: true
- }
})
],
build: {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index cba6652e5..eacff91bd 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -104,9 +104,6 @@ importers:
specifier: ^0.12.2
version: 0.12.2([email protected])
devDependencies:
- '@codecov/sveltekit-plugin':
- specifier: ^1.9.1
'@iconify/json':
specifier: ^2.2.431
version: 2.2.431
@@ -224,21 +221,6 @@ packages:
'@acemir/[email protected]':
resolution: {integrity: sha512-9CnlMCI0LmCIq0olalQqdWrJHPzm0/tw3gzOA9zJSgvFX7Xau3D24mAGa4BtwxwY69nsuJW6kQqqCzf/mEcQgg==}
- '@actions/[email protected]':
- resolution: {integrity: sha512-hXJCSrkwfA46Vd9Z3q4cpEpHB1rL5NG04+/rbqW9d3+CSvtB1tYe8UTpAlixa1vj0m/ULglfEK2UKxMGxCxv5A==}
-
- '@actions/[email protected]':
- resolution: {integrity: sha512-+sCcHHbVdk93a0XT19ECtO/gIXoxvdsgQLzb2fE2/5sIZmWQuluYyjPQtrtTHdU1YzTZ7bAPN4sITq2xi1679w==}
-
- '@actions/[email protected]':
- resolution: {integrity: sha512-xbZVcaqD4XnQAe35qSQqskb3SqIAfRyLBrHMd/8TuL7hJSz2QtbDwnNM8zWx4zO5l2fnGtseNE3MbEvD7BxVMw==}
-
- '@actions/[email protected]':
- resolution: {integrity: sha512-mx8hyJi/hjFvbPokCg4uRd4ZX78t+YyRPtnKWwIl+RzNaVuFpQHfmlGVfsKEJN8LwTCvL+DfVgAM04XaHkm6bA==}
-
- '@actions/[email protected]':
- resolution: {integrity: sha512-wi9JjgKLYS7U/z8PPbco+PvTb/nRWjeoFlJ1Qer83k/3C5PHQi28hiVdeE2kHXmIL99mQFawx8qt/JPjZilJ8Q==}
-
resolution: {integrity: sha512-MGQsmw10ZyI+EJo45CdSER4zEb+p31LpDAFp2Z3gkSd1yqVZGi0Ebx++YTEMonJy4oChEMLsxZ64j8FH6sSqtQ==}
@@ -298,23 +280,6 @@ packages:
resolution: {integrity: sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==}
engines: {node: '>=6.9.0'}
- '@codecov/[email protected]':
- resolution: {integrity: sha512-dt3ic7gMswz4p/qdkYPVJwXlLiLsz55rBBn2I7mr0HTG8pCoLRqnANJIwo5WrqGBZgPyVSMPBqBra6VxLWfDyA==}
- engines: {node: '>=18.0.0'}
-
- '@codecov/[email protected]':
- resolution: {integrity: sha512-2ALWaYu5q/q5pfsoUw7HgaVWB9flz+2/EUpRSKv6sZn2+3cvur3wryiBtiBYLBYqkd2Po4wrgP9xyfH7FrmKZQ==}
- engines: {node: '>=18.0.0'}
- peerDependencies:
- '@sveltejs/kit': 2.x
- svelte: 4.x || 5.x
-
- '@codecov/[email protected]':
- resolution: {integrity: sha512-S6Yne7comVulJ1jD3T7rCfYFHPR0zUjAYoLjUDPXNJCUrdzWJdf/ak/UepE7TicqQG+yBa6eb5WusqcPgg+1AQ==}
- engines: {node: '>=18.0.0'}
- peerDependencies:
- vite: 4.x || 5.x || 6.x
-
'@csstools/[email protected]':
resolution: {integrity: sha512-S11EXWJyy0Mz5SYvRmY8nJYTFFd1LCNV+7cXyAgQtOOuzb4EsgfqDufL+9esx72/eLhsRdGZwaldu/h+E4t4BA==}
engines: {node: '>=18'}
@@ -1115,54 +1080,6 @@ packages:
resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==}
engines: {node: '>= 8'}
- '@octokit/[email protected]':
- resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-/g2d4sW9nUDJOMz3mabVQvOGhVa4e/BN/Um7yca9Bb2XTzPPnfTWHWQg+IsEYO7M3Vx+EXvaM/I2pJWIMun1bg==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-H1fNTMA57HbkFESSt3Y9+FBICv+0jFceJFPWDePYlR/iMGrwM5ph+Dd4XRQs+8X+PUFURLQgX9ChPfhJ/1uNQw==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-3mkDltSfcDUoa176nlGoA32RGjeWjl3K7F/BwHwRMJUW/IteSa4bnSV8p2ThNkcIcZU2umkZWxwETSSCJf2Q7g==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-EtqRBEjp1dL/15V7WiX5LJMIxxkdiGJnabzYx5Apx4FkQIFgAfKumXeYAqqJCj1s+BMX4cPFIFC4OLCR6stlnA==}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-9sIH3nSUttelJSXUrmGzl7QUBFul0/mB8HRYl3fOlgHbIWG+WnYDXU3v/2zMtAvuzZ/ed00Ei6on975FhBfzrg==}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-u3KYkGF7GcZnSD/3UP0S7K5XUFT2FkOQdcfXZGZQPGv3lm4F2Xbf71lvjldr8c1H3nNbF+33cLEkWYbokGWqiQ==}
- engines: {node: '>= 18'}
- peerDependencies:
- '@octokit/core': '5'
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-xV1b+ceKV9KytQe3zCVqjg+8GTGfDYwaT1ATU5isiUyVtlVAO3HNdzpS4sr4GBx4hxQ46s7ITtZrAsxG22+rVg==}
- engines: {node: '>= 18'}
- peerDependencies:
- '@octokit/core': '5'
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-v9iyEQJH6ZntoENr9/yXxjuezh4My67CBSu9r6Ve/05Iu5gNgnisNWOsoJHTP6k0Rr0+HQIpnH+kyammu90q/g==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-qnB2+SY3hkCmBxZsR/MPCybNmbJe4KAlfWErXq+rBKkQJlbjdJeS85VI9r8UqeLYLvnAenU8Q1okM/0MBsAGXw==}
- engines: {node: '>= 18'}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-1rhSOfRa6H9w4YwK0yrf5faDaDTb+yLyBUKOCV4xtCDB5VmIPqd/v9yr9o6SAzOAlRxMiRiCic6JVM1/kunVkw==}
-
- '@octokit/[email protected]':
- resolution: {integrity: sha512-ifLaO34EbbPj0Xgro4G5lP5asESjwHracYJvVaPIyXMuiuXLlhic3S47cBdTb+jfODkTE5YtGCLt3Ay3+J97sA==}
-
'@oxc-resolver/[email protected]':
resolution: {integrity: sha512-kVnY21v0GyZ/+LG6EIO48wK3mE79BUuakHUYLIqobO/Qqq4mJsjuYXMSn3JtLcKZpN1HDVit4UHpGJHef1lrlw==}
cpu: [arm]
@@ -1963,9 +1880,6 @@ packages:
resolution: {integrity: sha512-Sg0xJUNDU1sJNGdfGWhVHX0kkZ+HWcvmVymJbj6NSgZZmW/8S9Y2HQ5euytnIgakgxN6papOAWiwDo1ctFDcoQ==}
hasBin: true
- resolution: {integrity: sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ==}
-
resolution: {integrity: sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==}
@@ -2001,10 +1915,6 @@ packages:
resolution: {integrity: sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==}
- resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
- engines: {node: '>=10'}
-
resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==}
engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}
@@ -2169,9 +2079,6 @@ packages:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
- resolution: {integrity: sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==}
-
resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==}
engines: {node: '>=6'}
@@ -2416,10 +2323,6 @@ packages:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
- resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
engines: {node: '>= 0.4'}
@@ -2840,9 +2743,6 @@ packages:
resolution: {integrity: sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==}
- resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==}
-
resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==}
engines: {node: '>=18'}
@@ -3273,10 +3173,6 @@ packages:
resolution: {integrity: sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==}
engines: {node: '>=14.0.0'}
- resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
- engines: {node: '>=8'}
-
resolution: {integrity: sha512-e4VWZETyXaKGhpkxOXP+B/d0Fp/zKViZoJmneZWe/05Y2aqSKj3YN2nLfYPJBQ87WEiY4BQCQ9hWGu9mPT1a1Q==}
engines: {node: '>= 18.0.0'}
@@ -3447,10 +3343,6 @@ packages:
engines: {node: '>=18.0.0'}
hasBin: true
- resolution: {integrity: sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==}
- engines: {node: '>=0.6.11 <=0.7.0 || >=0.7.3'}
-
resolution: {integrity: sha512-7bziOlRqH0hJx80h/3mbicLW7o8qLsH5+RaLR2t+OHM3D0JlWGODQKQ4cxbK7WlvmUxpcj6Kgu6EKqjrGFe3QQ==}
@@ -3483,10 +3375,6 @@ packages:
resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==}
- resolution: {integrity: sha512-VfQPToRA5FZs/qJxLIinmU59u0r7LXqoJkCzinq3ckNJp3vKEh7jTWN589YQ5+aoAC/TGRLyJLCPKcLQbM8r9g==}
- engines: {node: '>=18.17'}
-
resolution: {integrity: sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==}
@@ -3502,9 +3390,6 @@ packages:
resolution: {integrity: sha512-MR04uvD+07cwl/yhVuVWAtw+3GOR/knlL55Nd/wAdblk27GCVt3lqpTivy/tkJcZoNPzTwS1Y+KMojlLDhoTzg==}
- resolution: {integrity: sha512-yCzhz6FN2wU1NiiQRogkTQszlQSlpWaw8SvVegAc+bDxbzHgh1vX8uIe8OYyMH6DwH+sdTJsgMl36+mSMdRJIQ==}
-
resolution: {integrity: sha512-MBlMtT5RuMYZy4TZgqUL2OTtOdTUVsS1Mhj6G1pEzMlFJlEnq6mhUfoIt45gBWxHcsOdXJDWLg3pRZ+YmvAVWQ==}
peerDependencies:
@@ -3528,10 +3413,6 @@ packages:
vue-template-es2015-compiler:
optional: true
- resolution: {integrity: sha512-4/u/j4FrCKdi17jaxuJA0jClGxB1AvU2hw/IuayPc4ay1XGaJs/rbb4v5WKwAjNifjmXK9PIFyuPiaK8azyR9w==}
- engines: {node: '>=14.0.0'}
-
resolution: {integrity: sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==}
engines: {node: '>=18.12.0'}
@@ -3671,9 +3552,6 @@ packages:
resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==}
engines: {node: '>=12'}
- resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==}
-
resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
engines: {node: '>=10.0.0'}
@@ -3713,9 +3591,6 @@ packages:
peerDependencies:
zod: ^3.25 || ^4.0.14
- resolution: {integrity: sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==}
-
resolution: {integrity: sha512-rftlrkhHZOcjDwkGlnUtZZkvaPHCsDATp4pGpuOOMDaTdDDXF91wuVDJoWoPsKX/3YPQ5fHuF3STjcYyKr+Qhg==}
@@ -3726,32 +3601,6 @@ snapshots:
'@acemir/[email protected]': {}
- '@actions/[email protected]':
- dependencies:
- '@actions/exec': 1.1.1
- '@actions/http-client': 2.2.3
-
- '@actions/[email protected]':
- dependencies:
- '@actions/io': 1.1.3
-
- '@actions/[email protected]':
- dependencies:
- '@actions/http-client': 2.2.3
- '@octokit/core': 5.2.2
- '@octokit/plugin-paginate-rest': 9.2.2(@octokit/[email protected])
- '@octokit/plugin-rest-endpoint-methods': 10.4.1(@octokit/[email protected])
- '@octokit/request': 8.4.1
- '@octokit/request-error': 5.1.1
- undici: 6.23.0
-
- '@actions/[email protected]':
- dependencies:
- tunnel: 0.0.6
- undici: 6.23.0
-
- '@actions/[email protected]': {}
-
dependencies:
package-manager-detector: 1.6.0
@@ -3833,31 +3682,6 @@ snapshots:
'@babel/helper-string-parser': 7.27.1
'@babel/helper-validator-identifier': 7.28.5
- '@codecov/[email protected]':
- dependencies:
- '@actions/core': 1.11.1
- '@actions/github': 6.0.1
- chalk: 4.1.2
- semver: 7.7.3
- unplugin: 1.16.1
- zod: 3.25.76
-
- dependencies:
- '@codecov/bundler-plugin-core': 1.9.1
- svelte: 5.46.4
- unplugin: 1.16.1
- transitivePeerDependencies:
- - vite
-
- dependencies:
- '@codecov/bundler-plugin-core': 1.9.1
- unplugin: 1.16.1
-
'@csstools/[email protected]': {}
'@csstools/[email protected](@csstools/[email protected](@csstools/[email protected]))(@csstools/[email protected])':
@@ -4393,64 +4217,6 @@ snapshots:
'@nodelib/fs.scandir': 2.1.5
fastq: 1.20.1
- '@octokit/[email protected]': {}
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/auth-token': 4.0.0
- '@octokit/graphql': 7.1.1
- '@octokit/request': 8.4.1
- '@octokit/request-error': 5.1.1
- '@octokit/types': 13.10.0
- before-after-hook: 2.2.3
- universal-user-agent: 6.0.1
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/types': 13.10.0
- universal-user-agent: 6.0.1
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/request': 8.4.1
- '@octokit/types': 13.10.0
- universal-user-agent: 6.0.1
-
- '@octokit/[email protected]': {}
-
- '@octokit/[email protected]': {}
-
- '@octokit/[email protected](@octokit/[email protected])':
- dependencies:
- '@octokit/core': 5.2.2
- '@octokit/types': 12.6.0
-
- '@octokit/[email protected](@octokit/[email protected])':
- dependencies:
- '@octokit/core': 5.2.2
- '@octokit/types': 12.6.0
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/types': 13.10.0
- deprecation: 2.3.1
- once: 1.4.0
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/endpoint': 9.0.6
- '@octokit/request-error': 5.1.1
- '@octokit/types': 13.10.0
- universal-user-agent: 6.0.1
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/openapi-types': 20.0.0
-
- '@octokit/[email protected]':
- dependencies:
- '@octokit/openapi-types': 24.2.0
-
'@oxc-resolver/[email protected]':
optional: true
@@ -5120,8 +4886,6 @@ snapshots:
-
dependencies:
require-from-string: 2.0.2
@@ -5160,11 +4924,6 @@ snapshots:
- dependencies:
- ansi-styles: 4.3.0
- supports-color: 7.2.0
-
@@ -5307,8 +5066,6 @@ snapshots:
-
@@ -5628,8 +5385,6 @@ snapshots:
-
@@ -6050,10 +5805,6 @@ snapshots:
- dependencies:
- wrappy: 1.0.2
-
dependencies:
mimic-function: 5.0.1
@@ -6533,10 +6284,6 @@ snapshots:
optional: true
- dependencies:
- has-flag: 4.0.0
-
dependencies:
'@jridgewell/trace-mapping': 0.3.31
@@ -6742,8 +6489,6 @@ snapshots:
optionalDependencies:
fsevents: 2.3.3
-
@@ -6766,8 +6511,6 @@ snapshots:
-
dependencies:
'@types/unist': 3.0.3
@@ -6791,8 +6534,6 @@ snapshots:
unist-util-is: 6.0.1
unist-util-visit-parents: 6.0.2
-
dependencies:
'@antfu/install-pkg': 1.1.0
@@ -6805,11 +6546,6 @@ snapshots:
transitivePeerDependencies:
- supports-color
- dependencies:
- acorn: 8.15.0
- webpack-virtual-modules: 0.6.2
-
dependencies:
'@jridgewell/remapping': 2.3.5
@@ -6912,8 +6648,6 @@ snapshots:
string-width: 5.1.2
strip-ansi: 7.1.2
-
@@ -6940,8 +6674,6 @@ snapshots:
zod: 4.3.6
optional: true
-
diff --git a/tests/spec/images.spec.ts b/tests/spec/images.spec.ts
index 491221d3d..b7d9e30c5 100644
--- a/tests/spec/images.spec.ts
+++ b/tests/spec/images.spec.ts
@@ -84,8 +84,8 @@ test.describe('Images Page', () => {
test.skip(!realImages.length, 'No images available for pull API test');
await navigateToImages(page);
- const firstRow = await page.getByRole('row', { name: 'ghcr.io/linuxserver/nginx' });
- await firstRow.getByLabel('Open menu').click();
+ const firstRow = await page.getByRole('cell', { name: 'Open menu' }).first();
+ await firstRow.getByRole('button', { name: 'Open menu' }).click();
await page.getByRole('menuitem', { name: 'Pull' }).click();
await page.waitForLoadState('networkidle');
diff --git a/tests/spec/project.spec.ts b/tests/spec/project.spec.ts
index 74dce6066..e32663397 100644
--- a/tests/spec/project.spec.ts
+++ b/tests/spec/project.spec.ts
@@ -245,20 +245,16 @@ test.describe('New Compose Project Page', () => {
await page.getByRole('tab', { name: 'Services' }).click();
await page.waitForLoadState('networkidle');
- const serviceNameWhenStopped = page.getByRole('heading', { name: 'redis', exact: true });
+ const serviceNameWhenStopped = page.getByRole('table').getByText('redis', { exact: true });
await expect(serviceNameWhenStopped).toBeVisible();
- const containerNameWhenStopped = page.getByRole('link', { name: 'test-redis-container redis' });
- await expect(containerNameWhenStopped).not.toBeVisible();
-
const deployButton = page.getByRole('button', { name: 'Up', exact: true }).filter({ hasText: 'Up' }).last();
await deployButton.click();
await page.waitForTimeout(5000);
await page.waitForLoadState('networkidle');
- const containerNameElement = page.getByRole('link', { name: 'test-redis-container redis' });
- await expect(containerNameElement).toBeVisible({ timeout: 15000 });
+ await expect(page.getByRole('link', { name: 'test-redis-container' })).toBeVisible();
});
test('should destroy the project and remove files from disk', async ({ page }) => {
diff --git a/tests/spec/volumes.spec.ts b/tests/spec/volumes.spec.ts
index 86ed00c82..03f7022b1 100644
--- a/tests/spec/volumes.spec.ts
+++ b/tests/spec/volumes.spec.ts
@@ -94,7 +94,6 @@ test.describe('Volumes Page', () => {
const row = await page.getByRole('row', { name: volumeName });
await row.getByRole('button', { name: 'Open menu' }).click();
-
await page.getByRole('menuitem', { name: 'Remove' }).click();
await expect(page.getByRole('heading', { name: 'Remove Volume' })).toBeVisible();