Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
feat: ability to archive projects (#2519)
Kyle Mendell8a7feb7daf46
diff --git a/backend/internal/common/errors.go b/backend/internal/common/errors.goindex b57941d72..f27ce6f38 100644--- a/backend/internal/common/errors.go+++ b/backend/internal/common/errors.go@@ -790,6 +790,34 @@ func (e *ProjectRestartError) Error() string {return fmt.Sprintf("Failed to restart project: %v", e.Err)}+type ProjectArchiveError struct {+ Err error+}++func (e *ProjectArchiveError) Error() string {+ return fmt.Sprintf("Failed to archive project: %v", e.Err)+}++type ProjectUnarchiveError struct {+ Err error+}++func (e *ProjectUnarchiveError) Error() string {+ return fmt.Sprintf("Failed to unarchive project: %v", e.Err)+}++type ProjectMustBeStoppedError struct{}++func (e *ProjectMustBeStoppedError) Error() string {+ return "project must be stopped before archiving"+}++type ProjectArchivedError struct{}++func (e *ProjectArchivedError) Error() string {+ return "project is archived and must be unarchived before this action"+}+type ProjectStatusCountsError struct {Err error}diff --git a/backend/internal/huma/handlers/projects.go b/backend/internal/huma/handlers/projects.goindex 09be87b6f..610344a2d 100644--- a/backend/internal/huma/handlers/projects.go+++ b/backend/internal/huma/handlers/projects.go@@ -43,6 +43,7 @@ type ListProjectsInput struct {Limit int `query:"limit" default:"20" doc:"Number of items per page"`Status string `query:"status" doc:"Filter by status (comma-separated: running,stopped,partially running)"`Updates string `query:"updates" doc:"Filter by update status (has_update, up_to_date, error, unknown)"`+ Archived string `query:"archived" doc:"Archived filter: 'true' (only archived), 'all' (include archived). Default excludes archived."`}type ListProjectsOutput struct {@@ -152,6 +153,24 @@ type RestartProjectOutput struct {Body base.ApiResponse[base.MessageResponse]}+type ArchiveProjectInput struct {+ EnvironmentID string `path:"id" doc:"Environment ID"`+ ProjectID string `path:"projectId" doc:"Project ID"`+}++type ArchiveProjectOutput struct {+ Body base.ApiResponse[base.MessageResponse]+}++type UnarchiveProjectInput struct {+ EnvironmentID string `path:"id" doc:"Environment ID"`+ ProjectID string `path:"projectId" doc:"Project ID"`+}++type UnarchiveProjectOutput struct {+ Body base.ApiResponse[base.MessageResponse]+}+type PullProjectImagesInput struct {EnvironmentID string `path:"id" doc:"Environment ID"`ProjectID string `path:"projectId" doc:"Project ID"`@@ -343,6 +362,32 @@ func RegisterProjects(api huma.API, projectService *services.ProjectService) {},}, h.RestartProject)+ huma.Register(api, huma.Operation{+ OperationID: "archive-project",+ Method: http.MethodPost,+ Path: "/environments/{id}/projects/{projectId}/archive",+ Summary: "Archive a project",+ Description: "Archive a stopped Docker Compose project",+ Tags: []string{"Projects"},+ Security: []map[string][]string{+ {"BearerAuth": {}},+ {"ApiKeyAuth": {}},+ },+ }, h.ArchiveProject)++ huma.Register(api, huma.Operation{+ OperationID: "unarchive-project",+ Method: http.MethodPost,+ Path: "/environments/{id}/projects/{projectId}/unarchive",+ Summary: "Unarchive a project",+ Description: "Unarchive a Docker Compose project",+ Tags: []string{"Projects"},+ Security: []map[string][]string{+ {"BearerAuth": {}},+ {"ApiKeyAuth": {}},+ },+ }, h.UnarchiveProject)+huma.Register(api, huma.Operation{OperationID: "pull-project-images",Method: http.MethodPost,@@ -383,6 +428,9 @@ func (h *ProjectHandler) ListProjects(ctx context.Context, input *ListProjectsInif input.Updates != "" {filters["updates"] = input.Updates}+ if input.Archived != "" {+ filters["archived"] = input.Archived+ }params := pagination.QueryParams{SearchQuery: pagination.SearchQuery{@@ -432,7 +480,7 @@ func (h *ProjectHandler) GetProjectStatusCounts(ctx context.Context, input *GetPreturn nil, huma.Error500InternalServerError("service not available")}- _, running, stopped, total, err := h.projectService.GetProjectStatusCounts(ctx)+ _, running, stopped, total, archived, err := h.projectService.GetProjectStatusCounts(ctx)if err != nil {return nil, huma.Error500InternalServerError((&common.ProjectStatusCountsError{Err: err}).Error())}@@ -441,9 +489,10 @@ func (h *ProjectHandler) GetProjectStatusCounts(ctx context.Context, input *GetPBody: base.ApiResponse[project.StatusCounts]{Success: true,Data: project.StatusCounts{- RunningProjects: int(running),- StoppedProjects: int(stopped),- TotalProjects: int(total),+ RunningProjects: int(running),+ StoppedProjects: int(stopped),+ TotalProjects: int(total),+ ArchivedProjects: int(archived),},},}, nil@@ -507,6 +556,10 @@ func (h *ProjectHandler) DownProject(ctx context.Context, input *DownProjectInpu}if err := h.projectService.DownProject(ctx, input.ProjectID, *user); err != nil {+ var archivedErr *common.ProjectArchivedError+ if errors.As(err, &archivedErr) {+ return nil, huma.Error400BadRequest((&common.ProjectDownError{Err: err}).Error())+ }return nil, huma.Error500InternalServerError((&common.ProjectDownError{Err: err}).Error())}@@ -547,6 +600,8 @@ func (h *ProjectHandler) CreateProject(ctx context.Context, input *CreateProjectresponse.DirName = utils.DerefString(proj.DirName)response.RelativePath = h.projectService.GetProjectRelativePath(ctx, proj.Path)response.GitOpsManagedBy = proj.GitOpsManagedBy+ response.IsArchived = proj.IsArchived+ response.ArchivedAt = proj.ArchivedAtreturn &CreateProjectOutput{Body: base.ApiResponse[project.CreateReponse]{@@ -632,6 +687,10 @@ func (h *ProjectHandler) RedeployProject(ctx context.Context, input *RedeployPro}if err := h.projectService.RedeployProject(ctx, input.ProjectID, *user); err != nil {+ var archivedErr *common.ProjectArchivedError+ if errors.As(err, &archivedErr) {+ return nil, huma.Error400BadRequest(err.Error())+ }return nil, huma.Error400BadRequest((&common.ProjectRedeploymentError{Err: err}).Error())}@@ -764,6 +823,10 @@ func (h *ProjectHandler) RestartProject(ctx context.Context, input *RestartProje}if err := h.projectService.RestartProject(ctx, input.ProjectID, *user); err != nil {+ var archivedErr *common.ProjectArchivedError+ if errors.As(err, &archivedErr) {+ return nil, huma.Error400BadRequest(err.Error())+ }return nil, huma.Error400BadRequest((&common.ProjectRestartError{Err: err}).Error())}@@ -777,6 +840,62 @@ func (h *ProjectHandler) RestartProject(ctx context.Context, input *RestartProje}, nil}+func (h *ProjectHandler) ArchiveProject(ctx context.Context, input *ArchiveProjectInput) (*ArchiveProjectOutput, error) {+ if h.projectService == nil {+ return nil, huma.Error500InternalServerError("service not available")+ }++ if input.ProjectID == "" {+ return nil, huma.Error400BadRequest((&common.ProjectIDRequiredError{}).Error())+ }++ user, exists := humamw.GetCurrentUserFromContext(ctx)+ if !exists {+ return nil, huma.Error401Unauthorized((&common.NotAuthenticatedError{}).Error())+ }++ if err := h.projectService.ArchiveProject(ctx, input.ProjectID, *user); err != nil {+ var mustStopErr *common.ProjectMustBeStoppedError+ if errors.As(err, &mustStopErr) {+ return nil, huma.Error400BadRequest(err.Error())+ }+ return nil, huma.Error500InternalServerError((&common.ProjectArchiveError{Err: err}).Error())+ }++ return &ArchiveProjectOutput{+ Body: base.ApiResponse[base.MessageResponse]{+ Success: true,+ Data: base.MessageResponse{Message: "Project archived successfully"},+ },+ }, nil+}++func (h *ProjectHandler) UnarchiveProject(ctx context.Context, input *UnarchiveProjectInput) (*UnarchiveProjectOutput, error) {+ if h.projectService == nil {+ return nil, huma.Error500InternalServerError("service not available")+ }++ if input.ProjectID == "" {+ return nil, huma.Error400BadRequest((&common.ProjectIDRequiredError{}).Error())+ }++ user, exists := humamw.GetCurrentUserFromContext(ctx)+ if !exists {+ return nil, huma.Error401Unauthorized((&common.NotAuthenticatedError{}).Error())+ }++ if err := h.projectService.UnarchiveProject(ctx, input.ProjectID, *user); err != nil {+ return nil, huma.Error500InternalServerError((&common.ProjectUnarchiveError{Err: err}).Error())+ }++ return &UnarchiveProjectOutput{+ Body: base.ApiResponse[base.MessageResponse]{+ Success: true,+ Data: base.MessageResponse{Message: "Project unarchived successfully"},+ },+ }, nil+}+// PullProjectImages pulls all images for a project with streaming progress.func (h *ProjectHandler) PullProjectImages(ctx context.Context, input *PullProjectImagesInput) (*huma.StreamResponse, error) {if h.projectService == nil {diff --git a/backend/internal/models/project.go b/backend/internal/models/project.goindex e80d0c861..096774011 100644--- a/backend/internal/models/project.go+++ b/backend/internal/models/project.go@@ -1,5 +1,7 @@package models+import "time"+type ProjectStatus stringconst (@@ -22,6 +24,8 @@ type Project struct {RunningCount int `json:"running_count" sortable:"true"`GitOpsManagedBy *string `json:"gitops_managed_by,omitempty" gorm:"column:gitops_managed_by"`ComposeProjectName *string `json:"compose_project_name,omitempty" gorm:"column:compose_project_name"`+ IsArchived bool `json:"is_archived" gorm:"column:is_archived;default:false;index"`+ ArchivedAt *time.Time `json:"archived_at,omitempty" gorm:"column:archived_at"`BaseModel}diff --git a/backend/internal/services/project_service.go b/backend/internal/services/project_service.goindex 2f3123831..6b332ee6d 100644--- a/backend/internal/services/project_service.go+++ b/backend/internal/services/project_service.go@@ -769,6 +769,8 @@ func (s *ProjectService) GetProjectDetails(ctx context.Context, projectID stringresp.CreatedAt = proj.CreatedAt.Format(time.RFC3339)resp.UpdatedAt = proj.UpdatedAt.Format(time.RFC3339)+ resp.IsArchived = proj.IsArchived+ resp.ArchivedAt = proj.ArchivedAtresp.ComposeContent = composeContentresp.EnvContent = effectiveEnvContentresp.HasBuildDirective = false@@ -1442,27 +1444,35 @@ func (s *ProjectService) incrementStatusCounts(status models.ProjectStatus, runn}}-func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCount, runningProjects, stoppedProjects, totalProjects int, err error) {+func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCount, runningProjects, stoppedProjects, totalProjects, archivedProjects int, err error) {folderCount, _ = s.countProjectFolders(ctx)var projectsList []models.Projectif err := s.db.WithContext(ctx).Find(&projectsList).Error; err != nil {- return folderCount, 0, 0, 0, fmt.Errorf("failed to list projects: %w", err)+ return folderCount, 0, 0, 0, 0, fmt.Errorf("failed to list projects: %w", err)}totalProjects = len(projectsList)runningProjects = 0stoppedProjects = 0+ activeProjects := make([]models.Project, 0, len(projectsList))+ for _, p := range projectsList {+ if p.IsArchived {+ archivedProjects+++ continue+ }+ activeProjects = append(activeProjects, p)+ }// 1. Fetch all compose containerscontainers, err := projects.ListGlobalComposeContainers(ctx)if err != nil {slog.ErrorContext(ctx, "Failed to list global compose containers for counts", "error", err)// Fallback to DB status- for _, p := range projectsList {+ for _, p := range activeProjects {s.incrementStatusCounts(p.Status, &runningProjects, &stoppedProjects)}- return folderCount, runningProjects, stoppedProjects, totalProjects, nil+ return folderCount, runningProjects, stoppedProjects, totalProjects, archivedProjects, nil}// 2. Group by project@@ -1475,7 +1485,7 @@ func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCoun}// 3. Calculate status for each project- for _, p := range projectsList {+ for _, p := range activeProjects {projectContainers := lookupProjectContainers(p, containersByProject)// Convert to ProjectServiceInfo (minimal needed for calculateProjectStatus)@@ -1496,18 +1506,101 @@ func (s *ProjectService) GetProjectStatusCounts(ctx context.Context) (folderCouns.incrementStatusCounts(status, &runningProjects, &stoppedProjects)}- return folderCount, runningProjects, stoppedProjects, totalProjects, nil+ return folderCount, runningProjects, stoppedProjects, totalProjects, archivedProjects, nil}// End Helpers// Project Actions+func ensureProjectMutableInternal(proj *models.Project) error {+ if proj != nil && proj.IsArchived {+ return &common.ProjectArchivedError{}+ }+ return nil+}++func isProjectArchiveBlockedInternal(proj *models.Project) bool {+ if proj == nil {+ return false+ }+ if proj.RunningCount > 0 {+ return true+ }+ switch proj.Status {+ case models.ProjectStatusRunning, models.ProjectStatusPartiallyRunning, models.ProjectStatusDeploying, models.ProjectStatusRestarting:+ return true+ case models.ProjectStatusStopped, models.ProjectStatusUnknown, models.ProjectStatusStopping:+ return false+ default:+ return false+ }+}++func (s *ProjectService) ArchiveProject(ctx context.Context, projectID string, user models.User) error {+ proj, err := s.GetProjectFromDatabaseByID(ctx, projectID)+ if err != nil {+ return err+ }+ if proj.IsArchived {+ return nil+ }+ if isProjectArchiveBlockedInternal(proj) {+ return &common.ProjectMustBeStoppedError{}+ }++ now := time.Now()+ if err := s.db.WithContext(ctx).Model(&models.Project{}).Where("id = ?", projectID).Updates(map[string]any{+ "is_archived": true,+ "archived_at": now,+ }).Error; err != nil {+ return fmt.Errorf("failed to archive project: %w", err)+ }++ metadata := models.JSON{"action": "archived", "projectID": projectID, "projectName": proj.Name}+ if s.eventService != nil {+ if logErr := s.eventService.LogProjectEvent(ctx, models.EventTypeProjectUpdate, projectID, proj.Name, user.ID, user.Username, "0", metadata); logErr != nil {+ slog.ErrorContext(ctx, "could not log project archive action", "error", logErr)+ }+ }++ return nil+}++func (s *ProjectService) UnarchiveProject(ctx context.Context, projectID string, user models.User) error {+ proj, err := s.GetProjectFromDatabaseByID(ctx, projectID)+ if err != nil {+ return err+ }+ if !proj.IsArchived {+ return nil+ }++ if err := s.db.WithContext(ctx).Model(&models.Project{}).Where("id = ?", projectID).Updates(map[string]any{+ "is_archived": false,+ "archived_at": gorm.Expr("NULL"),+ }).Error; err != nil {+ return fmt.Errorf("failed to unarchive project: %w", err)+ }++ metadata := models.JSON{"action": "unarchived", "projectID": projectID, "projectName": proj.Name}+ if s.eventService != nil {+ if logErr := s.eventService.LogProjectEvent(ctx, models.EventTypeProjectUpdate, projectID, proj.Name, user.ID, user.Username, "0", metadata); logErr != nil {+ slog.ErrorContext(ctx, "could not log project unarchive action", "error", logErr)+ }+ }++ return nil+}+func (s *ProjectService) DeployProject(ctx context.Context, projectID string, user models.User, options *project.DeployOptions) error {projectFromDb, err := s.GetProjectFromDatabaseByID(ctx, projectID)if err != nil {return fmt.Errorf("failed to get project: %w", err)}+ if err := ensureProjectMutableInternal(projectFromDb); err != nil {+ return err+ }resolvedPullPolicy := ""forceRecreate := false@@ -1574,6 +1667,9 @@ func (s *ProjectService) DownProject(ctx context.Context, projectID string, userif err != nil {return err}+ if err := ensureProjectMutableInternal(projectFromDb); err != nil {+ return err+ }proj, _, lerr := s.loadComposeProjectForProjectInternal(ctx, projectFromDb)if lerr != nil {@@ -1702,6 +1798,9 @@ func (s *ProjectService) RedeployProject(ctx context.Context, projectID string,if err != nil {return err}+ if err := ensureProjectMutableInternal(proj); err != nil {+ return err+ }disabled, err := s.projectRedeployDisabledInternal(ctx, *proj)if err != nil {@@ -1753,6 +1852,9 @@ func (s *ProjectService) PullProjectImages(ctx context.Context, projectID stringif err != nil {return err}+ if err := ensureProjectMutableInternal(proj); err != nil {+ return err+ }compProj, _, lerr := s.loadComposeProjectForProjectInternal(ctx, proj)if lerr != nil {@@ -1784,6 +1886,9 @@ func (s *ProjectService) BuildProjectServices(ctx context.Context, projectID strif err != nil {return err}+ if err := ensureProjectMutableInternal(projectFromDb); err != nil {+ return err+ }project, _, derr := s.loadComposeProjectForProjectInternal(ctx, projectFromDb)if derr != nil {@@ -1803,6 +1908,9 @@ func (s *ProjectService) EnsureProjectImagesPresent(ctx context.Context, projectif err != nil {return err}+ if err := ensureProjectMutableInternal(proj); err != nil {+ return err+ }compProj, _, lerr := s.loadComposeProjectForProjectInternal(ctx, proj)if lerr != nil {@@ -2391,6 +2499,9 @@ func (s *ProjectService) RestartProject(ctx context.Context, projectID string, uif err != nil {return err}+ if err := ensureProjectMutableInternal(proj); err != nil {+ return err+ }if err := s.updateProjectStatusInternal(ctx, projectID, models.ProjectStatusRestarting); err != nil {return fmt.Errorf("failed to update project status to restarting: %w", err)@@ -2437,6 +2548,9 @@ func (s *ProjectService) UpdateProject(ctx context.Context, projectID string, naif err != nil {return nil, err}+ if err := ensureProjectMutableInternal(&proj); err != nil {+ return nil, err+ }if err := s.withProjectRenameRollback(ctx, &proj, func() error {if err := s.applyProjectRenameIfNeeded(&proj, name, projectsDirectory); err != nil {@@ -2485,6 +2599,9 @@ func (s *ProjectService) ApplyGitSyncProjectFiles(ctx context.Context, projectIDif err != nil {return nil, err}+ if err := ensureProjectMutableInternal(&proj); err != nil {+ return nil, err+ }envUpdate, err := s.prepareGitSyncEnvUpdateInternal(proj.Path, gitEnvContent)if err != nil {@@ -3082,6 +3199,9 @@ func (s *ProjectService) UpdateProjectIncludeFile(ctx context.Context, projectIDif err != nil {return err}+ if err := ensureProjectMutableInternal(proj); err != nil {+ return err+ }// Normalize and persist project path to ensure include writes occur under projects rootif err := s.ensureProjectPathUnderRoot(ctx, proj, true); err != nil {@@ -3204,10 +3324,13 @@ func (s *ProjectService) ListProjects(ctx context.Context, params pagination.Quequery := s.db.WithContext(ctx).Model(&models.Project{})statusFilter := ""updatesFilter := ""+ archivedFilter := ""if params.Filters != nil {statusFilter = strings.TrimSpace(params.Filters["status"])updatesFilter = strings.TrimSpace(params.Filters["updates"])+ archivedFilter = strings.TrimSpace(params.Filters["archived"])}+ query = applyProjectArchivedDBFilterInternal(query, archivedFilter)if statusFilter != "" || updatesFilter != "" {return s.listProjectsWithDerivedFiltersInternal(ctx, params, query)}@@ -3241,6 +3364,17 @@ func (s *ProjectService) ListProjects(ctx context.Context, params pagination.Quereturn result, paginationResp, nil}+func applyProjectArchivedDBFilterInternal(query *gorm.DB, filterValue string) *gorm.DB {+ switch strings.ToLower(strings.TrimSpace(filterValue)) {+ case "true":+ return query.Where("is_archived = ?", true)+ case "all":+ return query+ default:+ return query.Where("is_archived = ?", false)+ }+}+func (s *ProjectService) listProjectsWithDerivedFiltersInternal(ctx context.Context,params pagination.QueryParams,@@ -3351,6 +3485,7 @@ func (s *ProjectService) buildProjectDerivedPaginationConfigInternal() paginatioFilterAccessors: []pagination.FilterAccessor[project.Details]{s.buildProjectStatusFilterAccessorInternal(),s.buildProjectUpdatesFilterAccessorInternal(),+ s.buildProjectArchivedFilterAccessorInternal(),},}}@@ -3373,6 +3508,22 @@ func (s *ProjectService) buildProjectUpdatesFilterAccessorInternal() pagination.}}+func (s *ProjectService) buildProjectArchivedFilterAccessorInternal() pagination.FilterAccessor[project.Details] {+ return pagination.FilterAccessor[project.Details]{+ Key: "archived",+ Fn: func(p project.Details, filterValue string) bool {+ switch strings.ToLower(strings.TrimSpace(filterValue)) {+ case "true":+ return p.IsArchived+ case "all":+ return true+ default:+ return !p.IsArchived+ }+ },+ }+}+func getProjectUpdateStatusInternal(updateInfo *project.UpdateInfo) string {if updateInfo == nil || strings.TrimSpace(updateInfo.Status) == "" {return "unknown"@@ -3394,7 +3545,7 @@ func (s *ProjectService) countProjectsByUpdateStatusInternal(ctx context.ContextStart: 0,Limit: 0,},- }, s.db.WithContext(ctx).Model(&models.Project{}))+ }, s.db.WithContext(ctx).Model(&models.Project{}).Where("is_archived = ?", false))if err != nil {return 0, err}@@ -3456,6 +3607,8 @@ func (s *ProjectService) mapProjectToDto(ctx context.Context, projectsDir stringresp.CreatedAt = p.CreatedAt.Format(time.RFC3339)resp.UpdatedAt = p.UpdatedAt.Format(time.RFC3339)+ resp.IsArchived = p.IsArchived+ resp.ArchivedAt = p.ArchivedAtresp.DirName = utils.DerefString(p.DirName)resp.RelativePath = s.getProjectRelativePathInternal(projectsDir, p.Path)resp.GitOpsManagedBy = p.GitOpsManagedBydiff --git a/backend/internal/services/project_service_test.go b/backend/internal/services/project_service_test.goindex 6f4e2f302..ee71f9ce3 100644--- a/backend/internal/services/project_service_test.go+++ b/backend/internal/services/project_service_test.go@@ -16,6 +16,7 @@ import ("time"composetypes "github.com/compose-spec/compose-go/v2/types"+ "github.com/getarcaneapp/arcane/backend/internal/common""github.com/getarcaneapp/arcane/backend/internal/config"libupdater "github.com/getarcaneapp/arcane/backend/pkg/libarcane/updater""github.com/getarcaneapp/arcane/backend/pkg/pagination"@@ -2096,6 +2097,134 @@ func TestProjectService_ListProjects_FiltersByUpdateStatus(t *testing.T) {}}+func TestProjectService_ListProjects_FiltersArchivedProjects(t *testing.T) {+ db := setupProjectTestDB(t)+ ctx := context.Background()++ settingsService, err := NewSettingsService(ctx, db)+ require.NoError(t, err)+ projectsRoot := t.TempDir()+ require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot))++ activePath := createComposeProjectDir(t, projectsRoot, "active-demo")+ archivedPath := createComposeProjectDir(t, projectsRoot, "archived-demo")+ archivedAt := time.Now().UTC()++ require.NoError(t, db.Create(&models.Project{+ BaseModel: models.BaseModel{ID: "project-active"},+ Name: "active-demo",+ DirName: ptr("active-demo"),+ Path: activePath,+ Status: models.ProjectStatusStopped,+ }).Error)+ require.NoError(t, db.Create(&models.Project{+ BaseModel: models.BaseModel{ID: "project-archived"},+ Name: "archived-demo",+ DirName: ptr("archived-demo"),+ Path: archivedPath,+ Status: models.ProjectStatusStopped,+ IsArchived: true,+ ArchivedAt: &archivedAt,+ }).Error)++ svc := NewProjectService(db, settingsService, nil, nil, nil, nil, config.Load())++ items, page, err := svc.ListProjects(ctx, pagination.QueryParams{+ PaginationParams: pagination.PaginationParams{Limit: -1},+ SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},+ })+ require.NoError(t, err)+ require.EqualValues(t, 1, page.TotalItems)+ require.Len(t, items, 1)+ assert.Equal(t, "active-demo", items[0].Name)++ items, page, err = svc.ListProjects(ctx, pagination.QueryParams{+ Filters: map[string]string{"archived": "true"},+ PaginationParams: pagination.PaginationParams{Limit: -1},+ SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},+ })+ require.NoError(t, err)+ require.EqualValues(t, 1, page.TotalItems)+ require.Len(t, items, 1)+ assert.Equal(t, "archived-demo", items[0].Name)+ assert.True(t, items[0].IsArchived)++ items, page, err = svc.ListProjects(ctx, pagination.QueryParams{+ Filters: map[string]string{"archived": "all"},+ PaginationParams: pagination.PaginationParams{Limit: -1},+ SortParams: pagination.SortParams{Sort: "name", Order: pagination.SortAsc},+ })+ require.NoError(t, err)+ require.EqualValues(t, 2, page.TotalItems)+ require.Len(t, items, 2)+ assert.Equal(t, []string{"active-demo", "archived-demo"}, []string{items[0].Name, items[1].Name})+}++func TestProjectService_ArchiveProject_RequiresStoppedProject(t *testing.T) {+ db := setupProjectTestDB(t)+ ctx := context.Background()++ projectsRoot := t.TempDir()+ settingsService, err := NewSettingsService(ctx, db)+ require.NoError(t, err)+ require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot))++ projectPath := createComposeProjectDir(t, projectsRoot, "running-demo")+ require.NoError(t, db.Create(&models.Project{+ BaseModel: models.BaseModel{ID: "project-running"},+ Name: "running-demo",+ DirName: ptr("running-demo"),+ Path: projectPath,+ Status: models.ProjectStatusRunning,+ RunningCount: 1,+ }).Error)++ svc := NewProjectService(db, settingsService, nil, nil, nil, nil, config.Load())+ err = svc.ArchiveProject(ctx, "project-running", models.User{BaseModel: models.BaseModel{ID: "user-1"}, Username: "tester"})+ require.Error(t, err)+ var stoppedErr *common.ProjectMustBeStoppedError+ assert.ErrorAs(t, err, &stoppedErr)++ var stored models.Project+ require.NoError(t, db.First(&stored, "id = ?", "project-running").Error)+ assert.False(t, stored.IsArchived)+ assert.Nil(t, stored.ArchivedAt)+}++func TestProjectService_ArchiveProject_TogglesArchiveFlag(t *testing.T) {+ db := setupProjectTestDB(t)+ ctx := context.Background()++ projectsRoot := t.TempDir()+ settingsService, err := NewSettingsService(ctx, db)+ require.NoError(t, err)+ require.NoError(t, settingsService.SetStringSetting(ctx, "projectsDirectory", projectsRoot))++ projectPath := createComposeProjectDir(t, projectsRoot, "stopped-demo")+ require.NoError(t, db.Create(&models.Project{+ BaseModel: models.BaseModel{ID: "project-stopped"},+ Name: "stopped-demo",+ DirName: ptr("stopped-demo"),+ Path: projectPath,+ Status: models.ProjectStatusStopped,+ }).Error)++ svc := NewProjectService(db, settingsService, nil, nil, nil, nil, config.Load())+ user := models.User{BaseModel: models.BaseModel{ID: "user-1"}, Username: "tester"}++ require.NoError(t, svc.ArchiveProject(ctx, "project-stopped", user))+ var stored models.Project+ require.NoError(t, db.First(&stored, "id = ?", "project-stopped").Error)+ assert.True(t, stored.IsArchived)+ assert.NotNil(t, stored.ArchivedAt)++ require.NoError(t, svc.UnarchiveProject(ctx, "project-stopped", user))+ var unarchived models.Project+ require.NoError(t, db.First(&unarchived, "id = ?", "project-stopped").Error)+ assert.False(t, unarchived.IsArchived)+ assert.Nil(t, unarchived.ArchivedAt)+}+func TestProjectService_MapProjectToDto_SetsRedeployDisabledFromRuntimeServices(t *testing.T) {projectPath := filepath.Join(t.TempDir(), "arcane")now := time.Now()diff --git a/backend/internal/services/updater_service.go b/backend/internal/services/updater_service.goindex dd53b1669..72b3d8cc6 100644--- a/backend/internal/services/updater_service.go+++ b/backend/internal/services/updater_service.go@@ -1106,6 +1106,9 @@ func (s *UpdaterService) collectUsedImagesFromProjects(ctx context.Context, outfunc activeComposeProjectNameSetInternal(projects []models.Project) map[string]struct{} {active := make(map[string]struct{})for _, p := range projects {+ if p.IsArchived {+ continue+ }// consider running and partially running projectsif p.Status != models.ProjectStatusRunning && p.Status != models.ProjectStatusPartiallyRunning {continuediff --git a/backend/internal/services/updater_service_test.go b/backend/internal/services/updater_service_test.goindex bc9bc083d..976c1776a 100644--- a/backend/internal/services/updater_service_test.go+++ b/backend/internal/services/updater_service_test.go@@ -657,6 +657,7 @@ func TestActiveComposeProjectNameSetInternal(t *testing.T) {{Name: "My-App", Status: models.ProjectStatusRunning},{Name: "skip-me", Status: models.ProjectStatusStopped},{Name: "another_app", Status: models.ProjectStatusPartiallyRunning},+ {Name: "archived-app", Status: models.ProjectStatusRunning, IsArchived: true},{Name: "", Status: models.ProjectStatusRunning},}@@ -666,6 +667,7 @@ func TestActiveComposeProjectNameSetInternal(t *testing.T) {assert.Contains(t, got, "my-app")assert.Contains(t, got, "another_app")assert.NotContains(t, got, "skip-me")+ assert.NotContains(t, got, "archived-app")}func TestCollectUsedImagesFromComposeContainersInternal(t *testing.T) {diff --git a/backend/resources/migrations/postgres/050_add_project_archived.down.sql b/backend/resources/migrations/postgres/050_add_project_archived.down.sqlnew file mode 100644index 000000000..bd71b4c9a--- /dev/null+++ b/backend/resources/migrations/postgres/050_add_project_archived.down.sql@@ -0,0 +1,3 @@+DROP INDEX IF EXISTS idx_projects_is_archived;+ALTER TABLE projects DROP COLUMN archived_at;+ALTER TABLE projects DROP COLUMN is_archived;diff --git a/backend/resources/migrations/postgres/050_add_project_archived.up.sql b/backend/resources/migrations/postgres/050_add_project_archived.up.sqlnew file mode 100644index 000000000..db3715479--- /dev/null+++ b/backend/resources/migrations/postgres/050_add_project_archived.up.sql@@ -0,0 +1,3 @@+ALTER TABLE projects ADD COLUMN is_archived BOOLEAN NOT NULL DEFAULT FALSE;+ALTER TABLE projects ADD COLUMN archived_at TIMESTAMP;+CREATE INDEX idx_projects_is_archived ON projects(is_archived);diff --git a/backend/resources/migrations/sqlite/050_add_project_archived.down.sql b/backend/resources/migrations/sqlite/050_add_project_archived.down.sqlnew file mode 100644index 000000000..bd71b4c9a--- /dev/null+++ b/backend/resources/migrations/sqlite/050_add_project_archived.down.sql@@ -0,0 +1,3 @@+DROP INDEX IF EXISTS idx_projects_is_archived;+ALTER TABLE projects DROP COLUMN archived_at;+ALTER TABLE projects DROP COLUMN is_archived;diff --git a/backend/resources/migrations/sqlite/050_add_project_archived.up.sql b/backend/resources/migrations/sqlite/050_add_project_archived.up.sqlnew file mode 100644index 000000000..b98dc887a--- /dev/null+++ b/backend/resources/migrations/sqlite/050_add_project_archived.up.sql@@ -0,0 +1,3 @@+ALTER TABLE projects ADD COLUMN is_archived BOOLEAN NOT NULL DEFAULT 0;+ALTER TABLE projects ADD COLUMN archived_at DATETIME;+CREATE INDEX idx_projects_is_archived ON projects(is_archived);diff --git a/frontend/messages/da.json b/frontend/messages/da.jsonindex 46362f25c..5c2b234fc 100644--- a/frontend/messages/da.json+++ b/frontend/messages/da.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Up ({count})","projects_bulk_down": "Down ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Start {count} Project(s)","projects_bulk_up_confirm_message": "Are you sure you want to start {count} project(s)?","projects_bulk_down_confirm_title": "Stop {count} Project(s)",diff --git a/frontend/messages/de.json b/frontend/messages/de.jsonindex 0c67ca338..cf951b7c5 100644--- a/frontend/messages/de.json+++ b/frontend/messages/de.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Projekt konnte nicht entfernt werden","compose_destroy_success": "Projekt erfolgreich entfernt.","compose_destroy": "Zerstören",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Hoch ({count})","projects_bulk_down": "Unten ({count})","projects_bulk_redeploy": "Neu deployen ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "{count} Projekt(e) starten","projects_bulk_up_confirm_message": "Möchtest du wirklich {count} Projekt(e) starten?","projects_bulk_down_confirm_title": "{count} Projekt(e) stoppen",diff --git a/frontend/messages/el.json b/frontend/messages/el.jsonindex 9b11c76ea..38d4df756 100644--- a/frontend/messages/el.json+++ b/frontend/messages/el.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Up ({count})","projects_bulk_down": "Κάτω ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Έναρξη {count} Project(s)","projects_bulk_up_confirm_message": "Είστε σίγουροι ότι θέλετε να ξεκινήσετε έργο {count}?","projects_bulk_down_confirm_title": "Stop {count} Έργο(-α)",diff --git a/frontend/messages/en.json b/frontend/messages/en.jsonindex 5cb5d457a..762892d52 100644--- a/frontend/messages/en.json+++ b/frontend/messages/en.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Up ({count})","projects_bulk_down": "Down ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Start {count} Project(s)","projects_bulk_up_confirm_message": "Are you sure you want to start {count} project(s)?","projects_bulk_down_confirm_title": "Stop {count} Project(s)",diff --git a/frontend/messages/eo.json b/frontend/messages/eo.jsonindex f974e10fc..cadeb7baa 100644--- a/frontend/messages/eo.json+++ b/frontend/messages/eo.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Malsukcesis forigi projekton","compose_destroy_success": "Projekto estis sukcese forigita.","compose_destroy": "Nuligi",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Startigi ({count})","projects_bulk_down": "Haltigi ({count})","projects_bulk_redeploy": "Redeploji ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Startigi {count} projekto(j)n","projects_bulk_up_confirm_message": "Ĉu vi certas, ke vi volas startigi {count} projekto(j)n?","projects_bulk_down_confirm_title": "Haltigi {count} projekto(j)n",diff --git a/frontend/messages/es.json b/frontend/messages/es.jsonindex bf296bdd4..46237cd8d 100644--- a/frontend/messages/es.json+++ b/frontend/messages/es.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Error al eliminar el proyecto","compose_destroy_success": "Proyecto eliminado con éxito.","compose_destroy": "Destruir",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Arriba ({count})","projects_bulk_down": "Abajo ({count})","projects_bulk_redeploy": "Rediseñar ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Inicio {count} Proyecto(s)","projects_bulk_up_confirm_message": "¿Está seguro de que desea iniciar {count} proyecto(s)?","projects_bulk_down_confirm_title": "Stop {count} Proyecto(s)",diff --git a/frontend/messages/fr.json b/frontend/messages/fr.jsonindex bc9af6cc5..deb05430b 100644--- a/frontend/messages/fr.json+++ b/frontend/messages/fr.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Haut ({count})","projects_bulk_down": "Bas ({count})","projects_bulk_redeploy": "Redéploiement ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Démarrer {count} projet(s)","projects_bulk_up_confirm_message": "Voulez-vous vraiment démarrer {count} projet(s) ?","projects_bulk_down_confirm_title": "Arrêter {count} projet(s)",diff --git a/frontend/messages/hu.json b/frontend/messages/hu.jsonindex 834c9b1b5..52b0e5888 100644--- a/frontend/messages/hu.json+++ b/frontend/messages/hu.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Up ({count})","projects_bulk_down": "Down ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Start {count} Project(s)","projects_bulk_up_confirm_message": "Are you sure you want to start {count} project(s)?","projects_bulk_down_confirm_title": "Stop {count} Project(s)",diff --git a/frontend/messages/it.json b/frontend/messages/it.jsonindex c3863f813..cbdac57a2 100644--- a/frontend/messages/it.json+++ b/frontend/messages/it.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Distruggi",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Su ({count})","projects_bulk_down": "Giù ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Avvia Progetti {count}","projects_bulk_up_confirm_message": "Sei sicuro di voler avviare i progetti {count}?","projects_bulk_down_confirm_title": "Ferma {count} Progetto(i)",diff --git a/frontend/messages/ja.json b/frontend/messages/ja.jsonindex a3eb1e489..ad6e16a5a 100644--- a/frontend/messages/ja.json+++ b/frontend/messages/ja.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "上 ({count})","projects_bulk_down": "下 ({count})","projects_bulk_redeploy": "再定義 ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "{count} プロジェクトを開始","projects_bulk_up_confirm_message": "{count} プロジェクトを開始してもよろしいですか?","projects_bulk_down_confirm_title": "{count} プロジェクトを停止",diff --git a/frontend/messages/ko.json b/frontend/messages/ko.jsonindex 4f3a0086d..3f2c54791 100644--- a/frontend/messages/ko.json+++ b/frontend/messages/ko.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "프로젝트 제거 실패","compose_destroy_success": "프로젝트 제거 완료.","compose_destroy": "파기(Destroy)",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "시작 (Up) ({count})","projects_bulk_down": "종료 (Down) ({count})","projects_bulk_redeploy": "재배포 ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "{count}개 프로젝트 시작","projects_bulk_up_confirm_message": "{count}개의 프로젝트를 시작하시겠습니까?","projects_bulk_down_confirm_title": "{count}개 프로젝트 중지",diff --git a/frontend/messages/nl.json b/frontend/messages/nl.jsonindex 93a119c56..3d9fcd164 100644--- a/frontend/messages/nl.json+++ b/frontend/messages/nl.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Kan project niet verwijderen","compose_destroy_success": "Project succesvol verwijderd.","compose_destroy": "Vernietig",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Omhoog ({count})","projects_bulk_down": "Gestopt ({count})","projects_bulk_redeploy": "Herimplementeren ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "{count} project(en) starten","projects_bulk_up_confirm_message": "Weet u zeker dat u {count} project(en) wilt starten?","projects_bulk_down_confirm_title": "Stop {count} Project(en)",diff --git a/frontend/messages/pt-BR.json b/frontend/messages/pt-BR.jsonindex 12e745eb5..792bd3709 100644--- a/frontend/messages/pt-BR.json+++ b/frontend/messages/pt-BR.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Falha ao remover o projeto","compose_destroy_success": "Projeto removido com sucesso.","compose_destroy": "Destruir",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Acima ({count})","projects_bulk_down": "Abaixo ({count})","projects_bulk_redeploy": "Reimplantar ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Iniciar Projeto {count}","projects_bulk_up_confirm_message": "Tem certeza que deseja iniciar {count} projeto(s)?","projects_bulk_down_confirm_title": "Parar Projeto {count}",diff --git a/frontend/messages/pt.json b/frontend/messages/pt.jsonindex a108df104..314982c65 100644--- a/frontend/messages/pt.json+++ b/frontend/messages/pt.json@@ -611,6 +611,22 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","compose_converter_title": "Docker Run to Compose Converter","compose_converter_description": "Convert existing docker run commands to Docker Compose format","compose_docker_run_command_label": "Docker Run Command",diff --git a/frontend/messages/ru.json b/frontend/messages/ru.jsonindex 4a6bb5bb2..21451ae9f 100644--- a/frontend/messages/ru.json+++ b/frontend/messages/ru.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Не удалось удалить проект","compose_destroy_success": "Проект успешно удалён.","compose_destroy": "Уничтожить",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Вверх ({count})","projects_bulk_down": "Вниз ({count})","projects_bulk_redeploy": "Повторная загрузка ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Запустить проект {count}","projects_bulk_up_confirm_message": "Вы уверены, что хотите запустить проект {count} (проекты)?","projects_bulk_down_confirm_title": "Остановить проект {count}",diff --git a/frontend/messages/sv.json b/frontend/messages/sv.jsonindex ad64a7f04..7bfcef1eb 100644--- a/frontend/messages/sv.json+++ b/frontend/messages/sv.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Upp ({count})","projects_bulk_down": "Ner ({count})","projects_bulk_redeploy": "Omplacera ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Starta {count} projekt","projects_bulk_up_confirm_message": "Är du säker på att du vill starta {count} projekt","projects_bulk_down_confirm_title": "Stoppa {count} Projekt",diff --git a/frontend/messages/uk.json b/frontend/messages/uk.jsonindex 8d95b26b1..911a95fba 100644--- a/frontend/messages/uk.json+++ b/frontend/messages/uk.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Failed to remove project","compose_destroy_success": "Project removed successfully.","compose_destroy": "Destroy",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Up ({count})","projects_bulk_down": "Down ({count})","projects_bulk_redeploy": "Redeploy ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Start {count} Project(s)","projects_bulk_up_confirm_message": "Are you sure you want to start {count} project(s)?","projects_bulk_down_confirm_title": "Stop {count} Project(s)",diff --git a/frontend/messages/vi.json b/frontend/messages/vi.jsonindex 5b0313d9b..8edbddf43 100644--- a/frontend/messages/vi.json+++ b/frontend/messages/vi.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "Gỡ bỏ Project thất bại","compose_destroy_success": "Project đã được gỡ bỏ thành công.","compose_destroy": "Hủy bỏ (Destroy)",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "Lên ({count})","projects_bulk_down": "Xuống ({count})","projects_bulk_redeploy": "Tái triển khai ({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "Bắt đầu Dự án {count}","projects_bulk_up_confirm_message": "Bạn có chắc chắn muốn bắt đầu dự án (các dự án) {count} không?","projects_bulk_down_confirm_title": "Dừng dự án {count}",diff --git a/frontend/messages/zh-CN.json b/frontend/messages/zh-CN.jsonindex ad52b10ef..724040892 100644--- a/frontend/messages/zh-CN.json+++ b/frontend/messages/zh-CN.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "删除项目失败","compose_destroy_success": "成功删除项目。","compose_destroy": "销毁",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "启动({count})","projects_bulk_down": "停止({count})","projects_bulk_redeploy": "重新部署({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "启动 {count} 个项目","projects_bulk_up_confirm_message": "确定要启动 {count} 个项目吗?","projects_bulk_down_confirm_title": "停止 {count} 个项目",diff --git a/frontend/messages/zh-TW.json b/frontend/messages/zh-TW.jsonindex 6445eaa1f..cdf4bfda1 100644--- a/frontend/messages/zh-TW.json+++ b/frontend/messages/zh-TW.json@@ -1153,9 +1153,25 @@"compose_destroy_failed": "移除專案時失敗","compose_destroy_success": "專案移除成功。","compose_destroy": "銷毀",+ "compose_archive_success": "Project archived successfully.",+ "compose_archive_failed": "Failed to archive project",+ "compose_unarchive_success": "Project unarchived successfully.",+ "compose_unarchive_failed": "Failed to unarchive project",+ "projects_archive": "Archive",+ "projects_unarchive": "Unarchive",+ "projects_show_archived": "Show archived",+ "projects_archived_badge": "Archived",+ "projects_archived_count": "Archived Projects",+ "projects_archive_requires_stopped": "Stop the project first",+ "projects_archive_edit_blocked": "Unarchive the project before making changes.","projects_bulk_up": "已啟動({count})","projects_bulk_down": "已停止({count})","projects_bulk_redeploy": "重新部署({count})",+ "projects_bulk_archive": "Archive ({count})",+ "projects_bulk_archive_confirm_title": "Archive {count} Project(s)",+ "projects_bulk_archive_confirm_message": "Are you sure you want to archive {count} project(s)? Archived projects must already be stopped.",+ "projects_bulk_archive_success": "Successfully archived {count} project(s)",+ "projects_bulk_archive_partial": "Archived {success} of {total} project(s). {failed} failed.","projects_bulk_up_confirm_title": "啟動 {count} 個專案","projects_bulk_up_confirm_message": "確定要啟動 {count} 個專案?","projects_bulk_down_confirm_title": "停止 {count} 個專案",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.tsindex f26f8c8a2..96faa8f58 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@@ -121,7 +121,7 @@ export function buildMobileVisibility(fields: FieldSpec[], persisted?: string[])export type BulkAction = {id: string;label: string;- action: 'start' | 'stop' | 'restart' | 'remove' | 'deploy' | 'redeploy' | 'up' | 'down';+ action: 'base' | 'start' | 'stop' | 'restart' | 'remove' | 'deploy' | 'redeploy' | 'up' | 'down';onClick: (ids: string[]) => void;disabled?: boolean;disabledReason?: string;diff --git a/frontend/src/lib/components/project-update-item.svelte b/frontend/src/lib/components/project-update-item.svelteindex b851906ce..e963ea0fe 100644--- a/frontend/src/lib/components/project-update-item.svelte+++ b/frontend/src/lib/components/project-update-item.svelte@@ -13,9 +13,10 @@class?: string;onCheck?: () => void | Promise<void>;checking?: boolean;+ disabled?: boolean;}- let { updateInfo, class: className = '', onCheck, checking = false }: Props = $props();+ let { updateInfo, class: className = '', onCheck, checking = false, disabled = false }: Props = $props();let isOpen = $state(false);const status = $derived(getProjectUpdateStatus(updateInfo));@@ -26,7 +27,7 @@const errorMessage = $derived(updateInfo?.errorMessage?.trim() || '');const imageRefs = $derived(updateInfo?.imageRefs ?? []);const updatedImageRefs = $derived(updateInfo?.updatedImageRefs ?? []);- const canCheck = $derived(!!onCheck && imageRefs.length > 0);+ const canCheck = $derived(!!onCheck && !disabled && imageRefs.length > 0);const directCheckFromTrigger = $derived(canCheck && (status === 'unknown' || status === 'error'));const summaryText = $derived.by(() => {@@ -109,7 +110,7 @@async function handleCheckClick(event?: MouseEvent) {event?.preventDefault();event?.stopPropagation();- if (!canCheck || checking) {+ if (!canCheck || checking || disabled) {return;}diff --git a/frontend/src/lib/services/project-service.ts b/frontend/src/lib/services/project-service.tsindex 21ebb9aba..df32f0bff 100644--- a/frontend/src/lib/services/project-service.ts+++ b/frontend/src/lib/services/project-service.ts@@ -158,9 +158,19 @@ export class ProjectService extends BaseAPIService {return this.handleResponse(this.api.put(`/environments/${envId}/projects/${projectId}/includes`, payload));}- async restartProject(projectId: string): Promise<Project> {+ async restartProject(projectId: string): Promise<void> {const envId = await environmentStore.getCurrentEnvironmentId();- return this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectId}/restart`));+ await this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectId}/restart`));+ }++ async archiveProject(projectId: string): Promise<void> {+ const envId = await environmentStore.getCurrentEnvironmentId();+ await this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectId}/archive`));+ }++ async unarchiveProject(projectId: string): Promise<void> {+ const envId = await environmentStore.getCurrentEnvironmentId();+ await this.handleResponse(this.api.post(`/environments/${envId}/projects/${projectId}/unarchive`));}async redeployProject(projectName: string): Promise<Project> {diff --git a/frontend/src/lib/types/project.type.ts b/frontend/src/lib/types/project.type.tsindex ef53c1a02..b8908ee59 100644--- a/frontend/src/lib/types/project.type.ts+++ b/frontend/src/lib/types/project.type.ts@@ -81,6 +81,8 @@ export interface Project {statusReason?: string;updatedAt: string;createdAt: string;+ isArchived?: boolean;+ archivedAt?: string;gitOpsManagedBy?: string;lastSyncCommit?: string;gitRepositoryURL?: string;@@ -100,4 +102,5 @@ export interface ProjectStatusCounts {runningProjects: number;stoppedProjects: number;totalProjects: number;+ archivedProjects: number;}diff --git a/frontend/src/routes/(app)/projects/+page.svelte b/frontend/src/routes/(app)/projects/+page.svelteindex 35f6fbac6..0bea9b369 100644--- a/frontend/src/routes/(app)/projects/+page.svelte+++ b/frontend/src/routes/(app)/projects/+page.svelte@@ -1,13 +1,15 @@<script lang="ts">- import { ProjectsIcon, StartIcon, StopIcon } from '$lib/icons';+ import { BoxIcon, ProjectsIcon, StartIcon, StopIcon } from '$lib/icons';import { toast } from 'svelte-sonner';import ProjectsTable from './projects-table.svelte';import { goto } from '$app/navigation';+ import { page } from '$app/state';import { m } from '$lib/paraglide/messages';import { projectService } from '$lib/services/project-service';import { imageService } from '$lib/services/image-service';import { environmentStore } from '$lib/stores/environment.store.svelte';import { queryKeys } from '$lib/query/query-keys';+ import type { SearchPaginationSortRequest } from '$lib/types/pagination.type';import type { ProjectStatusCounts } from '$lib/types/project.type';import { untrack } from 'svelte';import { createMutation, createQuery } from '@tanstack/svelte-query';@@ -15,14 +17,30 @@let { data } = $props();- let projects = $state(untrack(() => data.projects));- let projectRequestOptions = $state(untrack(() => data.projectRequestOptions));+ function withArchivedFilter(options: SearchPaginationSortRequest, show: boolean): SearchPaginationSortRequest {+ const filters = { ...(options.filters ?? {}) };+ if (show) {+ filters.archived = 'true';+ } else {+ delete filters.archived;+ }++ return {+ ...options,+ filters: Object.keys(filters).length > 0 ? filters : undefined+ };+ }++ let baseProjectRequestOptions = $state(untrack(() => withArchivedFilter(data.projectRequestOptions, data.showArchived)));let selectedIds = $state<string[]>([]);const envId = $derived(environmentStore.selected?.id || '0');+ const showArchived = $derived(page.url.searchParams.get('archived') === 'true');+ const projectRequestOptions = $derived(withArchivedFilter(baseProjectRequestOptions, showArchived));const countsFallback: ProjectStatusCounts = {runningProjects: 0,stoppedProjects: 0,- totalProjects: 0+ totalProjects: 0,+ archivedProjects: 0};const projectsQuery = createQuery(() => ({@@ -31,6 +49,7 @@initialData: data.projects,refetchOnMount: false}));+ let projects = $derived(projectsQuery.data ?? untrack(() => data.projects));const projectStatusCountsQuery = createQuery(() => ({queryKey: queryKeys.projects.statusCounts(envId),@@ -96,16 +115,11 @@}}));- $effect(() => {- if (projectsQuery.data) {- projects = projectsQuery.data;- }- });-const projectStatusCounts = $derived(projectStatusCountsQuery.data ?? countsFallback);const totalCompose = $derived(projectStatusCounts.totalProjects);const runningCompose = $derived(projectStatusCounts.runningProjects);const stoppedCompose = $derived(projectStatusCounts.stoppedProjects);+ const archivedCompose = $derived(projectStatusCounts.archivedProjects);let isManualRefreshing = $state(false);const isProjectsQueryRefreshing = $derived(projectsQuery.isFetching && !projectsQuery.isPending);const isStatusCountsQueryRefreshing = $derived(projectStatusCountsQuery.isFetching && !projectStatusCountsQuery.isPending);@@ -126,6 +140,16 @@}}+ async function toggleArchived(next: boolean) {+ const url = new URL(page.url);+ if (next) {+ url.searchParams.set('archived', 'true');+ } else {+ url.searchParams.delete('archived');+ }+ await goto(`${url.pathname}${url.search}`, { keepFocus: true, replaceState: true, noScroll: true });+ }+const actionButtons: ActionButton[] = $derived([{id: 'create',@@ -169,6 +193,12 @@value: stoppedCompose,icon: StopIcon,iconColor: 'text-red-500'+ },+ {+ title: m.projects_archived_count(),+ value: archivedCompose,+ icon: BoxIcon,+ iconColor: 'text-muted-foreground'}]);</script>@@ -176,11 +206,13 @@<ResourcePageLayout title={m.projects_title()} subtitle={m.compose_subtitle()} {actionButtons} {statCards}>{#snippet mainContent()}<ProjectsTable- bind:projects+ {projects}bind:selectedIds- bind:requestOptions={projectRequestOptions}+ requestOptions={projectRequestOptions}+ {showArchived}+ onToggleArchived={toggleArchived}onRefreshData={async (options) => {- projectRequestOptions = options;+ baseProjectRequestOptions = withArchivedFilter(options, showArchived);await Promise.all([projectsQuery.refetch(), projectStatusCountsQuery.refetch()]);}}/>diff --git a/frontend/src/routes/(app)/projects/+page.ts b/frontend/src/routes/(app)/projects/+page.tsindex 864f8e0c9..bf4cbbaec 100644--- a/frontend/src/routes/(app)/projects/+page.ts+++ b/frontend/src/routes/(app)/projects/+page.ts@@ -6,9 +6,10 @@ import { throwPageLoadError } from '$lib/utils/page-load-error.util';import type { PageLoad } from './$types';import { environmentStore } from '$lib/stores/environment.store.svelte';-export const load: PageLoad = async ({ parent }) => {+export const load: PageLoad = async ({ parent, url }) => {const { queryClient } = await parent();const envId = await environmentStore.getCurrentEnvironmentId();+ const showArchived = url.searchParams.get('archived') === 'true';const projectRequestOptions = resolveInitialTableRequest('arcane-project-table', {pagination: {@@ -20,6 +21,13 @@ export const load: PageLoad = async ({ parent }) => {direction: 'asc'}} satisfies SearchPaginationSortRequest);+ const filters = { ...(projectRequestOptions.filters ?? {}) };+ if (showArchived) {+ filters.archived = 'true';+ } else {+ delete filters.archived;+ }+ projectRequestOptions.filters = Object.keys(filters).length ? filters : undefined;let projects;let projectStatusCounts;@@ -38,5 +46,5 @@ export const load: PageLoad = async ({ parent }) => {throwPageLoadError(err, 'Failed to load projects');}- return { projects, projectRequestOptions, projectStatusCounts };+ return { projects, projectRequestOptions, projectStatusCounts, showArchived };};diff --git a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte b/frontend/src/routes/(app)/projects/[projectId]/+page.svelteindex e3377474a..fe95ffc78 100644--- a/frontend/src/routes/(app)/projects/[projectId]/+page.svelte+++ b/frontend/src/routes/(app)/projects/[projectId]/+page.svelte@@ -5,7 +5,7 @@import * as Card from '$lib/components/ui/card';import * as Alert from '$lib/components/ui/alert/index.js';import { ArcaneButton } from '$lib/components/arcane-button/index.js';- import { ArrowLeftIcon, ProjectsIcon, LayersIcon, SettingsIcon, FileTextIcon, AlertIcon, GlobeIcon } from '$lib/icons';+ import { ArrowLeftIcon, BoxIcon, ProjectsIcon, LayersIcon, SettingsIcon, FileTextIcon, AlertIcon, GlobeIcon } from '$lib/icons';import { type TabItem } from '$lib/components/tab-bar/index.js';import TabbedPageLayout from '$lib/layouts/tabbed-page-layout.svelte';import ActionButtons from '$lib/components/action-buttons.svelte';@@ -56,7 +56,8 @@destroying: false,pulling: false,saving: false,- syncing: false+ syncing: false,+ archiving: false});const envId = $derived(environmentStore.selected?.id || '0');@@ -132,11 +133,24 @@let isGitOpsManaged = $derived(!!project?.gitOpsManagedBy);let hasBuildDirective = $derived(!!project?.hasBuildDirective);let canEditName = $derived(- !isGitOpsManaged && !isLoading.saving && project?.status !== 'running' && project?.status !== 'partially running'+ !project?.isArchived &&+ !isGitOpsManaged &&+ !isLoading.saving &&+ project?.status !== 'running' &&+ project?.status !== 'partially running');- let canEditCompose = $derived(!isGitOpsManaged);- let canEditEnv = true;+ let canEditCompose = $derived(!project?.isArchived && !isGitOpsManaged);+ let canEditEnv = $derived(!project?.isArchived);let composeFileName = $derived(project?.composeFileName || 'compose.yaml');+ let archiveRequiresStopped = $derived(+ !!project &&+ !project.isArchived &&+ (Number(project.runningCount) > 0 ||+ project.status === 'running' ||+ project.status === 'partially running' ||+ project.status === 'deploying' ||+ project.status === 'restarting')+ );let autoScrollStackLogs = $state(true);@@ -188,7 +202,7 @@));- let canSave = $derived(hasChanges && !hasAnyErrors);+ let canSave = $derived(!project?.isArchived && hasChanges && !hasAnyErrors);const tabItems = $derived<TabItem[]>([{@@ -355,6 +369,10 @@async function handleSaveChanges() {if (!project || !hasChanges) return;+ if (project.isArchived) {+ toast.error(m.projects_archive_edit_blocked());+ return;+ }if (hasAnyErrors) {toast.error(m.templates_validation_error());return;@@ -409,12 +427,44 @@}function saveNameIfChanged() {+ if (project?.isArchived) return;if ($inputs.name.value === serverName) return;const validated = form.validate();if (!validated) return;handleSaveChanges();}+ async function handleArchiveToggle() {+ if (!project) return;+ const archiving = !project.isArchived;+ if (archiving && archiveRequiresStopped) {+ toast.error(m.projects_archive_requires_stopped());+ return;+ }++ isLoading.archiving = true;+ try {+ const result = await tryCatch(+ archiving ? projectService.archiveProject(project.id) : projectService.unarchiveProject(project.id)+ );+ await handleApiResultWithCallbacks({+ result,+ message: archiving ? m.compose_archive_failed() : m.compose_unarchive_failed(),+ onSuccess: async () => {+ toast.success(archiving ? m.compose_archive_success() : m.compose_unarchive_success());+ await refreshProjectDetails();+ const currentEnvId = envId ?? (await environmentStore.getCurrentEnvironmentId());+ await Promise.all([+ queryClient.invalidateQueries({ queryKey: ['projects', currentEnvId] }),+ queryClient.invalidateQueries({ queryKey: queryKeys.projects.statusCounts(currentEnvId) })+ ]);+ }+ });+ } finally {+ isLoading.archiving = false;+ }+ }+function persistPrefs() {if (!prefs) return;prefs.current = {@@ -632,10 +682,14 @@tooltip={showTooltip ? project.statusReason : undefined}/>{/if}+ {#if project.isArchived}+ <StatusBadge variant="gray" text={m.projects_archived_badge()} />+ {/if}<ProjectUpdateItemupdateInfo={project.updateInfo}onCheck={handleCheckProjectUpdates}checking={checkProjectUpdatesMutation.isPending}+ disabled={!!project.isArchived}/>{#if project.urls && project.urls.length > 0}<div class="flex min-w-0 flex-wrap items-center gap-2">@@ -706,6 +760,28 @@class="xl:hidden"/>{/if}+ <ArcaneButton+ action="base"+ icon={BoxIcon}+ loading={isLoading.archiving}+ onclick={handleArchiveToggle}+ disabled={archiveRequiresStopped}+ title={archiveRequiresStopped ? m.projects_archive_requires_stopped() : undefined}+ customLabel={project.isArchived ? m.projects_unarchive() : m.projects_archive()}+ class="hidden xl:inline-flex"+ />+ <ArcaneButton+ action="base"+ icon={BoxIcon}+ size="icon"+ showLabel={false}+ loading={isLoading.archiving}+ onclick={handleArchiveToggle}+ disabled={archiveRequiresStopped}+ title={archiveRequiresStopped ? m.projects_archive_requires_stopped() : undefined}+ customLabel={project.isArchived ? m.projects_unarchive() : m.projects_archive()}+ class="xl:hidden"+ /><ActionButtonsid={project.id}name={project.name}diff --git a/frontend/src/routes/(app)/projects/projects-table.actions.ts b/frontend/src/routes/(app)/projects/projects-table.actions.tsindex 024738da9..c5d9649b8 100644--- a/frontend/src/routes/(app)/projects/projects-table.actions.ts+++ b/frontend/src/routes/(app)/projects/projects-table.actions.ts@@ -13,6 +13,7 @@ type BulkLoadingState = {up: boolean;down: boolean;redeploy: boolean;+ archive: boolean;};type ActionDeps = {@@ -24,7 +25,7 @@ type ActionDeps = {getEnvId: () => string | undefined;};-type ProjectActionKind = 'start' | 'stop' | 'restart' | 'redeploy';+type ProjectActionKind = 'start' | 'stop' | 'restart' | 'redeploy' | 'archive' | 'unarchive';type ProjectActionConfig = {status: ActionStatus;@@ -61,6 +62,7 @@ type ProjectActions = {handleBulkUp: (ids: string[]) => Promise<void>;handleBulkDown: (ids: string[]) => Promise<void>;handleBulkRedeploy: (ids: string[]) => Promise<void>;+ handleBulkArchive: (ids: string[]) => Promise<void>;};const projectActionConfigs: Record<ProjectActionKind, ProjectActionConfig> = {@@ -87,6 +89,18 @@ const projectActionConfigs: Record<ProjectActionKind, ProjectActionConfig> = {run: (id) => projectService.redeployProject(id),success: () => m.compose_pull_success(),failure: () => m.compose_pull_failed()+ },+ archive: {+ status: 'archiving',+ run: (id) => projectService.archiveProject(id),+ success: () => m.compose_archive_success(),+ failure: () => m.compose_archive_failed()+ },+ unarchive: {+ status: 'unarchiving',+ run: (id) => projectService.unarchiveProject(id),+ success: () => m.compose_unarchive_success(),+ failure: () => m.compose_unarchive_failed()}};@@ -255,12 +269,26 @@ export function createProjectActions({});}+ async function handleBulkArchive(ids: string[]): Promise<void> {+ await runBulkAction(ids, {+ title: (count) => m.projects_bulk_archive_confirm_title({ count }),+ message: (count) => m.projects_bulk_archive_confirm_message({ count }),+ label: m.projects_archive(),+ loadingKey: 'archive',+ run: (id) => projectService.archiveProject(id),+ success: (count) => m.projects_bulk_archive_success({ count }),+ partial: (success, total, failed) => m.projects_bulk_archive_partial({ success, total, failed }),+ failure: () => m.compose_archive_failed()+ });+ }+return {performProjectAction,handleDestroyProject,handleSyncFromGit,handleBulkUp,handleBulkDown,- handleBulkRedeploy+ handleBulkRedeploy,+ handleBulkArchive};}diff --git a/frontend/src/routes/(app)/projects/projects-table.helpers.ts b/frontend/src/routes/(app)/projects/projects-table.helpers.tsindex f06146441..cdcc1a350 100644--- a/frontend/src/routes/(app)/projects/projects-table.helpers.ts+++ b/frontend/src/routes/(app)/projects/projects-table.helpers.ts@@ -1 +1,10 @@-export type ActionStatus = 'starting' | 'stopping' | 'restarting' | 'redeploying' | 'destroying' | 'syncing' | '';+export type ActionStatus =+ | 'starting'+ | 'stopping'+ | 'restarting'+ | 'redeploying'+ | 'archiving'+ | 'unarchiving'+ | 'destroying'+ | 'syncing'+ | '';diff --git a/frontend/src/routes/(app)/projects/projects-table.svelte b/frontend/src/routes/(app)/projects/projects-table.svelteindex ba38b8586..075805564 100644--- a/frontend/src/routes/(app)/projects/projects-table.svelte+++ b/frontend/src/routes/(app)/projects/projects-table.svelte@@ -3,7 +3,7 @@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 { EditIcon, StartIcon, RestartIcon, StopIcon, TrashIcon, RedeployIcon, EllipsisIcon } from '$lib/icons';+ import { BoxIcon, 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';@@ -23,6 +23,8 @@import type { ActionStatus } from './projects-table.helpers';import { createProjectActions } from './projects-table.actions';import ProjectUpdateItem from '$lib/components/project-update-item.svelte';+ import { Label } from '$lib/components/ui/label';+ import { Switch } from '$lib/components/ui/switch/index.js';import {getProjectUpdateStatus,getProjectUpdateText,@@ -35,12 +37,16 @@selectedIds = $bindable(),requestOptions = $bindable(),withoutFilters = false,+ showArchived = false,+ onToggleArchived,onRefreshData}: {projects: Paginated<Project>;selectedIds: string[];requestOptions: SearchPaginationSortRequest;withoutFilters?: boolean;+ showArchived?: boolean;+ onToggleArchived?: (checked: boolean) => void | Promise<void>;onRefreshData?: (options: SearchPaginationSortRequest) => Promise<void>;} = $props();@@ -50,7 +56,8 @@let isBulkLoading = $state({up: false,down: false,- redeploy: false+ redeploy: false,+ archive: false});async function refreshProjects(options: SearchPaginationSortRequest = requestOptions) {@@ -101,23 +108,38 @@let mobileFieldVisibility = $state<Record<string, boolean>>({});const envId = $derived(environmentStore.selected?.id);- const { performProjectAction, handleDestroyProject, handleSyncFromGit, handleBulkUp, handleBulkDown, handleBulkRedeploy } =- createProjectActions({- getRequestOptions: () => requestOptions,- refreshProjects,- setSelectedIds: (next) => {- selectedIds = next;- },- actionStatus,- isBulkLoading,- getEnvId: () => envId- });+ const {+ performProjectAction,+ handleDestroyProject,+ handleSyncFromGit,+ handleBulkUp,+ handleBulkDown,+ handleBulkRedeploy,+ handleBulkArchive+ } = createProjectActions({+ getRequestOptions: () => requestOptions,+ refreshProjects,+ setSelectedIds: (next) => {+ selectedIds = next;+ },+ actionStatus,+ isBulkLoading,+ getEnvId: () => envId+ });const isAnyLoading = $derived(Object.values(actionStatus).some((status) => status !== '') || Object.values(isBulkLoading).some((loading) => loading));const selectedProjects = $derived.by(() => (projects?.data ?? []).filter((project) => selectedIds?.includes(project.id)));const hasRedeployDisabledSelection = $derived.by(() => selectedProjects.some((project) => project.redeployDisabled));+ const hasArchivedSelection = $derived.by(() => selectedProjects.some((project) => project.isArchived));+ const isProjectArchiveBlocked = (project: Project) =>+ Number(project.runningCount) > 0 ||+ project.status === 'running' ||+ project.status === 'partially running' ||+ project.status === 'deploying' ||+ project.status === 'restarting';+ const hasRunningSelection = $derived.by(() => selectedProjects.some((project) => isProjectArchiveBlocked(project)));const columns = [{ accessorKey: 'id', title: m.common_id(), hidden: true },@@ -153,7 +175,8 @@action: 'up',onClick: handleBulkUp,loading: isBulkLoading.up,- disabled: isAnyLoading,+ disabled: isAnyLoading || hasArchivedSelection,+ disabledReason: hasArchivedSelection ? m.projects_archived_badge() : undefined,icon: StartIcon},{@@ -162,7 +185,8 @@action: 'down',onClick: handleBulkDown,loading: isBulkLoading.down,- disabled: isAnyLoading,+ disabled: isAnyLoading || hasArchivedSelection,+ disabledReason: hasArchivedSelection ? m.projects_archived_badge() : undefined,icon: StopIcon},{@@ -171,9 +195,27 @@action: 'redeploy',onClick: handleBulkRedeploy,loading: isBulkLoading.redeploy,- disabled: isAnyLoading || hasRedeployDisabledSelection,- disabledReason: hasRedeployDisabledSelection ? m.common_redeploy_disabled_arcane_self() : undefined,+ disabled: isAnyLoading || hasRedeployDisabledSelection || hasArchivedSelection,+ disabledReason: hasArchivedSelection+ ? m.projects_archived_badge()+ : hasRedeployDisabledSelection+ ? m.common_redeploy_disabled_arcane_self()+ : undefined,icon: RedeployIcon+ },+ {+ id: 'archive',+ label: m.projects_bulk_archive({ count: selectedIds?.length ?? 0 }),+ action: 'base',+ onClick: handleBulkArchive,+ loading: isBulkLoading.archive,+ disabled: isAnyLoading || hasArchivedSelection || hasRunningSelection,+ disabledReason: hasRunningSelection+ ? m.projects_archive_requires_stopped()+ : hasArchivedSelection+ ? m.projects_archived_badge()+ : undefined,+ icon: BoxIcon}]);</script>@@ -182,6 +224,9 @@<div class="flex items-center gap-2"><IconImage src={item.iconUrl} alt={item.name} fallback={FolderOpenIcon} class="size-8" containerClass="size-10" /><a class="font-medium hover:underline" href="/projects/{item.id}">{item.name}</a>+ {#if item.isArchived}+ <span class="bg-muted text-muted-foreground rounded px-1.5 py-0.5 text-xs font-medium">{m.projects_archived_badge()}</span>+ {/if}</div>{/snippet}@@ -224,6 +269,7 @@updateInfo={item.updateInfo}onCheck={() => handleCheckProjectUpdates(item)}checking={!!checkingProjectIds[item.id]}+ disabled={!!item.isArchived}class="mr-2"/>{/snippet}@@ -258,6 +304,13 @@tooltip: getStatusTooltip(item)}: null,+ (item: Project) =>+ item.isArchived+ ? {+ variant: 'gray' as const,+ text: m.projects_archived_badge()+ }+ : null,(item: Project) =>(mobileFieldVisibility['updates'] ?? true)? {@@ -345,7 +398,8 @@{#if item.status !== 'running'}<DropdownMenu.Itemonclick={() => performProjectAction('start', item.id)}- disabled={status === 'starting' || isAnyLoading}+ disabled={item.isArchived || status === 'starting' || isAnyLoading}+ title={item.isArchived ? m.projects_archived_badge() : undefined}>{#if status === 'starting'}<Spinner class="size-4" />@@ -357,7 +411,8 @@{:else}<DropdownMenu.Itemonclick={() => performProjectAction('stop', item.id)}- disabled={status === 'stopping' || isAnyLoading}+ disabled={item.isArchived || status === 'stopping' || isAnyLoading}+ title={item.isArchived ? m.projects_archived_badge() : undefined}>{#if status === 'stopping'}<Spinner class="size-4" />@@ -369,7 +424,8 @@<DropdownMenu.Itemonclick={() => performProjectAction('restart', item.id)}- disabled={status === 'restarting' || isAnyLoading}+ disabled={item.isArchived || status === 'restarting' || isAnyLoading}+ title={item.isArchived ? m.projects_archived_badge() : undefined}>{#if status === 'restarting'}<Spinner class="size-4" />@@ -388,7 +444,8 @@{:else}<DropdownMenu.Itemonclick={() => performProjectAction('redeploy', item.id)}- disabled={status === 'redeploying' || isAnyLoading}+ disabled={item.isArchived || status === 'redeploying' || isAnyLoading}+ title={item.isArchived ? m.projects_archived_badge() : undefined}>{#if status === 'redeploying'}<Spinner class="size-4" />@@ -401,6 +458,33 @@<DropdownMenu.Separator />+ {#if item.isArchived}+ <DropdownMenu.Item+ onclick={() => performProjectAction('unarchive', item.id)}+ disabled={status === 'unarchiving' || isAnyLoading}+ >+ {#if status === 'unarchiving'}+ <Spinner class="size-4" />+ {:else}+ <BoxIcon class="size-4" />+ {/if}+ {m.projects_unarchive()}+ </DropdownMenu.Item>+ {:else}+ <DropdownMenu.Item+ onclick={() => performProjectAction('archive', item.id)}+ disabled={isProjectArchiveBlocked(item) || status === 'archiving' || isAnyLoading}+ title={isProjectArchiveBlocked(item) ? m.projects_archive_requires_stopped() : undefined}+ >+ {#if status === 'archiving'}+ <Spinner class="size-4" />+ {:else}+ <BoxIcon class="size-4" />+ {/if}+ {m.projects_archive()}+ </DropdownMenu.Item>+ {/if}+<DropdownMenu.Itemvariant="destructive"onclick={() => handleDestroyProject(item.id)}@@ -418,6 +502,21 @@</DropdownMenu.Root>{/snippet}+{#snippet ArchivedToolbarAction()}+ <div class="flex items-center gap-2 px-1">+ <Switch+ id="projects-show-archived"+ checked={showArchived}+ onCheckedChange={(checked) => {+ void onToggleArchived?.(checked === true);+ }}+ />+ <Label for="projects-show-archived" class="text-muted-foreground mb-0 text-sm font-medium">+ {m.projects_show_archived()}+ </Label>+ </div>+{/snippet}+<ArcaneTablepersistKey="arcane-project-table"items={projects}@@ -433,6 +532,7 @@{columns}{mobileFields}{bulkActions}+ customToolbarActions={ArchivedToolbarAction}rowActions={RowActions}mobileCard={ProjectMobileCardSnippet}/>diff --git a/tests/spec/project.spec.ts b/tests/spec/project.spec.tsindex c981bdfe6..5ec567c63 100644--- a/tests/spec/project.spec.ts+++ b/tests/spec/project.spec.ts@@ -205,11 +205,27 @@ async function destroyProjectByNameViaUI(page: Page, projectName: string) {});}+async function destroyProjectByIdViaAPI(page: Page, projectId: string) {+ if (!projectId || page.isClosed()) {+ return;+ }++ await page.request+ .delete(`/api/environments/0/projects/${encodeURIComponent(projectId)}/destroy`, {+ data: {+ removeVolumes: false,+ removeFiles: true+ }+ })+ .catch(() => undefined);+}+let realProjects: Project[] = [];let projectCounts: ProjectStatusCounts = {runningProjects: 0,stoppedProjects: 0,- totalProjects: 0+ totalProjects: 0,+ archivedProjects: 0};test.beforeEach(async ({ page }) => {@@ -245,6 +261,11 @@ test.describe('Projects Page', () => {exact: true})).toBeVisible();+ await expect(+ page.getByText(`${projectCounts.archivedProjects} Archived Projects`, {+ exact: true+ })+ ).toBeVisible();});test('should display projects list', async ({ page }) => {@@ -274,9 +295,52 @@ test.describe('Projects Page', () => {(await upItem.count()) > 0 || (await downItem.count()) > 0 || (await restartItem.count()) > 0;expect(hasStateAction).toBe(true);await expect(menu.getByRole('menuitem', { name: 'Pull & Redeploy' })).toBeVisible();+ await expect(menu.getByRole('menuitem', { name: 'Archive' })).toBeVisible();await expect(menu.getByRole('menuitem', { name: 'Destroy' })).toBeVisible();});+ test('should archive and unarchive a stopped project from the projects page', async ({+ page+ }) => {+ const projectName = `test-project-archive-${Date.now()}`;+ let projectId = '';++ try {+ projectId = await createProjectViaUI(page, projectName);++ await page.getByRole('button', { name: 'Archive', exact: true }).click();+ await expect(page.getByText('Project archived successfully.')).toBeVisible({+ timeout: 10000+ });++ await page.goto(ROUTES.page);+ await page.waitForLoadState('networkidle');+ await expect(page.locator('tbody tr').filter({ hasText: projectName })).toHaveCount(0);++ await page.getByLabel('Show archived').check();+ await expect(page).toHaveURL(/archived=true/);+ const row = page.locator('tbody tr').filter({ hasText: projectName }).first();+ await expect(row).toBeVisible();+ await expect(row.getByText('Archived', { exact: true })).toBeVisible();++ const menu = await openDropdownMenu(page, row.getByRole('button', { name: 'Open menu' }));+ await menu.getByRole('menuitem', { name: 'Unarchive', exact: true }).click();+ await expect(page.getByText('Project unarchived successfully.')).toBeVisible({+ timeout: 10000+ });+ await expect(row).toHaveCount(0, { timeout: 10000 });+ } finally {+ if (projectId) {+ await page.request+ .post(`/api/environments/0/projects/${projectId}/unarchive`)+ .catch(() => undefined);+ await destroyProjectByIdViaAPI(page, projectId);+ } else {+ await destroyProjectByNameViaUI(page, projectName);+ }+ }+ });+test('should navigate to project details when project name is clicked', async ({ page }) => {test.skip(!realProjects.length, 'No projects available for navigation test');diff --git a/tests/types/project.type.ts b/tests/types/project.type.tsindex 536ad753d..a8d4d2178 100644--- a/tests/types/project.type.ts+++ b/tests/types/project.type.ts@@ -10,4 +10,5 @@ export interface ProjectStatusCounts {runningProjects: number;stoppedProjects: number;totalProjects: number;+ archivedProjects: number;}diff --git a/types/project/project.go b/types/project/project.goindex 8231a39a2..d3c5ea68e 100644--- a/types/project/project.go+++ b/types/project/project.go@@ -254,6 +254,16 @@ type CreateReponse struct {// Required: falseGitOpsManagedBy *string `json:"gitOpsManagedBy,omitempty"`+ // IsArchived indicates whether the project is hidden from the default project list.+ //+ // Required: true+ IsArchived bool `json:"isArchived"`++ // ArchivedAt is the date and time when the project was archived.+ //+ // Required: false+ ArchivedAt *time.Time `json:"archivedAt,omitempty"`+// CreatedAt is the date and time when the project was created.//// Required: true@@ -348,6 +358,16 @@ type Details struct {// Required: trueRunningCount int `json:"runningCount"`+ // IsArchived indicates whether the project is hidden from the default project list.+ //+ // Required: true+ IsArchived bool `json:"isArchived"`++ // ArchivedAt is the date and time when the project was archived.+ //+ // Required: false+ ArchivedAt *time.Time `json:"archivedAt,omitempty"`+// CreatedAt is the date and time when the project was created.//// Required: true@@ -428,6 +448,11 @@ type StatusCounts struct {//// Required: trueTotalProjects int `json:"totalProjects"`++ // ArchivedProjects is the number of archived projects.+ //+ // Required: true+ ArchivedProjects int `json:"archivedProjects"`}// ImagePullRequest is used to pull images for a project.