Feat: confirm ressource operation

This commit is contained in:
ayntk-ai
2024-09-04 19:34:47 +02:00
parent c16e914be4
commit a29353c1ae

View File

@@ -8,7 +8,20 @@
@foreach ($servers->sortBy('id') as $server) @foreach ($servers->sortBy('id') as $server)
<h5>Server: <span class="font-bold text-dark dark:text-white">{{ $server->name }}</span></h5> <h5>Server: <span class="font-bold text-dark dark:text-white">{{ $server->name }}</span></h5>
@foreach ($server->destinations() as $destination) @foreach ($server->destinations() as $destination)
<x-modal-confirmation action="cloneTo({{ data_get($destination, 'id') }})"> <x-modal-confirmation
title="Clone Resource?"
buttonTitle="Clone Resource"
submitAction="cloneTo({{ data_get($destination, 'id') }})"
:actions="[
'All containers of this resource will be duplicated and cloned to the selected destination.'
]"
:confirmWithText="false"
:confirmWithPassword="false"
step2ButtonText="Clone Resource"
dispatchEvent="true"
dispatchEventType="success"
dispatchEventMessage="Resource cloned to {{ $destination->name }} destination."
>
<x:slot name="content"> <x:slot name="content">
<div class="box group"> <div class="box group">
<div class="flex flex-col"> <div class="flex flex-col">
@@ -17,7 +30,6 @@
</div> </div>
</div> </div>
</x:slot> </x:slot>
<div>You are about to clone this resource.</div>
</x-modal-confirmation> </x-modal-confirmation>
@endforeach @endforeach
@endforeach @endforeach
@@ -36,8 +48,21 @@
<h5>Project: <span class="font-bold text-dark dark:text-white">{{ $project->name }}</span></h5> <h5>Project: <span class="font-bold text-dark dark:text-white">{{ $project->name }}</span></h5>
@foreach ($project->environments as $environment) @foreach ($project->environments as $environment)
<x-modal-confirmation action="moveTo({{ data_get($environment, 'id') }})"> <x-modal-confirmation
<x:slot name="content"> title="Move Resource?"
buttonTitle="Move Resource"
submitAction="moveTo({{ data_get($environment, 'id') }})"
:actions="[
'All containers of this resource will be moved to the selected environment.'
]"
:confirmWithText="false"
:confirmWithPassword="false"
step2ButtonText="Move Resource"
dispatchEvent="true"
dispatchEventType="success"
dispatchEventMessage="Resource moved to {{ $environment->name }} environment."
>
<x:slot:content>
<div class="box group"> <div class="box group">
<div class="flex flex-col"> <div class="flex flex-col">
<div class="box-title">Environment</div> <div class="box-title">Environment</div>
@@ -45,7 +70,6 @@
</div> </div>
</div> </div>
</x:slot> </x:slot>
<div>You are about to move this resource.</div>
</x-modal-confirmation> </x-modal-confirmation>
@endforeach @endforeach
@empty @empty