2023-07-13 11:16:24 +00:00
< div >
2023-08-09 14:47:24 +00:00
< h2 > Danger Zone </ h2 >
2023-06-16 10:35:40 +00:00
< div class = " " > Woah . I hope you know what are you doing .</ div >
2023-08-07 20:14:21 +00:00
< h4 class = " pt-4 " > Delete Resource </ h4 >
2023-06-16 13:56:25 +00:00
< div class = " pb-4 " > This will stop your containers , delete all related data , etc . Beware ! There is no coming
2023-06-02 10:34:45 +00:00
back !
2023-05-31 08:19:29 +00:00
</ div >
2024-08-27 10:43:59 +00:00
2024-04-12 10:44:49 +00:00
< x - modal - confirmation isErrorButton buttonTitle = " Delete " confirm = {{ $confirm }} >
2024-08-27 10:43:59 +00:00
< div x - data = " { step: 1, deleteText: '', selectedActions: [], getActionText(action) {
const actionTexts = {
'delete_volumes' : 'Delete associated volumes' ,
'delete_connected_networks' : 'Delete connected networks' ,
'delete_configurations' : 'Delete configuration files' ,
'delete_images' : 'Delete associated unused images'
};
return actionTexts [ action ] || action ;
} } " >
<!-- Step 1 : Select actions -->
< div x - show = " step === 1 " >
< div class = " px-2 mb-4 " > Select the actions you want to perform :</ div >
< x - forms . checkbox id = " delete_volumes " wire : model = " delete_volumes " label = " Permanently delete associated volumes? " ></ x - forms . checkbox >
< x - forms . checkbox id = " delete_connected_networks " wire : model = " delete_connected_networks " label = " Permanently delete connected networks, predefined networks are not deleted? " ></ x - forms . checkbox >
< x - forms . checkbox id = " delete_configurations " wire : model = " delete_configurations " label = " Permanently delete configuration files from the server? " ></ x - forms . checkbox >
< x - forms . checkbox id = " delete_images " wire : model = " delete_images " label = " Permanently delete associated unused images? " ></ x - forms . checkbox >
< div class = " flex justify-between mt-4 " >
< x - forms . button @ click = " $dispatch ('close-modal') " > Cancel </ x - forms . button >
< x - forms . button
x - show = " step === 1 "
@ click = " step = 2; selectedActions = [ $wire .delete_volumes ? 'delete_volumes' : null, $wire .delete_connected_networks ? 'delete_connected_networks' : null, $wire .delete_configurations ? 'delete_configurations' : null, $wire .delete_images ? 'delete_images' : null].filter(Boolean) "
x - bind : disabled = " !( $wire .delete_volumes || $wire .delete_connected_networks || $wire .delete_configurations || $wire .delete_images) "
class = " w-24 bg-red-600 text-white hover:bg-red-700 "
type = " button "
>
Continue
</ x - forms . button >
</ div >
</ div >
<!-- 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 " >
< p class = " font-bold " > Warning </ p >
< p > This operation is not reversible . Please proceed with caution .</ p >
</ div >
< div class = " px-2 mb-4 " > The following actions will be performed :</ div >
< ul class = " mb-4 space-y-2 " >
< template x - for = " action in selectedActions " : key = " action " >
< li class = " flex items-center text-red-500 " >
< svg class = " w-4 h-4 mr-2 " 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 x - text = " getActionText(action) " class = " font-bold " ></ span >
</ li >
</ template >
</ ul >
< div class = " text-black dark:text-white mb-4 " > Please type < span class = " text-red-500 font-bold " > DELETE </ span > to confirm this destructive action :</ div >
< input type = " text " x - model = " deleteText " class = " w-full p-2 border border-violet-500 rounded mb-4 bg-violet-100 text-black focus:outline-none focus:ring-2 focus:ring-coolify-500 " >
< div class = " flex justify-between " >
< x - forms . button @ click = " step = 1 " > Back </ x - forms . button >
< x - forms . button
isError
type = " button "
@ click = " $wire .delete(selectedActions) "
x - bind : disabled = " deleteText !== 'DELETE' "
>
Permanently Delete
</ x - forms . button >
</ div >
</ div >
</ div >
2024-03-20 11:54:06 +00:00
</ x - modal - confirmation >
2024-08-27 10:43:59 +00:00
</ div >