2024-02-04 15:54:12 +00:00
< form >
2024-06-07 09:01:10 +00:00
< x - slot : title >
{{ data_get_str ( $project , 'name' ) -> limit ( 10 ) }} > Clone | Coolify
</ x - slot >
2023-10-20 10:34:53 +00:00
< div class = " flex flex-col " >
2023-12-13 13:22:23 +00:00
< h1 > Clone </ h1 >
2024-03-20 11:54:06 +00:00
< div class = " subtitle " > Quickly clone all resources to a new project or environment .</ div >
2023-10-20 10:34:53 +00:00
</ div >
2024-02-04 15:54:12 +00:00
< x - forms . input required id = " newName " label = " New Name " />
< x - forms . button isHighlighted wire : click = " clone('project') " class = " mt-4 " > Clone to a new Project </ x - forms . button >
< x - forms . button isHighlighted wire : click = " clone('environment') " class = " mt-4 " > Clone to a new Environment </ x - forms . button >
2025-01-13 10:14:00 +00:00
{{ --
2025-01-08 22:13:05 +00:00
< div class = " mt-8 " >
< h3 class = " text-lg font-bold mb-2 " > Clone Volume Data </ h3 >
< div class = " text-sm text-gray-600 dark:text-gray-300 mb-4 " >
Clone your volume data to the new resources volumes . This process requires a brief container downtime to ensure data consistency .
</ div >
< div wire : poll >
@ if ( ! $cloneVolumeData )
< div wire : key = " volume-disabled " >
< x - modal - confirmation
2025-01-09 12:56:00 +00:00
title = " Enable Volume Data Cloning? "
buttonTitle = " Enable Volume Cloning "
2025-01-08 22:13:05 +00:00
submitAction = " toggleVolumeCloning(true) "
2025-01-09 12:56:00 +00:00
: actions = " ['This will temporarily stop all the containers to copy the volume data to the new resources to ensure data consistency.', 'The process runs in the background and may take a few minutes.'] "
2025-01-08 22:13:05 +00:00
: confirmWithPassword = " false "
: confirmWithText = " false "
/>
</ div >
@ else
< div wire : key = " volume-enabled " class = " max-w-md " >
< x - forms . checkbox
2025-01-09 12:56:00 +00:00
label = " Clone Volume Data "
2025-01-08 22:13:05 +00:00
id = " cloneVolumeData "
wire : model = " cloneVolumeData "
wire : change = " toggleVolumeCloning(false) "
: checked = " $cloneVolumeData "
2025-01-09 12:56:00 +00:00
helper = " Volume Data will be cloned to the new resources. Containers will be temporarily stopped during the cloning process. " />
2025-01-08 22:13:05 +00:00
</ div >
@ endif
</ div >
2025-01-13 10:14:00 +00:00
</ div > -- }}
2025-01-08 22:13:05 +00:00
< h3 class = " pt-8 pb-2 " > Servers </ h3 >
2024-02-02 10:50:28 +00:00
< div > Choose the server and network to clone the resources to .</ div >
2023-12-13 13:22:23 +00:00
< div class = " flex flex-col gap-4 " >
@ foreach ( $servers -> sortBy ( 'id' ) as $server )
2024-02-02 10:50:28 +00:00
< div class = " p-4 " >
< h4 > {{ $server -> name }} </ h4 >
2023-12-13 13:22:23 +00:00
< div class = " pt-4 pb-2 " > Docker Networks </ div >
< div class = " grid grid-cols-1 gap-2 pb-4 lg:grid-cols-4 " >
@ foreach ( $server -> destinations () as $destination )
2024-03-27 13:51:58 +00:00
< div class = " cursor-pointer box-without-bg group "
: class = " ' { { $selectedDestination === $destination->id }}' ? 'bg-coollabs text-white' : 'dark:bg-coolgray-100 bg-white' "
2023-12-13 13:22:23 +00:00
wire : click = " selectServer(' { { $server->id }}', ' { { $destination->id }}') " >
{{ $destination -> name }}
</ div >
@ endforeach
2023-10-20 10:34:53 +00:00
</ div >
</ div >
@ endforeach
</ div >
2023-12-13 13:22:23 +00:00
2025-01-08 22:13:05 +00:00
< h3 class = " pt-8 pb-2 " > Resources </ h3 >
2024-02-02 10:50:28 +00:00
< div > These will be cloned to the new project </ div >
2024-02-04 15:54:12 +00:00
< div class = " grid grid-cols-1 gap-2 pt-4 opacity-95 lg:grid-cols-2 xl:grid-cols-3 " >
2023-10-20 10:34:53 +00:00
@ foreach ( $environment -> applications -> sortBy ( 'name' ) as $application )
2024-03-27 13:51:58 +00:00
< div class = " bg-white cursor-default box-without-bg dark:bg-coolgray-100 group " >
2023-10-20 10:34:53 +00:00
< div class = " flex flex-col " >
2024-03-24 15:00:25 +00:00
< div class = " font-bold dark:text-white " > {{ $application -> name }} </ div >
2023-10-20 10:34:53 +00:00
< div class = " description " > {{ $application -> description }} </ div >
</ div >
</ div >
@ endforeach
@ foreach ( $environment -> databases () -> sortBy ( 'name' ) as $database )
2024-03-27 13:51:58 +00:00
< div class = " bg-white cursor-default box-without-bg dark:bg-coolgray-100 group " >
2023-10-20 10:34:53 +00:00
< div class = " flex flex-col " >
2024-03-24 15:00:25 +00:00
< div class = " font-bold dark:text-white " > {{ $database -> name }} </ div >
2023-10-20 10:34:53 +00:00
< div class = " description " > {{ $database -> description }} </ div >
</ div >
</ div >
@ endforeach
@ foreach ( $environment -> services -> sortBy ( 'name' ) as $service )
2024-03-27 13:51:58 +00:00
< div class = " bg-white cursor-default box-without-bg dark:bg-coolgray-100 group " >
2023-10-20 10:34:53 +00:00
< div class = " flex flex-col " >
2024-03-24 15:00:25 +00:00
< div class = " font-bold dark:text-white " > {{ $service -> name }} </ div >
2023-10-20 10:34:53 +00:00
< div class = " description " > {{ $service -> description }} </ div >
</ div >
</ div >
@ endforeach
</ div >
</ form >