Added confirmation modal for switching proxies
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
'content' => null,
|
'content' => null,
|
||||||
'checkboxes' => [],
|
'checkboxes' => [],
|
||||||
'actions' => [],
|
'actions' => [],
|
||||||
|
'warningMessage' => null,
|
||||||
'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',
|
||||||
@@ -228,7 +229,7 @@
|
|||||||
<div x-show="step === 2">
|
<div x-show="step === 2">
|
||||||
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" 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 class="font-bold">Warning</p>
|
||||||
<p>This operation is permanent and cannot be undone. Please think again before proceeding!
|
<p>{!! $warningMessage ?: 'This operation is permanent and cannot be undone. Please think again before proceeding!' !!}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="mb-4">The following actions will be performed:</div>
|
<div class="mb-4">The following actions will be performed:</div>
|
||||||
|
@@ -4,24 +4,22 @@
|
|||||||
<div x-init="$wire.loadProxyConfiguration">
|
<div x-init="$wire.loadProxyConfiguration">
|
||||||
@if ($selectedProxy !== 'NONE')
|
@if ($selectedProxy !== 'NONE')
|
||||||
<form wire:submit='submit'>
|
<form wire:submit='submit'>
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<h2>Configuration</h2>
|
<h2>Configuration</h2>
|
||||||
@if ($server->proxy->status === 'exited' || $server->proxy->status === 'removing')
|
@if ($server->proxy->status === 'exited' || $server->proxy->status === 'removing')
|
||||||
<x-forms.button canGate="update" :canResource="$server" wire:click.prevent="changeProxy">Switch
|
@can('update', $server)
|
||||||
Proxy</x-forms.button>
|
<x-modal-confirmation title="Confirm Proxy Switching?" buttonTitle="Switch Proxy"
|
||||||
@else
|
submitAction="changeProxy" :actions="[
|
||||||
<x-forms.button canGate="update" :canResource="$server" disabled
|
'Custom proxy configurations may be reset to their default settings.'
|
||||||
wire:click.prevent="changeProxy">Switch Proxy</x-forms.button>
|
]" warningMessage="This operation may cause issues. Please refer to the guide <a href='https://coolify.io/docs/knowledge-base/server/proxies#switch-between-proxies' target='_blank' class='underline text-white'>switching between proxies</a> before proceeding!" step2ButtonText="Switch Proxy" :confirmWithText="false" :confirmWithPassword="false">
|
||||||
@endif
|
</x-modal-confirmation>
|
||||||
<x-forms.button canGate="update" :canResource="$server" type="submit">Save</x-forms.button>
|
@endcan
|
||||||
</div>
|
@else
|
||||||
<div class="pb-4 "> <svg class="inline-flex w-6 h-6 mr-2 dark:text-warning" viewBox="0 0 256 256"
|
<x-forms.button canGate="update" :canResource="$server"
|
||||||
xmlns="http://www.w3.org/2000/svg">
|
wire:click="$dispatch('error', 'Currently running proxy must be stopped before switching proxy')">Switch Proxy</x-forms.button>
|
||||||
<path fill="currentColor"
|
@endif
|
||||||
d="M240.26 186.1L152.81 34.23a28.74 28.74 0 0 0-49.62 0L15.74 186.1a27.45 27.45 0 0 0 0 27.71A28.31 28.31 0 0 0 40.55 228h174.9a28.31 28.31 0 0 0 24.79-14.19a27.45 27.45 0 0 0 .02-27.71m-20.8 15.7a4.46 4.46 0 0 1-4 2.2H40.55a4.46 4.46 0 0 1-4-2.2a3.56 3.56 0 0 1 0-3.73L124 46.2a4.77 4.77 0 0 1 8 0l87.44 151.87a3.56 3.56 0 0 1 .02 3.73M116 136v-32a12 12 0 0 1 24 0v32a12 12 0 0 1-24 0m28 40a16 16 0 1 1-16-16a16 16 0 0 1 16 16" />
|
<x-forms.button canGate="update" :canResource="$server" type="submit">Save</x-forms.button>
|
||||||
</svg>Before switching proxies, please read <a class="underline dark:text-white"
|
</div>
|
||||||
href="https://coolify.io/docs/knowledge-base/server/proxies#switch-between-proxies">this</a>.
|
|
||||||
</div>
|
|
||||||
<h3>Advanced</h3>
|
<h3>Advanced</h3>
|
||||||
<div class="pb-4 w-96">
|
<div class="pb-4 w-96">
|
||||||
<x-forms.checkbox canGate="update" :canResource="$server"
|
<x-forms.checkbox canGate="update" :canResource="$server"
|
||||||
|
Reference in New Issue
Block a user