refactor: Update Docker cleanup label in Heading.php and Navbar.php
This commit is contained in:
@@ -142,8 +142,8 @@ class Heading extends Component
|
|||||||
{
|
{
|
||||||
return view('livewire.project.application.heading', [
|
return view('livewire.project.application.heading', [
|
||||||
'checkboxes' => [
|
'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' => __('resource.docker_cleanup')],
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,6 +21,7 @@ class Navbar extends Component
|
|||||||
public $isDeploymentProgress = false;
|
public $isDeploymentProgress = false;
|
||||||
|
|
||||||
public $docker_cleanup = true;
|
public $docker_cleanup = true;
|
||||||
|
|
||||||
public $title = 'Configuration';
|
public $title = 'Configuration';
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
@@ -119,9 +120,8 @@ class Navbar extends Component
|
|||||||
{
|
{
|
||||||
return view('livewire.project.service.navbar', [
|
return view('livewire.project.service.navbar', [
|
||||||
'checkboxes' => [
|
'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' => __('resource.docker_cleanup')],
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -3,9 +3,9 @@
|
|||||||
namespace App\Livewire\Project\Service;
|
namespace App\Livewire\Project\Service;
|
||||||
|
|
||||||
use App\Models\ServiceApplication;
|
use App\Models\ServiceApplication;
|
||||||
use Livewire\Component;
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
class ServiceApplicationView extends Component
|
class ServiceApplicationView extends Component
|
||||||
{
|
{
|
||||||
@@ -14,8 +14,8 @@ class ServiceApplicationView extends Component
|
|||||||
public $parameters;
|
public $parameters;
|
||||||
|
|
||||||
public $docker_cleanup = true;
|
public $docker_cleanup = true;
|
||||||
|
|
||||||
public $delete_volumes = true;
|
public $delete_volumes = true;
|
||||||
|
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'application.human_name' => 'nullable',
|
'application.human_name' => 'nullable',
|
||||||
@@ -29,7 +29,7 @@ class ServiceApplicationView extends Component
|
|||||||
'application.is_stripprefix_enabled' => 'nullable|boolean',
|
'application.is_stripprefix_enabled' => 'nullable|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function updatedApplicationFqdn()
|
public function updatedApplicationFqdn()
|
||||||
{
|
{
|
||||||
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
|
$this->application->fqdn = str($this->application->fqdn)->replaceEnd(',', '')->trim();
|
||||||
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
|
$this->application->fqdn = str($this->application->fqdn)->replaceStart(',', '')->trim();
|
||||||
@@ -59,8 +59,9 @@ class ServiceApplicationView extends Component
|
|||||||
|
|
||||||
public function delete($password)
|
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.');
|
$this->addError('password', 'The provided password is incorrect.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,12 +103,12 @@ class ServiceApplicationView extends Component
|
|||||||
{
|
{
|
||||||
return view('livewire.project.service.service-application-view', [
|
return view('livewire.project.service.service-application-view', [
|
||||||
'checkboxes' => [
|
'checkboxes' => [
|
||||||
['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted'],
|
['id' => 'delete_volumes', 'label' => __('resource.delete_volumes')],
|
||||||
['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images'],
|
['id' => 'docker_cleanup', 'label' => __('resource.docker_cleanup')],
|
||||||
// ['id' => 'delete_associated_backups_locally', 'label' => 'All backups associated with this Ressource will be permanently deleted from local storage.'],
|
// ['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_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.']
|
// ['id' => 'delete_associated_backups_sftp', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected SFTP Storage.']
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,24 +4,33 @@ namespace App\Livewire\Project\Shared;
|
|||||||
|
|
||||||
use App\Jobs\DeleteResourceJob;
|
use App\Jobs\DeleteResourceJob;
|
||||||
use App\Models\Service;
|
use App\Models\Service;
|
||||||
use App\Models\ServiceDatabase;
|
|
||||||
use App\Models\ServiceApplication;
|
use App\Models\ServiceApplication;
|
||||||
|
use App\Models\ServiceDatabase;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
use Livewire\Component;
|
use Livewire\Component;
|
||||||
use Visus\Cuid2\Cuid2;
|
use Visus\Cuid2\Cuid2;
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
|
|
||||||
class Danger extends Component
|
class Danger extends Component
|
||||||
{
|
{
|
||||||
public $resource;
|
public $resource;
|
||||||
|
|
||||||
public $resourceName;
|
public $resourceName;
|
||||||
|
|
||||||
public $projectUuid;
|
public $projectUuid;
|
||||||
|
|
||||||
public $environmentName;
|
public $environmentName;
|
||||||
|
|
||||||
public bool $delete_configurations = true;
|
public bool $delete_configurations = true;
|
||||||
|
|
||||||
public bool $delete_volumes = true;
|
public bool $delete_volumes = true;
|
||||||
|
|
||||||
public bool $docker_cleanup = true;
|
public bool $docker_cleanup = true;
|
||||||
|
|
||||||
public bool $delete_connected_networks = true;
|
public bool $delete_connected_networks = true;
|
||||||
|
|
||||||
public ?string $modalId = null;
|
public ?string $modalId = null;
|
||||||
|
|
||||||
public string $resourceDomain = '';
|
public string $resourceDomain = '';
|
||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
@@ -42,11 +51,13 @@ class Danger extends Component
|
|||||||
|
|
||||||
if ($this->resource === null) {
|
if ($this->resource === null) {
|
||||||
$this->resourceName = 'Unknown Resource';
|
$this->resourceName = 'Unknown Resource';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!method_exists($this->resource, 'type')) {
|
if (! method_exists($this->resource, 'type')) {
|
||||||
$this->resourceName = 'Unknown Resource';
|
$this->resourceName = 'Unknown Resource';
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -80,13 +91,15 @@ class Danger extends Component
|
|||||||
|
|
||||||
public function delete($password)
|
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.');
|
$this->addError('password', 'The provided password is incorrect.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->resource) {
|
if (! $this->resource) {
|
||||||
$this->addError('resource', 'Resource not found.');
|
$this->addError('resource', 'Resource not found.');
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,14 +126,14 @@ class Danger extends Component
|
|||||||
{
|
{
|
||||||
return view('livewire.project.shared.danger', [
|
return view('livewire.project.shared.danger', [
|
||||||
'checkboxes' => [
|
'checkboxes' => [
|
||||||
['id' => 'delete_volumes', 'label' => 'All associated volumes with this resource will be permanently deleted'],
|
['id' => 'delete_volumes', 'label' => __('resource.delete_volumes')],
|
||||||
['id' => 'delete_connected_networks', 'label' => 'All connected networks with this resource will be permanently deleted (predefined networks will not be deleted)'],
|
['id' => 'delete_connected_networks', 'label' => __('resource.delete_connected_networks')],
|
||||||
['id' => 'delete_configurations', 'label' => 'All configuration files will be permanently deleted form the server'],
|
['id' => 'delete_configurations', 'label' => __('resource.delete_configurations')],
|
||||||
['id' => 'docker_cleanup', 'label' => 'Docker cleanup will be run on the server which removes builder cache and unused images'],
|
['id' => 'docker_cleanup', 'label' => __('resource.docker_cleanup')],
|
||||||
// ['id' => 'delete_associated_backups_locally', 'label' => 'All backups associated with this Ressource will be permanently deleted from local storage.'],
|
// ['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_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.']
|
// ['id' => 'delete_associated_backups_sftp', 'label' => 'All backups associated with this Ressource will be permanently deleted from the selected SFTP Storage.']
|
||||||
]
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,5 +26,11 @@
|
|||||||
"input.code": "One-time code",
|
"input.code": "One-time code",
|
||||||
"input.recovery_code": "Recovery code",
|
"input.recovery_code": "Recovery code",
|
||||||
"button.save": "Save",
|
"button.save": "Save",
|
||||||
"repository.url": "<span class='text-helper'>Examples</span><br>For Public repositories, use <span class='text-helper'>https://...</span>.<br>For Private repositories, use <span class='text-helper'>git@...</span>.<br><br>https://github.com/coollabsio/coolify-examples <span class='text-helper'>main</span> branch will be selected<br>https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify <span class='text-helper'>nodejs-fastify</span> branch will be selected.<br>https://gitea.com/sedlav/expressjs.git <span class='text-helper'>main</span> branch will be selected.<br>https://gitlab.com/andrasbacsai/nodejs-example.git <span class='text-helper'>main</span> branch will be selected."
|
"repository.url": "<span class='text-helper'>Examples</span><br>For Public repositories, use <span class='text-helper'>https://...</span>.<br>For Private repositories, use <span class='text-helper'>git@...</span>.<br><br>https://github.com/coollabsio/coolify-examples <span class='text-helper'>main</span> branch will be selected<br>https://github.com/coollabsio/coolify-examples/tree/nodejs-fastify <span class='text-helper'>nodejs-fastify</span> branch will be selected.<br>https://gitea.com/sedlav/expressjs.git <span class='text-helper'>main</span> branch will be selected.<br>https://gitlab.com/andrasbacsai/nodejs-example.git <span class='text-helper'>main</span> branch will be selected.",
|
||||||
|
"service.stop": "This service will be stopped.",
|
||||||
|
"resource.docker_cleanup": "Run Docker Cleanup (remove unused images and builder cache).",
|
||||||
|
"resource.non_persistent": "All non-persistent data will be deleted.",
|
||||||
|
"resource.delete_volumes": "All volumes associated with this resource will be permanently deleted.",
|
||||||
|
"resource.delete_connected_networks": "All non-predefined networks associated with this resource will be permanently deleted.",
|
||||||
|
"resource.delete_configurations": "All configuration files will be permanently deleted from the server."
|
||||||
}
|
}
|
||||||
|
@@ -1,25 +1,25 @@
|
|||||||
@props([
|
@props([
|
||||||
'title' => 'Are you sure?',
|
'title' => 'Are you sure?',
|
||||||
'isErrorButton' => false,
|
'isErrorButton' => false,
|
||||||
'buttonTitle' => 'Confirm Action',
|
'buttonTitle' => 'Confirm Action',
|
||||||
'buttonFullWidth' => false,
|
'buttonFullWidth' => false,
|
||||||
'customButton' => null,
|
'customButton' => null,
|
||||||
'disabled' => false,
|
'disabled' => false,
|
||||||
'submitAction' => 'delete',
|
'submitAction' => 'delete',
|
||||||
'content' => null,
|
'content' => null,
|
||||||
'checkboxes' => [],
|
'checkboxes' => [],
|
||||||
'actions' => [],
|
'actions' => [],
|
||||||
'confirmWithText' => true,
|
'confirmWithText' => true,
|
||||||
'confirmationText' => 'Confirm Deletion',
|
'confirmationText' => 'Confirm Deletion',
|
||||||
'confirmationLabel' => 'Please confirm the execution of the actions by entering the Name below',
|
'confirmationLabel' => 'Please confirm the execution of the actions by entering the Name below',
|
||||||
'shortConfirmationLabel' => 'Name',
|
'shortConfirmationLabel' => 'Name',
|
||||||
'confirmWithPassword' => true,
|
'confirmWithPassword' => true,
|
||||||
'step1ButtonText' => 'Continue Deletion',
|
'step1ButtonText' => 'Continue',
|
||||||
'step2ButtonText' => 'Delete Permanently',
|
'step2ButtonText' => 'Continue',
|
||||||
'step3ButtonText' => 'Confirm Permanent Deletion',
|
'step3ButtonText' => 'Confirm',
|
||||||
'dispatchEvent' => false,
|
'dispatchEvent' => false,
|
||||||
'dispatchEventType' => 'success',
|
'dispatchEventType' => 'success',
|
||||||
'dispatchEventMessage' => '',
|
'dispatchEventMessage' => '',
|
||||||
])
|
])
|
||||||
|
|
||||||
<div x-data="{
|
<div x-data="{
|
||||||
@@ -99,157 +99,189 @@
|
|||||||
this.selectedActions.push(id);
|
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 ($customButton)
|
||||||
@if ($buttonFullWidth)
|
@if ($buttonFullWidth)
|
||||||
<x-forms.button @click="modalOpen=true" class="w-full">
|
<x-forms.button @click="modalOpen=true" class="w-full">
|
||||||
{{ $customButton }}
|
{{ $customButton }}
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
|
@else
|
||||||
|
<x-forms.button @click="modalOpen=true">
|
||||||
|
{{ $customButton }}
|
||||||
|
</x-forms.button>
|
||||||
|
@endif
|
||||||
@else
|
@else
|
||||||
<x-forms.button @click="modalOpen=true">
|
@if ($content)
|
||||||
{{ $customButton }}
|
<div @click="modalOpen=true">
|
||||||
</x-forms.button>
|
{{ $content }}
|
||||||
@endif
|
</div>
|
||||||
@else
|
@else
|
||||||
@if ($content)
|
@if ($disabled)
|
||||||
<div @click="modalOpen=true">
|
@if ($buttonFullWidth)
|
||||||
{{ $content }}
|
<x-forms.button class="w-full" isError disabled wire:target>
|
||||||
</div>
|
{{ $buttonTitle }}
|
||||||
@else
|
</x-forms.button>
|
||||||
@if ($disabled)
|
@else
|
||||||
@if ($buttonFullWidth)
|
<x-forms.button isError disabled wire:target>
|
||||||
<x-forms.button class="w-full" isError disabled wire:target>
|
{{ $buttonTitle }}
|
||||||
{{ $buttonTitle }}
|
</x-forms.button>
|
||||||
</x-forms.button>
|
@endif
|
||||||
@else
|
@elseif ($isErrorButton)
|
||||||
<x-forms.button isError disabled wire:target>
|
@if ($buttonFullWidth)
|
||||||
{{ $buttonTitle }}
|
<x-forms.button class="w-full" isError @click="modalOpen=true">
|
||||||
</x-forms.button>
|
{{ $buttonTitle }}
|
||||||
@endif
|
</x-forms.button>
|
||||||
@elseif ($isErrorButton)
|
@else
|
||||||
@if ($buttonFullWidth)
|
<x-forms.button isError @click="modalOpen=true">
|
||||||
<x-forms.button class="w-full" isError @click="modalOpen=true">
|
{{ $buttonTitle }}
|
||||||
{{ $buttonTitle }}
|
</x-forms.button>
|
||||||
</x-forms.button>
|
@endif
|
||||||
@else
|
@else
|
||||||
<x-forms.button isError @click="modalOpen=true">
|
@if ($buttonFullWidth)
|
||||||
{{ $buttonTitle }}
|
<x-forms.button @click="modalOpen=true" class="flex w-full gap-2" wire:target>
|
||||||
</x-forms.button>
|
{{ $buttonTitle }}
|
||||||
@endif
|
</x-forms.button>
|
||||||
@else
|
@else
|
||||||
@if ($buttonFullWidth)
|
<x-forms.button @click="modalOpen=true" class="flex gap-2" wire:target>
|
||||||
<x-forms.button @click="modalOpen=true" class="flex w-full gap-2" wire:target>
|
{{ $buttonTitle }}
|
||||||
{{ $buttonTitle }}
|
</x-forms.button>
|
||||||
</x-forms.button>
|
@endif
|
||||||
@else
|
@endif
|
||||||
<x-forms.button @click="modalOpen=true" class="flex gap-2" wire:target>
|
@endif
|
||||||
{{ $buttonTitle }}
|
|
||||||
</x-forms.button>
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
@endif
|
|
||||||
@endif
|
@endif
|
||||||
<template x-teleport="body">
|
<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.away="modalOpen = false; resetModal()"
|
||||||
<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>
|
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" 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 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">
|
<div class="flex items-center justify-between pb-3">
|
||||||
<h3 class="text-2xl font-bold pr-8">{{ $title }}</h3>
|
<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">
|
<button @click="modalOpen = false; resetModal()"
|
||||||
<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">
|
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">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="relative w-auto pb-8">
|
<div class="relative w-auto pb-8">
|
||||||
@if(!empty($checkboxes))
|
@if (!empty($checkboxes))
|
||||||
<!-- Step 1: Select actions -->
|
<!-- Step 1: Select actions -->
|
||||||
<div x-show="step === 1">
|
<div x-show="step === 1">
|
||||||
<div class="flex justify-between items-center mb-4">
|
<div class="flex justify-between items-center">
|
||||||
<div class="px-2">Select the actions you want to perform:</div>
|
<h4>Actions</h4>
|
||||||
|
</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>
|
||||||
|
@endforeach
|
||||||
</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>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<!-- Step 2: Confirm deletion -->
|
<!-- Step 2: Confirm deletion -->
|
||||||
<div x-show="step === 2">
|
<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="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
|
||||||
<p class="font-bold">Warning</p>
|
<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>
|
||||||
<div class="px-2 mb-4">The following actions will be performed:</div>
|
<div class="px-2 mb-4">The following actions will be performed:</div>
|
||||||
<ul class="mb-4 space-y-2">
|
<ul class="mb-4 space-y-2">
|
||||||
@foreach($actions as $action)
|
@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'] }}')">
|
|
||||||
<li class="flex items-center text-red-500">
|
<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">
|
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor"
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
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>
|
</svg>
|
||||||
<span>{{ $checkbox['label'] }}</span>
|
<span>{{ $action }}</span>
|
||||||
</li>
|
</li>
|
||||||
</template>
|
@endforeach
|
||||||
|
@foreach ($checkboxes as $checkbox)
|
||||||
|
<template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
|
||||||
|
<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>{{ $checkbox['label'] }}</span>
|
||||||
|
</li>
|
||||||
|
</template>
|
||||||
@endforeach
|
@endforeach
|
||||||
</ul>
|
</ul>
|
||||||
@if($confirmWithText)
|
@if ($confirmWithText)
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<h4 class="text-lg font-semibold mb-2">Confirm Actions</h4>
|
<h4 class="text-lg font-semibold mb-2">Confirm Actions</h4>
|
||||||
<p class="text-sm mb-2">{{ $confirmationLabel }}</p>
|
<p class="text-sm mb-2">{{ $confirmationLabel }}</p>
|
||||||
|
|
||||||
<div class="relative mb-2">
|
<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>
|
<input type="text" x-model="confirmationText"
|
||||||
<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">
|
class="w-full p-2 pr-10 rounded text-black input cursor-text" readonly>
|
||||||
<template x-if="!copied">
|
<button @click="copyConfirmationText()"
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor">
|
class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-500 hover:text-gray-700"
|
||||||
<path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
|
title="Copy confirmation text" x-ref="copyButton">
|
||||||
<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" />
|
<template x-if="!copied">
|
||||||
</svg>
|
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20"
|
||||||
</template>
|
fill="currentColor">
|
||||||
<template x-if="copied">
|
<path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-500" viewBox="0 0 20 20" fill="currentColor">
|
<path
|
||||||
<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" />
|
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>
|
</svg>
|
||||||
</template>
|
</template>
|
||||||
</button>
|
<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>
|
||||||
|
|
||||||
|
<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>
|
</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>
|
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Step 3: Password confirmation -->
|
<!-- Step 3: Password confirmation -->
|
||||||
<div x-show="step === 3 && confirmWithPassword">
|
<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="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
|
||||||
<p class="font-bold">Final Confirmation</p>
|
<p class="font-bold">Final Confirmation</p>
|
||||||
<p>Please enter your password to confirm this destructive action.</p>
|
<p>Please enter your password to confirm this destructive action.</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">
|
<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">
|
<label for="password-confirm"
|
||||||
|
class="block text-sm font-medium text-gray-700 dark:text-gray-300">
|
||||||
Your Password
|
Your Password
|
||||||
</label>
|
</label>
|
||||||
<input type="password" id="password-confirm" x-model="password" class="input w-full" placeholder="Enter your password">
|
<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>
|
<p x-show="passwordError" x-text="passwordError" class="text-red-500 text-sm mt-1"></p>
|
||||||
@error('password')
|
@error('password')
|
||||||
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
|
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
|
||||||
@enderror
|
@enderror
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -262,7 +294,8 @@
|
|||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</template>
|
</template>
|
||||||
<template x-if="step === initialStep">
|
<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
|
Cancel
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
</template>
|
</template>
|
||||||
@@ -274,7 +307,9 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="step === 2">
|
<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) {
|
if (dispatchEvent) {
|
||||||
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
||||||
}
|
}
|
||||||
@@ -290,7 +325,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template x-if="step === 3 && confirmWithPassword">
|
<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) {
|
if (dispatchEvent) {
|
||||||
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
$wire.dispatch(dispatchEventType, dispatchEventMessage);
|
||||||
}
|
}
|
||||||
|
@@ -22,73 +22,60 @@
|
|||||||
</nav>
|
</nav>
|
||||||
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
||||||
@if (str($service->status())->contains('running'))
|
@if (str($service->status())->contains('running'))
|
||||||
<button @click="$wire.dispatch('restartEvent')" class="gap-2 button">
|
<button @click="$wire.dispatch('restartEvent')" class="gap-2 button">
|
||||||
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||||
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
stroke-width="2">
|
||||||
<path d="M20 4v5h-5" />
|
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
||||||
</g>
|
<path d="M20 4v5h-5" />
|
||||||
</svg>
|
</g>
|
||||||
Pull Latest Images & Restart
|
|
||||||
</button>
|
|
||||||
<x-modal-confirmation
|
|
||||||
title="Confirm Service Stopping?"
|
|
||||||
buttonTitle="Stop"
|
|
||||||
submitAction="stop"
|
|
||||||
:checkboxes="$checkboxes"
|
|
||||||
:actions="['This service will be stopped.', 'If the service is currently in use data could be lost.', 'All non-persistent data of this service (containers, networks, unused images) will be deleted (don\'t worry, no data is lost and you can start the service again).']"
|
|
||||||
:confirmWithText="false"
|
|
||||||
:confirmWithPassword="false"
|
|
||||||
step1ButtonText="Continue Stopping Service"
|
|
||||||
step2ButtonText="Stop Service"
|
|
||||||
:dispatchEvent="true"
|
|
||||||
dispatchEventType="stopEvent"
|
|
||||||
>
|
|
||||||
<x-slot:button-title>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
</svg>
|
</svg>
|
||||||
Stop
|
Pull Latest Images & Restart
|
||||||
</x-slot:button-title>
|
</button>
|
||||||
</x-modal-confirmation>
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue"
|
||||||
|
step2ButtonText="Stop Service" :dispatchEvent="true" dispatchEventType="stopEvent">
|
||||||
|
<x-slot:button-title>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
</x-modal-confirmation>
|
||||||
@elseif (str($service->status())->contains('degraded'))
|
@elseif (str($service->status())->contains('degraded'))
|
||||||
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
||||||
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||||
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
stroke-width="2">
|
||||||
<path d="M20 4v5h-5" />
|
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
||||||
</g>
|
<path d="M20 4v5h-5" />
|
||||||
</svg>
|
</g>
|
||||||
Restart Degraded Services
|
|
||||||
</button>
|
|
||||||
<x-modal-confirmation
|
|
||||||
title="Confirm Service Stopping?"
|
|
||||||
buttonTitle="Stop"
|
|
||||||
submitAction="stop"
|
|
||||||
:checkboxes="$checkboxes"
|
|
||||||
:actions="['This service will be stopped.', 'If the service is currently in use data could be lost.', 'All non-persistent data of this service (containers, networks, unused images) will be deleted (don\'t worry, no data is lost and you can start the service again).']"
|
|
||||||
:confirmWithText="false"
|
|
||||||
:confirmWithPassword="false"
|
|
||||||
step1ButtonText="Continue Stopping Service"
|
|
||||||
step2ButtonText="Stop Service"
|
|
||||||
:dispatchEvent="true"
|
|
||||||
dispatchEventType="stopEvent"
|
|
||||||
>
|
|
||||||
<x-slot:button-title>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
</svg>
|
</svg>
|
||||||
Stop
|
Restart Degraded Services
|
||||||
</x-slot:button-title>
|
</button>
|
||||||
</x-modal-confirmation>
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
||||||
|
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
||||||
|
dispatchEventType="stopEvent">
|
||||||
|
<x-slot:button-title>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
</x-modal-confirmation>
|
||||||
@elseif (str($service->status())->contains('exited'))
|
@elseif (str($service->status())->contains('exited'))
|
||||||
<button wire:click='stop(true)' class="gap-2 button">
|
<button wire:click='stop(true)' class="gap-2 button">
|
||||||
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||||
@@ -108,59 +95,54 @@
|
|||||||
Deploy
|
Deploy
|
||||||
</button>
|
</button>
|
||||||
@else
|
@else
|
||||||
<x-modal-confirmation
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
title="Confirm Service Stopping?"
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
||||||
buttonTitle="Stop"
|
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
||||||
submitAction="stop"
|
dispatchEventType="stopEvent">
|
||||||
:checkboxes="$checkboxes"
|
<x-slot:button-title>
|
||||||
:actions="['This service will be stopped.', 'If the service is currently in use data could be lost.', 'All non-persistent data of this service (containers, networks, unused images) will be deleted (don\'t worry, no data is lost and you can start the service again).']"
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
:confirmWithText="false"
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
:confirmWithPassword="false"
|
stroke-linejoin="round">
|
||||||
step1ButtonText="Continue Stopping Service"
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
step2ButtonText="Stop Service"
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
:dispatchEvent="true"
|
</path>
|
||||||
dispatchEventType="stopEvent"
|
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
>
|
</path>
|
||||||
<x-slot:button-title>
|
</svg>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
Stop
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
</x-slot:button-title>
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
</x-modal-confirmation>
|
||||||
</path>
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
||||||
</path>
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||||
|
<path d="M7 4v16l13 -8z" />
|
||||||
</svg>
|
</svg>
|
||||||
Stop
|
Deploy
|
||||||
</x-slot:button-title>
|
</button>
|
||||||
</x-modal-confirmation>
|
|
||||||
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
||||||
<path d="M7 4v16l13 -8z" />
|
|
||||||
</svg>
|
|
||||||
Deploy
|
|
||||||
</button>
|
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@script
|
@script
|
||||||
<script>
|
<script>
|
||||||
$wire.$on('stopEvent', () => {
|
$wire.$on('stopEvent', () => {
|
||||||
$wire.$dispatch('info', 'Stopping service.');
|
$wire.$dispatch('info', 'Stopping service.');
|
||||||
$wire.$call('stop');
|
$wire.$call('stop');
|
||||||
});
|
});
|
||||||
$wire.$on('startEvent', () => {
|
$wire.$on('startEvent', () => {
|
||||||
window.dispatchEvent(new CustomEvent('startservice'));
|
window.dispatchEvent(new CustomEvent('startservice'));
|
||||||
$wire.$call('start');
|
$wire.$call('start');
|
||||||
});
|
});
|
||||||
$wire.$on('restartEvent', () => {
|
$wire.$on('restartEvent', () => {
|
||||||
$wire.$dispatch('info', 'Pulling new images.');
|
$wire.$dispatch('info', 'Pulling new images.');
|
||||||
$wire.$call('restart');
|
$wire.$call('restart');
|
||||||
});
|
});
|
||||||
$wire.on('imagePulled', () => {
|
$wire.on('imagePulled', () => {
|
||||||
window.dispatchEvent(new CustomEvent('startservice'));
|
window.dispatchEvent(new CustomEvent('startservice'));
|
||||||
$wire.$dispatch('info', 'Restarting service.');
|
$wire.$dispatch('info', 'Restarting service.');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
@endscript
|
@endscript
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@@ -2,20 +2,10 @@
|
|||||||
<h2>Danger Zone</h2>
|
<h2>Danger Zone</h2>
|
||||||
<div class="">Woah. I hope you know what are you doing.</div>
|
<div class="">Woah. I hope you know what are you doing.</div>
|
||||||
<h4 class="pt-4">Delete Resource</h4>
|
<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>
|
<div class="pb-4">This will stop your containers, delete all related data, etc. Beware! There is no coming back!
|
||||||
<x-modal-confirmation
|
</div>
|
||||||
title="Confirm Resource Deletion?"
|
<x-modal-confirmation title="Confirm Resource Deletion?" buttonTitle="Delete" isErrorButton submitAction="delete"
|
||||||
buttonTitle="Delete Resource"
|
buttonTitle="Delete" :checkboxes="$checkboxes" :actions="['All containers of this resource will be stopped and permanently deleted.']" confirmationText="{{ $resourceName }}"
|
||||||
isErrorButton
|
confirmationLabel="Please confirm the execution of the actions by entering the NAME of the resource below"
|
||||||
submitAction="delete"
|
shortConfirmationLabel="Resource Name" step3ButtonText="Delete Permanently" />
|
||||||
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>
|
</div>
|
||||||
|
Reference in New Issue
Block a user