feat: docker volume data cloning

- UI implementation
- functional implementation for databases - volume gets cloned successfully
This commit is contained in:
peaklabs-dev
2025-01-08 23:13:05 +01:00
parent 249e39ea71
commit 3723c84624
2 changed files with 83 additions and 2 deletions

View File

@@ -9,7 +9,39 @@
<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>
<h3 class="pt-4 pb-2">Servers</h3>
<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
title="Enable Volume Data Cloning"
buttonTitle="Enable Cloning"
submitAction="toggleVolumeCloning(true)"
:actions="['This will temporarily stop all the containers to copy volume data.', 'The process runs in the background and may take a few minutes.']"
:confirmWithPassword="false"
:confirmWithText="false"
/>
</div>
@else
<div wire:key="volume-enabled" class="max-w-md">
<x-forms.checkbox
label="Copy Volume Data"
id="cloneVolumeData"
wire:model="cloneVolumeData"
wire:change="toggleVolumeCloning(false)"
:checked="$cloneVolumeData"
helper="Containers will be temporarily stopped during the cloning process." />
</div>
@endif
</div>
</div>
<h3 class="pt-8 pb-2">Servers</h3>
<div>Choose the server and network to clone the resources to.</div>
<div class="flex flex-col gap-4">
@foreach ($servers->sortBy('id') as $server)
@@ -29,7 +61,7 @@
@endforeach
</div>
<h3 class="pt-4 pb-2">Resources</h3>
<h3 class="pt-8 pb-2">Resources</h3>
<div>These will be cloned to the new project</div>
<div class="grid grid-cols-1 gap-2 pt-4 opacity-95 lg:grid-cols-2 xl:grid-cols-3">
@foreach ($environment->applications->sortBy('name') as $application)