mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-12 15:53:46 -04:00
feat(server): confirm Docker image deletion with a typed reference modal
Replace the browser confirm on the Delete button with a two-step confirmation modal. To delete, users now type the image reference. The modal is shown only to users who can update the server. delete() now accepts an optional password argument so it works with the modal's submit action.
This commit is contained in:
@@ -53,7 +53,7 @@ class DockerImages extends Component
|
||||
}
|
||||
}
|
||||
|
||||
public function delete(string $reference): void
|
||||
public function delete(string $reference, string $password = ''): void
|
||||
{
|
||||
try {
|
||||
$this->authorize('update', $this->server);
|
||||
|
||||
@@ -87,12 +87,17 @@
|
||||
</div>
|
||||
<div>
|
||||
@if ($image['containers'] === [])
|
||||
<x-forms.button canGate="update" :canResource="$server" isError
|
||||
wire:click="delete('{{ $image['reference'] }}')"
|
||||
wire:confirm="Delete {{ $image['reference'] }} from this server? It has to be pulled or built again to be used."><x-reicon
|
||||
name="trash" class="size-3.5" />
|
||||
Delete
|
||||
</x-forms.button>
|
||||
@can('update', $server)
|
||||
<x-modal-confirmation title="Delete Docker Image?" buttonTitle="Delete"
|
||||
submitAction="delete({{ $image['reference'] }})" :actions="[
|
||||
'Delete ' . $image['reference'] . ' from this server.',
|
||||
'It has to be pulled or built again before it can be used.',
|
||||
]"
|
||||
confirmationText="{{ $image['reference'] }}"
|
||||
confirmationLabel="Confirm by entering the image reference"
|
||||
shortConfirmationLabel="Image" step2ButtonText="Delete Image"
|
||||
isErrorButton :confirmWithPassword="false" />
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user