Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

a few changes here and there

Andras Bacsai182087cf1bd6
diff --git a/app/Actions/Database/StopDatabase.php b/app/Actions/Database/StopDatabase.php
index f90851c933..0f074bea9f 100644
--- a/app/Actions/Database/StopDatabase.php
+++ b/app/Actions/Database/StopDatabase.php
@@ -2,6 +2,7 @@
namespace App\Actions\Database;
+use App\Actions\Server\CleanupDocker;
use App\Models\StandaloneClickhouse;
use App\Models\StandaloneDragonfly;
use App\Models\StandaloneKeydb;
@@ -12,7 +13,6 @@ use App\Models\StandalonePostgresql;
use App\Models\StandaloneRedis;
use Illuminate\Support\Facades\Process;
use Lorisleiva\Actions\Concerns\AsAction;
-use App\Actions\Server\CleanupDocker;
class StopDatabase
{
@@ -21,13 +21,12 @@ class StopDatabase
public function handle(StandaloneRedis|StandalonePostgresql|StandaloneMongodb|StandaloneMysql|StandaloneMariadb|StandaloneKeydb|StandaloneDragonfly|StandaloneClickhouse $database, bool $isDeleteOperation = false, bool $dockerCleanup = true)
{
$server = $database->destination->server;
- if (!$server->isFunctional()) {
+ if (! $server->isFunctional()) {
return 'Server is not functional';
}
$this->stopContainer($database, $database->uuid, 300);
- if (!$isDeleteOperation) {
- $this->deleteConnectedNetworks($database->uuid, $server); //Probably not needed as DBs do not have a network normally
+ if (! $isDeleteOperation) {
if ($dockerCleanup) {
CleanupDocker::run($server, true);
}
diff --git a/app/Jobs/DeleteResourceJob.php b/app/Jobs/DeleteResourceJob.php
index 8f7dd806a2..37300593e0 100644
--- a/app/Jobs/DeleteResourceJob.php
+++ b/app/Jobs/DeleteResourceJob.php
@@ -4,9 +4,9 @@ namespace App\Jobs;
use App\Actions\Application\StopApplication;
use App\Actions\Database\StopDatabase;
+use App\Actions\Server\CleanupDocker;
use App\Actions\Service\DeleteService;
use App\Actions\Service\StopService;
-use App\Actions\Server\CleanupDocker;
use App\Models\Application;
use App\Models\Service;
use App\Models\StandaloneClickhouse;
@@ -35,8 +35,7 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue
public bool $deleteVolumes,
public bool $dockerCleanup,
public bool $deleteConnectedNetworks
- ) {
- }
+ ) {}
public function handle()
{
@@ -84,11 +83,11 @@ class DeleteResourceJob implements ShouldBeEncrypted, ShouldQueue
CleanupDocker::run($server, true);
}
- if ($this->deleteConnectedNetworks) {
+ if ($this->deleteConnectedNetworks && ! $isDatabase) {
$this->resource?->delete_connected_networks($this->resource->uuid);
}
} catch (\Throwable $e) {
- send_internal_notification('ContainerStoppingJob failed with: ' . $e->getMessage());
+ send_internal_notification('ContainerStoppingJob failed with: '.$e->getMessage());
throw $e;
} finally {
$this->resource->forceDelete();
diff --git a/app/Livewire/Project/Application/Heading.php b/app/Livewire/Project/Application/Heading.php
index 4677ff7a28..f84b49c3f3 100644
--- a/app/Livewire/Project/Application/Heading.php
+++ b/app/Livewire/Project/Application/Heading.php
@@ -143,7 +143,7 @@ class Heading extends Component
return view('livewire.project.application.heading', [
'checkboxes' => [
['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images (the next deployment will take longer as the images have to be pulled again)'],
- ]
+ ],
]);
}
}
diff --git a/app/Livewire/Project/Service/Navbar.php b/app/Livewire/Project/Service/Navbar.php
index 51f38d2db3..2e3002852a 100644
--- a/app/Livewire/Project/Service/Navbar.php
+++ b/app/Livewire/Project/Service/Navbar.php
@@ -21,6 +21,7 @@ class Navbar extends Component
public $isDeploymentProgress = false;
public $docker_cleanup = true;
+
public $title = 'Configuration';
public function mount()
@@ -119,9 +120,8 @@ class Navbar extends Component
{
return view('livewire.project.service.navbar', [
'checkboxes' => [
- ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images (the next deployment will take longer as the images have to be pulled again)'],
- ]
+ ['id' => 'docker_cleanup', 'label' => 'Cleanup docker build cache and unused images (next deployment could take longer).'],
+ ],
]);
}
-
}
diff --git a/app/Livewire/Project/Shared/Danger.php b/app/Livewire/Project/Shared/Danger.php
index 609d616987..f437b910e7 100644
--- a/app/Livewire/Project/Shared/Danger.php
+++ b/app/Livewire/Project/Shared/Danger.php
@@ -4,24 +4,33 @@ namespace App\Livewire\Project\Shared;
use App\Jobs\DeleteResourceJob;
use App\Models\Service;
-use App\Models\ServiceDatabase;
use App\Models\ServiceApplication;
+use App\Models\ServiceDatabase;
+use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Hash;
use Livewire\Component;
use Visus\Cuid2\Cuid2;
-use Illuminate\Support\Facades\Hash;
-use Illuminate\Support\Facades\Auth;
class Danger extends Component
{
public $resource;
+
public $resourceName;
+
public $projectUuid;
+
public $environmentName;
+
public bool $delete_configurations = true;
+
public bool $delete_volumes = true;
+
public bool $docker_cleanup = true;
+
public bool $delete_connected_networks = true;
+
public ?string $modalId = null;
+
public string $resourceDomain = '';
public function mount()
@@ -42,11 +51,13 @@ class Danger extends Component
if ($this->resource === null) {
$this->resourceName = 'Unknown Resource';
+
return;
}
- if (!method_exists($this->resource, 'type')) {
+ if (! method_exists($this->resource, 'type')) {
$this->resourceName = 'Unknown Resource';
+
return;
}
@@ -80,13 +91,15 @@ class Danger extends Component
public function delete($password)
{
- if (!Hash::check($password, Auth::user()->password)) {
+ if (! Hash::check($password, Auth::user()->password)) {
$this->addError('password', 'The provided password is incorrect.');
+
return;
}
- if (!$this->resource) {
+ if (! $this->resource) {
$this->addError('resource', 'Resource not found.');
+
return;
}
@@ -113,14 +126,14 @@ class Danger extends Component
{
return view('livewire.project.shared.danger', [
'checkboxes' => [
- ['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted'],
- ['id' => 'delete_connected_networks', 'label' => 'All connected networks with this resource will be permanently deleted (predefined networks will not be deleted)'],
- ['id' => 'delete_configurations', 'label' => 'All configuration files will be permanently deleted form the server'],
- ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images'],
+ ['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted.'],
+ ['id' => 'delete_connected_networks', 'label' => 'All connected networks with this resource will be permanently deleted (except the predefined networks).'],
+ ['id' => 'delete_configurations', 'label' => 'All configuration files will be permanently deleted form the server.'],
+ ['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images.'],
// ['id' => 'delete_associated_backups_locally', 'label' => 'All backups associated with this Ressource will be permanently deleted from local storage.'],
// ['id' => 'delete_associated_backups_s3', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected S3 Storage.'],
// ['id' => 'delete_associated_backups_sftp', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected SFTP Storage.']
- ]
+ ],
]);
}
}
diff --git a/resources/views/components/modal-confirmation.blade.php b/resources/views/components/modal-confirmation.blade.php
index e31284e7c4..249820e9ab 100644
--- a/resources/views/components/modal-confirmation.blade.php
+++ b/resources/views/components/modal-confirmation.blade.php
@@ -1,25 +1,25 @@
@props([
-'title' => 'Are you sure?',
-'isErrorButton' => false,
-'buttonTitle' => 'Confirm Action',
-'buttonFullWidth' => false,
-'customButton' => null,
-'disabled' => false,
-'submitAction' => 'delete',
-'content' => null,
-'checkboxes' => [],
-'actions' => [],
-'confirmWithText' => true,
-'confirmationText' => 'Confirm Deletion',
-'confirmationLabel' => 'Please confirm the execution of the actions by entering the Name below',
-'shortConfirmationLabel' => 'Name',
-'confirmWithPassword' => true,
-'step1ButtonText' => 'Continue Deletion',
-'step2ButtonText' => 'Delete Permanently',
-'step3ButtonText' => 'Confirm Permanent Deletion',
-'dispatchEvent' => false,
-'dispatchEventType' => 'success',
-'dispatchEventMessage' => '',
+ 'title' => 'Are you sure?',
+ 'isErrorButton' => false,
+ 'buttonTitle' => 'Confirm Action',
+ 'buttonFullWidth' => false,
+ 'customButton' => null,
+ 'disabled' => false,
+ 'submitAction' => 'delete',
+ 'content' => null,
+ 'checkboxes' => [],
+ 'actions' => [],
+ 'confirmWithText' => true,
+ 'confirmationText' => 'Confirm Deletion',
+ 'confirmationLabel' => 'Please confirm the execution of the actions by entering the NAME below',
+ 'shortConfirmationLabel' => 'Name',
+ 'confirmWithPassword' => true,
+ 'step1ButtonText' => 'Continue',
+ 'step2ButtonText' => 'Confirm',
+ 'step3ButtonText' => 'Delete Permanently',
+ 'dispatchEvent' => false,
+ 'dispatchEventType' => 'success',
+ 'dispatchEventMessage' => '',
])
<div x-data="{
@@ -99,170 +99,202 @@
this.selectedActions.push(id);
}
}
-}" @keydown.escape.window="modalOpen = false; resetModal()" :class="{ 'z-40': modalOpen }" class="relative w-auto h-auto">
+}" @keydown.escape.window="modalOpen = false; resetModal()" :class="{ 'z-40': modalOpen }"
+ class="relative w-auto h-auto">
@if ($customButton)
- @if ($buttonFullWidth)
- <x-forms.button @click="modalOpen=true" class="w-full">
- {{ $customButton }}
- </x-forms.button>
+ @if ($buttonFullWidth)
+ <x-forms.button @click="modalOpen=true" class="w-full">
+ {{ $customButton }}
+ </x-forms.button>
+ @else
+ <x-forms.button @click="modalOpen=true">
+ {{ $customButton }}
+ </x-forms.button>
+ @endif
@else
- <x-forms.button @click="modalOpen=true">
- {{ $customButton }}
- </x-forms.button>
- @endif
- @else
- @if ($content)
- <div @click="modalOpen=true">
- {{ $content }}
- </div>
- @else
- @if ($disabled)
- @if ($buttonFullWidth)
- <x-forms.button class="w-full" isError disabled wire:target>
- {{ $buttonTitle }}
- </x-forms.button>
- @else
- <x-forms.button isError disabled wire:target>
- {{ $buttonTitle }}
- </x-forms.button>
- @endif
- @elseif ($isErrorButton)
- @if ($buttonFullWidth)
- <x-forms.button class="w-full" isError @click="modalOpen=true">
- {{ $buttonTitle }}
- </x-forms.button>
- @else
- <x-forms.button isError @click="modalOpen=true">
- {{ $buttonTitle }}
- </x-forms.button>
- @endif
- @else
- @if ($buttonFullWidth)
- <x-forms.button @click="modalOpen=true" class="flex w-full gap-2" wire:target>
- {{ $buttonTitle }}
- </x-forms.button>
- @else
- <x-forms.button @click="modalOpen=true" class="flex gap-2" wire:target>
- {{ $buttonTitle }}
- </x-forms.button>
- @endif
- @endif
- @endif
+ @if ($content)
+ <div @click="modalOpen=true">
+ {{ $content }}
+ </div>
+ @else
+ @if ($disabled)
+ @if ($buttonFullWidth)
+ <x-forms.button class="w-full" isError disabled wire:target>
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @else
+ <x-forms.button isError disabled wire:target>
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @endif
+ @elseif ($isErrorButton)
+ @if ($buttonFullWidth)
+ <x-forms.button class="w-full" isError @click="modalOpen=true">
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @else
+ <x-forms.button isError @click="modalOpen=true">
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @endif
+ @else
+ @if ($buttonFullWidth)
+ <x-forms.button @click="modalOpen=true" class="flex gap-2 w-full" wire:target>
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @else
+ <x-forms.button @click="modalOpen=true" class="flex gap-2" wire:target>
+ {{ $buttonTitle }}
+ </x-forms.button>
+ @endif
+ @endif
+ @endif
@endif
<template x-teleport="body">
- <div x-show="modalOpen" @click.away="modalOpen = false; resetModal()" class="fixed top-0 lg:pt-10 left-0 z-[99] flex items-start justify-center w-screen h-screen" x-cloak>
- <div x-show="modalOpen" @click="modalOpen = false; resetModal()" class="absolute inset-0 w-full h-full bg-black bg-opacity-20 backdrop-blur-sm"></div>
- <div x-show="modalOpen" x-trap.inert.noscroll="modalOpen" x-transition:enter="ease-out duration-100" x-transition:enter-start="opacity-0 -translate-y-2 sm:scale-95" x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100" x-transition:leave="ease-in duration-100" x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100" x-transition:leave-end="opacity-0 -translate-y-2 sm:scale-95" class="relative w-full py-6 border rounded min-w-full lg:min-w-[36rem] max-w-[48rem] bg-neutral-100 border-neutral-400 dark:bg-base px-7 dark:border-coolgray-300">
- <div class="flex items-center justify-between pb-3">
- <h3 class="text-2xl font-bold pr-8">{{ $title }}</h3>
- <button @click="modalOpen = false; resetModal()" class="absolute top-2 right-2 flex items-center justify-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
- <svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor">
+ <div x-show="modalOpen" @click.away="modalOpen = false; resetModal()"
+ class="fixed top-0 lg:pt-10 left-0 z-[99] flex items-start justify-center w-screen h-screen" x-cloak>
+ <div x-show="modalOpen" @click="modalOpen = false; resetModal()"
+ class="absolute inset-0 w-full h-full bg-black bg-opacity-20 backdrop-blur-sm"></div>
+ <div x-show="modalOpen" x-trap.inert.noscroll="modalOpen" x-transition:enter="ease-out duration-100"
+ x-transition:enter-start="opacity-0 -translate-y-2 sm:scale-95"
+ x-transition:enter-end="opacity-100 translate-y-0 sm:scale-100"
+ x-transition:leave="ease-in duration-100"
+ x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
+ x-transition:leave-end="opacity-0 -translate-y-2 sm:scale-95"
+ class="relative w-full py-6 border rounded min-w-full lg:min-w-[36rem] max-w-[48rem] bg-neutral-100 border-neutral-400 dark:bg-base px-7 dark:border-coolgray-300">
+ <div class="flex justify-between items-center pb-3">
+ <h3 class="pr-8 text-2xl font-bold">{{ $title }}</h3>
+ <button @click="modalOpen = false; resetModal()"
+ class="flex absolute top-2 right-2 justify-center items-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
+ <svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
+ stroke-width="1.5" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
- <div class="relative w-auto pb-8">
- @if(!empty($checkboxes))
- <!-- Step 1: Select actions -->
- <div x-show="step === 1">
- <div class="flex justify-between items-center mb-4">
- <div class="px-2">Select the actions you want to perform:</div>
- </div>
- @foreach($checkboxes as $index => $checkbox)
- <div class="flex items-center justify-between mb-2">
- <label for="{{ $checkbox['id'] }}" class="text-sm leading-5 text-gray-700 dark:text-gray-300 flex-grow pr-4">
- {{ $checkbox['label'] }}
- </label>
- <x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']" x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}" x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" class="flex-shrink-0" :hideLabel="true" />
+ <div class="relative pb-8 w-auto">
+ @if (!empty($checkboxes))
+ <!-- Step 1: Select actions -->
+ <div x-show="step === 1">
+ <div class="flex justify-between items-center mb-4">
+ <div>Select the actions you want to perform:</div>
+ </div>
+ @foreach ($checkboxes as $index => $checkbox)
+ <div class="flex justify-between items-center mb-2">
+ <label for="{{ $checkbox['id'] }}"
+ class="flex-grow pr-4 text-sm leading-5 text-gray-700 dark:text-gray-300">
+ {{ $checkbox['label'] }}
+ </label>
+ <x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']"
+ x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
+ x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
+ class="flex-shrink-0" :hideLabel="true" />
+ </div>
+ @endforeach
</div>
- @endforeach
- </div>
@endif
<!-- Step 2: Confirm deletion -->
<div x-show="step === 2">
- <div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4" role="alert">
+ <div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
<p class="font-bold">Warning</p>
- <p>This operation is permanent and cannot be undone. Please think again before proceeding!</p>
+ <p>This operation is permanent and cannot be undone. Please think again before proceeding!
+ </p>
</div>
- <div class="px-2 mb-4">The following actions will be performed:</div>
+ <div class="mb-4">The following actions will be performed:</div>
<ul class="mb-4 space-y-2">
- @foreach($actions as $action)
- <li class="flex items-center text-red-500">
- <svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
- </svg>
- <span>{{ $action }}</span>
- </li>
- @endforeach
- @foreach($checkboxes as $checkbox)
- <template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
+ @foreach ($actions as $action)
<li class="flex items-center text-red-500">
- <svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
+ <svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
+ viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M6 18L18 6M6 6l12 12"></path>
</svg>
- <span>{{ $checkbox['label'] }}</span>
+ <span>{{ $action }}</span>
</li>
- </template>
+ @endforeach
+ @foreach ($checkboxes as $checkbox)
+ <template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
+ <li class="flex items-center text-red-500">
+ <svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
+ viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
+ d="M6 18L18 6M6 6l12 12"></path>
+ </svg>
+ <span>{{ $checkbox['label'] }}</span>
+ </li>
+ </template>
@endforeach
</ul>
- @if($confirmWithText)
- <div class="mb-4">
- <h4 class="text-lg font-semibold mb-2">Confirm Actions</h4>
- <p class="text-sm mb-2">{{ $confirmationLabel }}</p>
+ @if ($confirmWithText)
+ <div class="mb-4">
+ <h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
+ <p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
- <div class="relative mb-2">
- <input type="text" x-model="confirmationText" class="w-full p-2 pr-10 rounded text-black input cursor-text" readonly>
- <button @click="copyConfirmationText()" class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-500 hover:text-gray-700" title="Copy confirmation text" x-ref="copyButton">
- <template x-if="!copied">
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
- <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
- <path d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
- </svg>
- </template>
- <template x-if="copied">
- <svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-500" viewBox="0 0 20 20" fill="currentColor">
- <path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd" />
- </svg>
- </template>
- </button>
- </div>
+ <div class="relative mb-2">
+ <input type="text" x-model="confirmationText"
+ class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
+ <button @click="copyConfirmationText()"
+ class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
+ title="Copy confirmation text" x-ref="copyButton">
+ <template x-if="!copied">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"
+ fill="currentColor">
+ <path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
+ <path
+ d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
+ </svg>
+ </template>
+ <template x-if="copied">
+ <svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
+ viewBox="0 0 20 20" fill="currentColor">
+ <path fill-rule="evenodd"
+ d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
+ clip-rule="evenodd" />
+ </svg>
+ </template>
+ </button>
+ </div>
- <label for="userConfirmationText" class="block text-sm font-medium text-gray-700 dark:text-gray-300 mt-4">
- {{ $shortConfirmationLabel }}
- </label>
- <input type="text" x-model="userConfirmationText" class="w-full p-2 rounded text-black input mt-1">
- </div>
+ <label for="userConfirmationText"
+ class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
+ {{ $shortConfirmationLabel }}
+ </label>
+ <input type="text" x-model="userConfirmationText"
+ class="p-2 mt-1 w-full text-black rounded input">
+ </div>
@endif
</div>
<!-- Step 3: Password confirmation -->
<div x-show="step === 3 && confirmWithPassword">
- <div class="bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-4" role="alert">
+ <div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
<p class="font-bold">Final Confirmation</p>
<p>Please enter your password to confirm this destructive action.</p>
</div>
- <div class="mb-4">
- <label for="password-confirm" class="block text-sm font-medium text-gray-700 dark:text-gray-300">
+ <div class="flex flex-col gap-2 mb-4">
+ <label for="password-confirm"
+ class="block text-sm font-medium text-gray-700 dark:text-gray-300">
Your Password
</label>
- <input type="password" id="password-confirm" x-model="password" class="input w-full" placeholder="Enter your password">
- <p x-show="passwordError" x-text="passwordError" class="text-red-500 text-sm mt-1"></p>
+ <input type="password" id="password-confirm" x-model="password" class="w-full input">
+ <p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500"></p>
@error('password')
- <p class="text-red-500 text-sm mt-1">{{ $message }}</p>
+ <p class="mt-1 text-sm text-red-500">{{ $message }}</p>
@enderror
</div>
</div>
</div>
<!-- Navigation buttons -->
- <div class="flex flex-wrap justify-between mt-4 gap-2">
+ <div class="flex flex-wrap gap-2 justify-between mt-4">
<template x-if="step > initialStep">
<x-forms.button @click="step--" class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
Back
</x-forms.button>
</template>
<template x-if="step === initialStep">
- <x-forms.button @click="modalOpen = false; resetModal()" class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
+ <x-forms.button @click="modalOpen = false; resetModal()"
+ class="w-24 dark:bg-coolgray-200 dark:hover:bg-coolgray-300">
Cancel
</x-forms.button>
</template>
@@ -274,7 +306,9 @@
</template>
<template x-if="step === 2">
- <x-forms.button x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText" class="w-auto" isError @click="
+ <x-forms.button x-bind:disabled="confirmWithText && userConfirmationText !== confirmationText"
+ class="w-auto" isError
+ @click="
if (dispatchEvent) {
$wire.dispatch(dispatchEventType, dispatchEventMessage);
}
@@ -290,7 +324,8 @@
</template>
<template x-if="step === 3 && confirmWithPassword">
- <x-forms.button x-bind:disabled="!password" class="w-auto" isError @click="
+ <x-forms.button x-bind:disabled="!password" class="w-auto" isError
+ @click="
if (dispatchEvent) {
$wire.dispatch(dispatchEventType, dispatchEventMessage);
}
diff --git a/resources/views/livewire/project/shared/danger.blade.php b/resources/views/livewire/project/shared/danger.blade.php
index 61a891e69a..cc9ce86ffc 100644
--- a/resources/views/livewire/project/shared/danger.blade.php
+++ b/resources/views/livewire/project/shared/danger.blade.php
@@ -2,20 +2,10 @@
<h2>Danger Zone</h2>
<div class="">Woah. I hope you know what are you doing.</div>
<h4 class="pt-4">Delete Resource</h4>
- <div class="pb-4">This will stop your containers, delete all related data, etc. Beware! There is no coming back!</div>
- <x-modal-confirmation
- title="Confirm Resource Deletion?"
- buttonTitle="Delete Resource"
- isErrorButton
- submitAction="delete"
- buttonTitle="Delete Resource"
- :checkboxes="$checkboxes"
- :actions="[
- 'All containers of this resource will be stopped and permanently deleted.'
- ]"
- confirmationText="{{ $resourceName }}"
- confirmationLabel="Please confirm the execution of the actions by entering the Resource Name below"
- shortConfirmationLabel="Resource Name"
- step3ButtonText="Permanently Delete Resource"
- />
+ <div class="pb-4">This will stop your containers, delete all related data, etc. Beware! There is no coming back!
+ </div>
+ <x-modal-confirmation title="Confirm Resource Deletion?" buttonTitle="Delete" isErrorButton submitAction="delete"
+ buttonTitle="Delete" :checkboxes="$checkboxes" :actions="['All containers of this resource will be stopped and permanently deleted.']" confirmationText="{{ $resourceName }}"
+ confirmationLabel="Please confirm the execution of the actions by entering the name of the resource below."
+ shortConfirmationLabel="Resource Name" step3ButtonText="Permanently Delete" />
</div>