Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
refactor: make action buttons bindable
Kyle Mendell7b1c8f3e3053
diff --git a/backend/internal/services/image_service.go b/backend/internal/services/image_service.goindex 983915cfa..fdc187e66 100644--- a/backend/internal/services/image_service.go+++ b/backend/internal/services/image_service.go@@ -12,6 +12,8 @@ import ("strings""time"+ "log/slog"+"github.com/docker/docker/api/types/container""github.com/docker/docker/api/types/filters""github.com/docker/docker/api/types/image"@@ -108,7 +110,7 @@ func (s *ImageService) RemoveImage(ctx context.Context, id string, force bool, u"force": force,}if logErr := s.eventService.LogImageEvent(ctx, models.EventTypeImageDelete, id, imageName, user.ID, user.Username, "0", metadata); logErr != nil {- fmt.Printf("Could not log image deletion action: %s\n", logErr)+ slog.Warn("could not log image deletion action", slog.Any("err", logErr), slog.String("image", imageName), slog.String("image_id", id))}return nil@@ -121,11 +123,11 @@ func (s *ImageService) PullImage(ctx context.Context, imageName string, progress}defer dockerClient.Close()- fmt.Printf("Attempting to pull image: %s\n", imageName)+ slog.Debug("attempting to pull image", slog.String("image", imageName))pullOptions, err := s.getPullOptionsWithAuth(ctx, imageName)if err != nil {- fmt.Printf("Warning: Failed to get registry authentication for %s: %v\n", imageName, err)+ slog.Warn("failed to get registry authentication for image; proceeding without auth", slog.String("image", imageName), slog.Any("err", err))pullOptions = image.PullOptions{}}@@ -153,22 +155,22 @@ func (s *ImageService) PullImage(ctx context.Context, imageName string, progress}if scanErr := scanner.Err(); scanErr != nil {if errors.Is(scanErr, context.Canceled) || strings.Contains(scanErr.Error(), "context canceled") {- fmt.Printf("Image pull stream canceled for %s: %v\n", imageName, scanErr)+ slog.Debug("image pull stream canceled", slog.String("image", imageName), slog.Any("err", scanErr))return fmt.Errorf("image pull stream canceled for %s: %w", imageName, scanErr)}return fmt.Errorf("error reading image pull stream for %s: %w", imageName, scanErr)}- fmt.Printf("Image %s pull stream completed, attempting to sync database.\n", imageName)+ slog.Debug("image pull stream completed, attempting to sync database", slog.String("image", imageName))latestImages, listErr := dockerClient.ImageList(ctx, image.ListOptions{})if listErr != nil {- fmt.Printf("Warning: failed to list images after pull for sync: %v\n", listErr)+ slog.Warn("failed to list images after pull for sync", slog.Any("err", listErr))} else {if syncErr := s.syncImagesToDatabase(ctx, latestImages, dockerClient); syncErr != nil {- fmt.Printf("Warning: error during image synchronization after pull: %v\n", syncErr)+ slog.Warn("error during image synchronization after pull", slog.Any("err", syncErr))} else {- fmt.Printf("Database synchronized successfully after pulling image %s.\n", imageName)+ slog.Debug("database synchronized successfully after pulling image", slog.String("image", imageName))}}@@ -178,7 +180,7 @@ func (s *ImageService) PullImage(ctx context.Context, imageName string, progress"imageName": imageName,}if logErr := s.eventService.LogImageEvent(ctx, models.EventTypeImagePull, "", imageName, user.ID, user.Username, "0", metadata); logErr != nil {- fmt.Printf("Could not log image pull action: %s\n", logErr)+ slog.Warn("could not log image pull action", slog.Any("err", logErr), slog.String("image", imageName))}return nil@@ -306,7 +308,7 @@ func (s *ImageService) PruneImages(ctx context.Context, dangling bool) (*image.P"spaceReclaimed": report.SpaceReclaimed,}if logErr := s.eventService.LogImageEvent(ctx, models.EventTypeImageDelete, "", "bulk_prune", systemUser.ID, systemUser.Username, "0", metadata); logErr != nil {- fmt.Printf("Could not log image prune action: %s\n", logErr)+ slog.Warn("could not log image prune action", slog.Any("err", logErr))}return &report, nil@@ -335,7 +337,7 @@ func (s *ImageService) syncImagesToDatabase(ctx context.Context, dockerImages []for _, di := range dockerImages {currentDockerImageIDs = append(currentDockerImageIDs, di.ID)if err := s.syncSingleImage(ctx, di, inUseImageIDs); err != nil {- fmt.Printf("Error syncing image %s to database: %v\n", di.ID, err)+ slog.Warn("error syncing image to database", slog.String("image_id", di.ID), slog.Any("err", err))lastErr = err}}@@ -345,7 +347,7 @@ func (s *ImageService) syncImagesToDatabase(ctx context.Context, dockerImages []}if err := s.imageUpdateService.CleanupOrphanedRecords(ctx); err != nil {- fmt.Printf("Warning: failed to cleanup orphaned image update records: %v\n", err)+ slog.Warn("failed to cleanup orphaned image update records", slog.Any("err", err))if lastErr == nil {lastErr = err}@@ -358,7 +360,7 @@ func (s *ImageService) getInUseImageIDs(ctx context.Context, dockerClient *clieninUseImageIDs := make(map[string]bool)containers, err := dockerClient.ContainerList(ctx, container.ListOptions{All: true})if err != nil {- fmt.Printf("Error listing containers for InUse check: %v. InUse status may be inaccurate.\n", err)+ slog.Warn("error listing containers for in-use check; in-use status may be inaccurate", slog.Any("err", err))return inUseImageIDs}@@ -438,21 +440,21 @@ func (s *ImageService) cleanupStaleImages(ctx context.Context, currentDockerImagfunc (s *ImageService) deleteStaleImages(ctx context.Context, currentDockerImageIDs []string) error {deleteResult := s.db.WithContext(ctx).Where("id NOT IN ?", currentDockerImageIDs).Delete(&models.Image{})if deleteResult.Error != nil {- fmt.Printf("Error deleting stale images from database: %v\n", deleteResult.Error)+ slog.Warn("error deleting stale images from database", slog.Any("err", deleteResult.Error))return deleteResult.Error}- fmt.Printf("%d stale image records deleted from database.\n", deleteResult.RowsAffected)+ slog.Debug("stale image records deleted from database", slog.Int64("rows_affected", deleteResult.RowsAffected))return nil}func (s *ImageService) deleteAllImages(ctx context.Context) error {- fmt.Println("No images found in Docker daemon, attempting to delete all image records from database.")+ slog.Debug("no images found in Docker daemon, attempting to delete all image records from database")deleteAllResult := s.db.WithContext(ctx).Delete(&models.Image{}, "1 = 1")if deleteAllResult.Error != nil {- fmt.Printf("Error deleting all image records from database when Docker is empty: %v\n", deleteAllResult.Error)+ slog.Warn("error deleting all image records from database when Docker is empty", slog.Any("err", deleteAllResult.Error))return deleteAllResult.Error}- fmt.Printf("All (%d) image records deleted from database as Docker reported no images.\n", deleteAllResult.RowsAffected)+ slog.Debug("all image records deleted from database as Docker reported no images", slog.Int64("rows_affected", deleteAllResult.RowsAffected))return nil}@@ -480,7 +482,7 @@ func (s *ImageService) DeleteImageByDockerID(ctx context.Context, dockerImageIDif result.RowsAffected == 0 {} else {- fmt.Printf("Successfully deleted image %s from database.\n", dockerImageID)+ slog.Debug("successfully deleted image from database", slog.String("image_id", dockerImageID))}return nil}diff --git a/backend/internal/services/stack_service.go b/backend/internal/services/stack_service.goindex 1c51767fe..a75a8fee8 100644--- a/backend/internal/services/stack_service.go+++ b/backend/internal/services/stack_service.go@@ -195,12 +195,17 @@ func (s *StackService) DownStack(ctx context.Context, stackID string, user modelreturn fmt.Errorf("stack directory does not exist: %s", stack.Path)}+ composeFileName := s.findComposeFileName(stack.Path)+ if composeFileName == "" {+ return fmt.Errorf("no compose file found in stack directory: %s", stack.Path)+ }+// Update status to stopping firstif err := s.UpdateStackStatus(ctx, stackID, models.StackStatusStopping); err != nil {return fmt.Errorf("failed to update stack status to stopping: %w", err)}- cmd := exec.CommandContext(ctx, "docker-compose", "down")+ cmd := exec.CommandContext(ctx, "docker-compose", "-f", composeFileName, "down")cmd.Dir = stack.Pathcmd.Env = append(os.Environ(),fmt.Sprintf("COMPOSE_PROJECT_NAME=%s", stack.Name),@@ -208,6 +213,9 @@ func (s *StackService) DownStack(ctx context.Context, stackID string, user modeloutput, err := cmd.CombinedOutput()if err != nil {+ if updateErr := s.UpdateStackStatus(ctx, stackID, models.StackStatusDeploying); updateErr != nil {+ return fmt.Errorf("failed to down project: %w, also failed to update status: %w", err, updateErr)+ }return fmt.Errorf("failed to bring down stack: %w\nOutput: %s", err, string(output))}diff --git a/frontend/src/lib/components/action-buttons.svelte b/frontend/src/lib/components/action-buttons.svelteindex 0ab25b715..58a400578 100644--- a/frontend/src/lib/components/action-buttons.svelte+++ b/frontend/src/lib/components/action-buttons.svelte@@ -13,7 +13,6 @@import { m } from '$lib/paraglide/messages';type TargetType = 'container' | 'stack';-type LoadingStates = {start?: boolean;stop?: boolean;@@ -29,26 +28,57 @@id,type = 'container',itemState = 'stopped',- loading = {},- onActionComplete = $bindable(() => {})+ loading = $bindable<LoadingStates>({}),+ onActionComplete = $bindable<(status?: string) => void>(() => {}),+ startLoading = $bindable(false),+ stopLoading = $bindable(false),+ restartLoading = $bindable(false),+ removeLoading = $bindable(false),+ redeployLoading = $bindable(false)}: {id: string;type?: TargetType;itemState?: string;- loading: LoadingStates;- onActionComplete?: () => void;+ loading?: LoadingStates;+ onActionComplete?: (status?: string) => void;+ startLoading?: boolean;+ stopLoading?: boolean;+ restartLoading?: boolean;+ removeLoading?: boolean;+ redeployLoading?: boolean;} = $props();- let isLoading = $state({+ let isLoading = $state<LoadingStates>({start: false,stop: false,restart: false,remove: false,- pulling: false,+ pull: false,redeploy: false,validating: false});+ function setLoading<K extends keyof LoadingStates>(key: K, value: boolean) {+ isLoading[key] = value;+ loading = { ...loading, [key]: value };++ if (key === 'start') startLoading = value;+ if (key === 'stop') stopLoading = value;+ if (key === 'restart') restartLoading = value;+ if (key === 'remove') removeLoading = value;+ if (key === 'redeploy') redeployLoading = value;+ }++ const uiLoading = $derived({+ start: !!(isLoading.start || loading?.start || startLoading),+ stop: !!(isLoading.stop || loading?.stop || stopLoading),+ restart: !!(isLoading.restart || loading?.restart || restartLoading),+ remove: !!(isLoading.remove || loading?.remove || removeLoading),+ pulling: !!(isLoading.pull || loading?.pull),+ redeploy: !!(isLoading.redeploy || loading?.redeploy || redeployLoading),+ validating: !!(isLoading.validating || loading?.validating)+ });+let pullPopoverOpen = $state(false);let pullProgress = $state(0);let pullStatusText = $state('');@@ -57,16 +87,6 @@const isRunning = $derived(itemState === 'running' || (type === 'stack' && itemState === 'partially running'));- $effect(() => {- isLoading.start = loading.start ?? false;- isLoading.stop = loading.stop ?? false;- isLoading.pulling = loading.pull ?? false;- isLoading.remove = loading.remove ?? false;- isLoading.restart = loading.restart ?? false;- isLoading.redeploy = loading.redeploy ?? false;- isLoading.validating = loading.validating ?? false;- });-function resetPullState() {pullProgress = 0;pullStatusText = '';@@ -128,7 +148,7 @@const removeFiles = checkboxStates['removeFiles'] === true;const removeVolumes = checkboxStates['removeVolumes'] === true;- isLoading.remove = true;+ setLoading('remove', true);handleApiResultWithCallbacks({result: await tryCatch(type === 'container'@@ -139,7 +159,7 @@action: type === 'stack' ? m.compose_destroy() : m.common_remove(),type: type}),- setLoadingState: (value) => (isLoading.remove = value),+ setLoadingState: (value) => setLoading('remove', value),onSuccess: async () => {toast.success(type === 'stack'@@ -147,7 +167,7 @@: m.action_removed_success({ type: m.common_container() }));await invalidateAll();- goto(`${type === 'stack' ? '/compose' : 'containers'}`);+ goto(type === 'stack' ? '/compose' : '/containers');}});}@@ -168,14 +188,14 @@confirm: {label: m.action_redeploy(),action: async () => {- isLoading.redeploy = true;+ setLoading('redeploy', true);handleApiResultWithCallbacks({result: await tryCatch(environmentAPI.redeployProject(id)),message: m.action_failed_generic({ action: m.action_redeploy(), type }),- setLoadingState: (value) => (isLoading.redeploy = value),+ setLoadingState: (value) => setLoading('redeploy', value),onSuccess: async () => {- toast.success(m.action_redeploy_success({ type: type }));- await invalidateAll();+ toast.success(m.action_redeploy_success({ type }));+ onActionComplete('running');}});}@@ -185,68 +205,71 @@}async function handleStart() {- isLoading.start = true;- handleApiResultWithCallbacks({+ setLoading('start', true);+ await handleApiResultWithCallbacks({result: await tryCatch(type === 'container' ? environmentAPI.startContainer(id) : environmentAPI.startProject(id)),message: m.action_failed_generic({ action: m.common_start(), type }),- setLoadingState: (value) => (isLoading.start = value),+ setLoadingState: (value) => setLoading('start', value),onSuccess: async () => {+ itemState = 'running';toast.success(m.action_started_success({ type }));- await invalidateAll();+ onActionComplete('running');}});}async function handleDeploy() {- isLoading.start = true;- handleApiResultWithCallbacks({+ setLoading('start', true);+ await handleApiResultWithCallbacks({result: await tryCatch(environmentAPI.startProject(id)),message: m.action_failed_generic({ action: m.common_start(), type }),- setLoadingState: (value) => (isLoading.start = value),+ setLoadingState: (value) => setLoading('start', value),onSuccess: async () => {+ itemState = 'running';toast.success(m.action_started_success({ type }));- await invalidateAll();+ onActionComplete('running');}});}async function handleStop() {- isLoading.stop = true;- handleApiResultWithCallbacks({- result: await tryCatch(type === 'container' ? environmentAPI.stopContainer(id) : environmentAPI.stopProject(id)),+ setLoading('stop', true);+ await handleApiResultWithCallbacks({+ result: await tryCatch(type === 'container' ? environmentAPI.stopContainer(id) : environmentAPI.downProject(id)),message: m.action_failed_generic({ action: m.common_stop(), type }),- setLoadingState: (value) => (isLoading.stop = value),+ setLoadingState: (value) => setLoading('stop', value),onSuccess: async () => {+ itemState = 'stopped';toast.success(m.action_stopped_success({ type }));- await invalidateAll();+ onActionComplete('stopped');}});}async function handleRestart() {- isLoading.restart = true;- handleApiResultWithCallbacks({+ setLoading('restart', true);+ await handleApiResultWithCallbacks({result: await tryCatch(type === 'container' ? environmentAPI.restartContainer(id) : environmentAPI.restartProject(id)),message: m.action_failed_generic({ action: m.common_restart(), type }),- setLoadingState: (value) => (isLoading.restart = value),+ setLoadingState: (value) => setLoading('restart', value),onSuccess: async () => {+ itemState = 'running';toast.success(m.action_restarted_success({ type }));- await invalidateAll();+ onActionComplete('running');}});}async function handlePull() {if (type === 'container') {- // Use existing API for containers- isLoading.pulling = true;- handleApiResultWithCallbacks({+ isLoading.pull = true;+ await handleApiResultWithCallbacks({result: await tryCatch(environmentAPI.pullContainerImage(id)),message: m.images_pull_failed(),- setLoadingState: (value) => (isLoading.pulling = value),+ setLoadingState: (value) => (isLoading.pull = value),onSuccess: async () => {toast.success(m.images_pulled_success());- await invalidateAll();+ onActionComplete();}});} else {@@ -256,7 +279,7 @@async function handleStackPull() {resetPullState();- isLoading.pulling = true;+ isLoading.pull = true;pullPopoverOpen = true;pullStatusText = m.images_pull_initiating();@@ -352,7 +375,7 @@setTimeout(() => {pullPopoverOpen = false;- isLoading.pulling = false;+ isLoading.pull = false;resetPullState();}, 2000);} catch (error: any) {@@ -363,7 +386,7 @@toast.error(message);} finally {if (!wasSuccessful) {- isLoading.pulling = false;+ isLoading.pull = false;}}}@@ -374,22 +397,24 @@<ArcaneButtonaction={type === 'container' ? 'start' : 'deploy'}onclick={type === 'container' ? () => handleStart() : () => handleDeploy()}- loading={isLoading.start}+ loading={uiLoading.start}/>- {:else}+ {/if}++ {#if isRunning}<ArcaneButton- customLabel={m.action_down ? m.action_down() : 'Down'}action="stop"+ customLabel={type === 'stack' ? (m.action_down ? m.action_down() : 'Down') : undefined}onclick={() => handleStop()}- loading={isLoading.stop}+ loading={uiLoading.stop}/>- <ArcaneButton action="restart" onclick={() => handleRestart()} loading={isLoading.restart} />+ <ArcaneButton action="restart" onclick={() => handleRestart()} loading={uiLoading.restart} />{/if}{#if type === 'container'}- <ArcaneButton action="remove" onclick={() => confirmAction('remove')} loading={isLoading.remove} />+ <ArcaneButton action="remove" onclick={() => confirmAction('remove')} loading={uiLoading.remove} />{:else}- <ArcaneButton action="redeploy" onclick={() => confirmAction('redeploy')} loading={isLoading.redeploy} />+ <ArcaneButton action="redeploy" onclick={() => confirmAction('redeploy')} loading={uiLoading.redeploy} />{#if type === 'stack'}<ProgressPopover@@ -398,20 +423,20 @@title={m.progress_pulling_images()}statusText={pullStatusText}error={pullError}- loading={isLoading.pulling}+ loading={uiLoading.pulling}icon={DownloadIcon}>- <ArcaneButton action="pull" onclick={() => handlePull()} loading={isLoading.pulling} />+ <ArcaneButton action="pull" onclick={() => handlePull()} loading={uiLoading.pulling} /></ProgressPopover>{:else}- <ArcaneButton action="pull" onclick={() => handlePull()} loading={isLoading.pulling} />+ <ArcaneButton action="pull" onclick={() => handlePull()} loading={uiLoading.pulling} />{/if}<ArcaneButtoncustomLabel={type === 'stack' ? m.compose_destroy() : m.common_remove()}action="remove"onclick={() => confirmAction('remove')}- loading={isLoading.remove}+ loading={uiLoading.remove}/>{/if}</div>diff --git a/frontend/src/lib/components/arcane-button/arcane-button.svelte b/frontend/src/lib/components/arcane-button/arcane-button.svelteindex 2a29247c7..b807f8f57 100644--- a/frontend/src/lib/components/arcane-button/arcane-button.svelte+++ b/frontend/src/lib/components/arcane-button/arcane-button.svelte@@ -79,13 +79,10 @@aria-disabled={href ? disabled : undefined}role={href && disabled ? 'link' : undefined}tabindex={href && disabled ? -1 : tabindex}- class={cn(arcaneButtonVariants({ tone: config.tone, size }), className)}+ class={cn('relative', arcaneButtonVariants({ tone: config.tone, size }), className)}aria-label={hasChildren ? undefined : isIconOnlyButton ? displayLabel : undefined}bind:this={ref}- onclick={async (- // eslint-disable-next-line @typescript-eslint/no-explicit-any- e: any- ) => {+ onclick={async (e: any) => {onclick?.(e);if (type === undefined) return;if (onClickPromise) {diff --git a/frontend/src/lib/services/api/environment-api-service.ts b/frontend/src/lib/services/api/environment-api-service.tsindex 2ef47a655..7037b2655 100644--- a/frontend/src/lib/services/api/environment-api-service.ts+++ b/frontend/src/lib/services/api/environment-api-service.ts@@ -260,11 +260,6 @@ export class EnvironmentAPIService extends BaseAPIService {return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectId}/start`));}- async stopProject(projectId: string): Promise<Project> {- const envId = await this.getCurrentEnvironmentId();- return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectId}/stop`));- }-async restartProject(projectId: string): Promise<Project> {const envId = await this.getCurrentEnvironmentId();return this.handleResponse(this.api.post(`/environments/${envId}/stacks/${projectId}/restart`));diff --git a/frontend/src/lib/utils/api.util.ts b/frontend/src/lib/utils/api.util.tsindex 529b261ad..d1653a1f6 100644--- a/frontend/src/lib/utils/api.util.ts+++ b/frontend/src/lib/utils/api.util.ts@@ -18,29 +18,35 @@ function extractDockerErrorMessage(error: any): string {return JSON.stringify(error);}-export function handleApiResultWithCallbacks<T>({+export async function handleApiResultWithCallbacks<T>({result,message,setLoadingState = () => {},- onSuccess,- onError = () => {}+ onSuccess = async () => {},+ onError = async () => {}}: {result: Result<T, Error>;message: string;setLoadingState?: (value: boolean) => void;- onSuccess: (data: T) => void;- onError?: (error: Error) => void;+ onSuccess?: (data: T) => void | Promise<void>;+ onError?: (error: Error) => void | Promise<void>;}) {- setLoadingState(true);+ try {+ setLoadingState(true);- if (result.error) {- const dockerMsg = extractDockerErrorMessage(result.error);- console.error(`API Error: ${message}:`, result.error);- toast.error(`${message}: ${dockerMsg}`);- onError(result.error);- setLoadingState(false);- } else {- onSuccess(result.data as T);- setLoadingState(false);+ if (result.error) {+ const dockerMsg = extractDockerErrorMessage(result.error);+ console.error(`API Error: ${message}:`, result.error);+ toast.error(`${message}: ${dockerMsg}`);+ await Promise.resolve(onError(result.error));+ } else {+ await Promise.resolve(onSuccess(result.data as T));+ }+ } finally {+ try {+ setLoadingState(false);+ } catch (e) {+ console.warn('Failed to clear loading state', e);+ }}}diff --git a/frontend/src/routes/+layout.svelte b/frontend/src/routes/+layout.svelteindex e755eeaef..5136d08b1 100644--- a/frontend/src/routes/+layout.svelte+++ b/frontend/src/routes/+layout.svelte@@ -61,7 +61,7 @@{/if}</div>-<ModeWatcher />+<ModeWatcher disableTransitions={false} /><ToastertoastOptions={{classes: {diff --git a/frontend/src/routes/compose/[projectId]/+page.svelte b/frontend/src/routes/compose/[projectId]/+page.svelteindex 3d93feb1f..c7497b3fa 100644--- a/frontend/src/routes/compose/[projectId]/+page.svelte+++ b/frontend/src/routes/compose/[projectId]/+page.svelte@@ -94,14 +94,6 @@}});- $effect(() => {- isLoading.deploying = false;- isLoading.stopping = false;- isLoading.restarting = false;- isLoading.removing = false;- isLoading.saving = false;- });-async function handleSaveChanges() {if (!project || !hasChanges) return;@@ -228,12 +220,11 @@id={project.id}type="stack"itemState={project.status}- loading={{- start: isLoading.deploying,- stop: isLoading.stopping,- restart: isLoading.restarting,- remove: isLoading.removing- }}+ bind:startLoading={isLoading.deploying}+ bind:stopLoading={isLoading.stopping}+ bind:restartLoading={isLoading.restarting}+ bind:removeLoading={isLoading.removing}+ bind:redeployLoading={isLoading.redeploying}onActionComplete={() => invalidateAll()}/></div>@@ -262,12 +253,11 @@id={project.id}type="stack"itemState={project.status}- loading={{- start: isLoading.deploying,- stop: isLoading.stopping,- restart: isLoading.restarting,- remove: isLoading.removing- }}+ bind:startLoading={isLoading.deploying}+ bind:stopLoading={isLoading.stopping}+ bind:restartLoading={isLoading.restarting}+ bind:removeLoading={isLoading.removing}+ bind:redeployLoading={isLoading.redeploying}onActionComplete={() => invalidateAll()}/></div>diff --git a/frontend/src/routes/compose/[projectId]/+page.ts b/frontend/src/routes/compose/[projectId]/+page.tsindex 8b8aef4c5..3b92a0ae3 100644--- a/frontend/src/routes/compose/[projectId]/+page.ts+++ b/frontend/src/routes/compose/[projectId]/+page.ts@@ -2,65 +2,22 @@ import { environmentAPI } from '$lib/services/api';import type { PageLoad } from './$types';export const load: PageLoad = async ({ params }) => {- try {- const projectResponse = await environmentAPI.getProject(params.projectId);+ const project = await environmentAPI.getProject(params.projectId);- const project = projectResponse;+ // Set up editor state with the project data+ const editorState = {+ name: project.name || '',+ composeContent: project.composeContent || '',+ envContent: project.envContent || '',+ originalName: project.name || '',+ originalComposeContent: project.composeContent || '',+ originalEnvContent: project.envContent || ''+ };- if (!project) {- return {- stack: null,- error: 'Project not found',- editorState: {- name: '',- composeContent: '',- envContent: '',- originalName: '',- originalComposeContent: '',- originalEnvContent: ''- },- servicePorts: {},- agents: [],- settings: {}- };- }-- // Set up editor state with the project data- const editorState = {- name: project.name || '',- composeContent: project.composeContent || '',- envContent: project.envContent || '',- originalName: project.name || '',- originalComposeContent: project.composeContent || '',- originalEnvContent: project.envContent || ''- };-- return {- project,- editorState,- servicePorts: {}, // TODO: Extract from project services if needed- agents: [], // TODO: Implement if needed- settings: {- baseServerUrl: 'localhost'- },- error: null- };- } catch (error) {- console.error('Failed to load compose page:', error);- return {- stack: null,- error: error instanceof Error ? error.message : 'Failed to load stack',- editorState: {- name: '',- composeContent: '',- envContent: '',- originalName: '',- originalComposeContent: '',- originalEnvContent: ''- },- servicePorts: {},- agents: [],- settings: {}- };- }+ return {+ project,+ editorState,+ servicePorts: {}, // TODO: Extract from project services if needed+ error: null+ };};diff --git a/frontend/src/routes/environments/+page.svelte b/frontend/src/routes/environments/+page.svelteindex db36602ca..ab005345d 100644--- a/frontend/src/routes/environments/+page.svelte+++ b/frontend/src/routes/environments/+page.svelte@@ -55,7 +55,9 @@result,message: m.environments_bulk_remove_failed_many({ count: selectedIds.length }),setLoadingState: () => {},- onSuccess: () => (successCount += 1)+ onSuccess: () => {+ successCount += 1;+ }});if (result.error) failureCount += 1;}diff --git a/frontend/src/routes/volumes/volume-table.svelte b/frontend/src/routes/volumes/volume-table.svelteindex d8ee91f94..c44f082d7 100644--- a/frontend/src/routes/volumes/volume-table.svelte+++ b/frontend/src/routes/volumes/volume-table.svelte@@ -74,7 +74,9 @@result,message: m.volumes_remove_failed({ name: safeName }),setLoadingState: () => {},- onSuccess: () => (successCount += 1)+ onSuccess: (_data) => {+ successCount += 1;+ }});if (result.error) failureCount += 1;}