Modern Docker Management, Designed for Everyone
Go composecontainer-managementcontainersdockerdocker-composedocker-managementgoself-hostedsveltekittypescriptweb-ui
fix: add container force removal checkboxes
Kyle Mendell6e449b2af261
diff --git a/frontend/src/lib/services/api/environment-api-service.ts b/frontend/src/lib/services/api/environment-api-service.tsindex c96f025e8..c8aea0033 100644--- a/frontend/src/lib/services/api/environment-api-service.ts+++ b/frontend/src/lib/services/api/environment-api-service.ts@@ -66,9 +66,13 @@ export class EnvironmentAPIService extends BaseAPIService {return this.handleResponse(this.api.post(`/environments/${envId}/containers/${containerId}/restart`));}- async deleteContainer(containerId: string): Promise<any> {+ async deleteContainer(containerId: string, opts?: { force?: boolean; volumes?: boolean }): Promise<any> {const envId = await this.getCurrentEnvironmentId();- return this.handleResponse(this.api.delete(`/environments/${envId}/containers/${containerId}`));+ const params: Record<string, string> = {};+ if (opts?.force !== undefined) params.force = String(!!opts.force);+ if (opts?.volumes !== undefined) params.volumes = String(!!opts.volumes);++ return this.handleResponse(this.api.delete(`/environments/${envId}/containers/${containerId}`, { params }));}async pullContainerImage(containerId: string): Promise<Project> {diff --git a/frontend/src/routes/containers/container-table.svelte b/frontend/src/routes/containers/container-table.svelteindex 1637e982e..7a6c47323 100644--- a/frontend/src/routes/containers/container-table.svelte+++ b/frontend/src/routes/containers/container-table.svelte@@ -87,12 +87,26 @@openConfirmDialog({title: 'Confirm Container Removal',message: 'Are you sure you want to remove this container? This action cannot be undone.',+ checkboxes: [+ {+ id: 'force',+ label: 'Force remove (kill the container if running)',+ initialState: false+ },+ {+ id: 'volumes',+ label: 'Remove container volumes',+ initialState: false+ }+ ],confirm: {label: 'Remove',destructive: true,- action: async () => {+ action: async (checkboxStates) => {+ const force = !!checkboxStates.force;+ const volumes = !!checkboxStates.volumes;handleApiResultWithCallbacks({- result: await tryCatch(environmentAPI.deleteContainer(id)),+ result: await tryCatch(environmentAPI.deleteContainer(id, { force, volumes })),message: 'Failed to Remove Container',setLoadingState: (value) => (isLoading.remove = value),async onSuccess() {