fix: deletion + cleanupStuckedContainers
This commit is contained in:
@@ -89,7 +89,7 @@
|
||||
const sure = confirm($t('application.confirm_to_delete', { name }));
|
||||
if (sure) {
|
||||
try {
|
||||
await del(`/applications/${id}`, { id, force });
|
||||
await del(`/applications/${id}`, {});
|
||||
return await goto('/');
|
||||
} catch (error) {
|
||||
if (error.message.startsWith(`Command failed: SSH_AUTH_SOCK=/tmp/coolify-ssh-agent.pid`)) {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
if (sure) {
|
||||
$status.application.initialLoading = true;
|
||||
try {
|
||||
await del(`/applications/${id}`, { id, force });
|
||||
await del(`/applications/${id}`,{});
|
||||
return await goto('/')
|
||||
} catch (error) {
|
||||
if (error.message.startsWith(`Command failed: SSH_AUTH_SOCK=/tmp/coolify-ssh-agent.pid`)) {
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
if (sure) {
|
||||
$status.database.initialLoading = true;
|
||||
try {
|
||||
await del(`/databases/${database.id}`, { id: database.id, force });
|
||||
await del(`/databases/${database.id}`, {});
|
||||
return await window.location.assign('/');
|
||||
} catch (error) {
|
||||
return errorNotification(error);
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
try {
|
||||
const sure = confirm('Are you sure? This will delete this application!');
|
||||
if (sure) {
|
||||
await del(`/applications/${id}`, { force: true });
|
||||
await del(`/applications/${id}`, {});
|
||||
return window.location.reload();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -459,7 +459,7 @@
|
||||
try {
|
||||
const sure = confirm('Are you sure? This will delete this database!');
|
||||
if (sure) {
|
||||
await del(`/databases/${id}`, { force: true });
|
||||
await del(`/databases/${id}`, { });
|
||||
return window.location.reload();
|
||||
}
|
||||
} catch (error) {
|
||||
@@ -784,11 +784,11 @@
|
||||
</a>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-green-500"
|
||||
on:click|stopPropagation|preventDefault={() =>
|
||||
deleteApplication(application.id)}><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-green-500"
|
||||
on:click|stopPropagation|preventDefault={() =>
|
||||
deleteApplication(application.id)}><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -899,11 +899,11 @@
|
||||
</a>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-green-500"
|
||||
on:click|stopPropagation|preventDefault={() =>
|
||||
deleteApplication(application.id)}><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-green-500"
|
||||
on:click|stopPropagation|preventDefault={() =>
|
||||
deleteApplication(application.id)}><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -996,11 +996,11 @@
|
||||
</a>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-pink-500"
|
||||
on:click|stopPropagation|preventDefault={() => deleteService(service.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-pink-500"
|
||||
on:click|stopPropagation|preventDefault={() => deleteService(service.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1084,11 +1084,11 @@
|
||||
</a>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-pink-500"
|
||||
on:click|stopPropagation|preventDefault={() => deleteService(service.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-pink-500"
|
||||
on:click|stopPropagation|preventDefault={() => deleteService(service.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1182,11 +1182,11 @@
|
||||
</div>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-databases-100"
|
||||
on:click|stopPropagation|preventDefault={() => deleteDatabase(database.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-databases-100"
|
||||
on:click|stopPropagation|preventDefault={() =>
|
||||
deleteDatabase(database.id)}><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
@@ -1270,11 +1270,11 @@
|
||||
</div>
|
||||
{/if}
|
||||
{#if $appSession.isAdmin}
|
||||
<button
|
||||
class="icons hover:bg-databases"
|
||||
on:click|stopPropagation|preventDefault={() => deleteDatabase(database.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
<button
|
||||
class="icons hover:bg-databases"
|
||||
on:click|stopPropagation|preventDefault={() => deleteDatabase(database.id)}
|
||||
><DeleteIcon /></button
|
||||
>
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -85,9 +85,7 @@
|
||||
if (sure) {
|
||||
$status.service.initialLoading = true;
|
||||
try {
|
||||
if (service.type && $status.service.isRunning)
|
||||
await post(`/services/${service.id}/stop`, {});
|
||||
await del(`/services/${service.id}`, { id: service.id });
|
||||
await del(`/services/${service.id}`, {});
|
||||
return await goto('/');
|
||||
} catch (error) {
|
||||
return errorNotification(error);
|
||||
|
||||
@@ -28,16 +28,12 @@
|
||||
import { goto } from '$app/navigation';
|
||||
const { id } = $page.params;
|
||||
|
||||
let forceDelete = false;
|
||||
async function deleteService() {
|
||||
const sure = confirm($t('application.confirm_to_delete', { name: service.name }));
|
||||
if (sure) {
|
||||
$status.service.initialLoading = true;
|
||||
try {
|
||||
if (service.type && $status.service.overallStatus !== 'stopped') {
|
||||
await post(`/services/${service.id}/stop`, {});
|
||||
}
|
||||
await del(`/services/${service.id}`, { id: service.id });
|
||||
await del(`/services/${service.id}`, {});
|
||||
return await goto('/');
|
||||
} catch (error) {
|
||||
return errorNotification(error);
|
||||
|
||||
Reference in New Issue
Block a user