mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Remove source path from volume creation, show only when set
- Remove host_path input from volume creation modal (users should use Directory Mount for bind mounts instead) - Conditionally display Source Path field only when host_path has a value - Add "Remove" button with confirmation modal to clear existing source paths - Add clearHostPath() method to handle source path removal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
083d745d70
commit
593e0dbb5d
3 changed files with 35 additions and 31 deletions
|
|
@ -88,4 +88,13 @@ class Show extends Component
|
||||||
$this->storage->delete();
|
$this->storage->delete();
|
||||||
$this->dispatch('refreshStorages');
|
$this->dispatch('refreshStorages');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function clearHostPath()
|
||||||
|
{
|
||||||
|
$this->authorize('update', $this->resource);
|
||||||
|
$this->hostPath = null;
|
||||||
|
$this->storage->host_path = null;
|
||||||
|
$this->storage->save();
|
||||||
|
$this->dispatch('success', 'Source path removed. Use Directory Mount for host directory bindings.');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,25 +118,9 @@
|
||||||
<div class="flex flex-col">
|
<div class="flex flex-col">
|
||||||
<div>Docker Volumes mounted to the container.</div>
|
<div>Docker Volumes mounted to the container.</div>
|
||||||
</div>
|
</div>
|
||||||
@if ($isSwarm)
|
|
||||||
<div class="text-warning">Swarm Mode detected: You need to set a shared
|
|
||||||
volume
|
|
||||||
(EFS/NFS/etc) on all the worker nodes if you would like to use a
|
|
||||||
persistent
|
|
||||||
volumes.</div>
|
|
||||||
@endif
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<x-forms.input canGate="update" :canResource="$resource" placeholder="pv-name"
|
<x-forms.input canGate="update" :canResource="$resource" placeholder="pv-name"
|
||||||
id="name" label="Name" required helper="Volume name." />
|
id="name" label="Name" required helper="Volume name." />
|
||||||
@if ($isSwarm)
|
|
||||||
<x-forms.input canGate="update" :canResource="$resource"
|
|
||||||
placeholder="/root" id="host_path" label="Source Path" required
|
|
||||||
helper="Directory on the host system." />
|
|
||||||
@else
|
|
||||||
<x-forms.input canGate="update" :canResource="$resource"
|
|
||||||
placeholder="/root" id="host_path" label="Source Path"
|
|
||||||
helper="Directory on the host system." />
|
|
||||||
@endif
|
|
||||||
<x-forms.input canGate="update" :canResource="$resource"
|
<x-forms.input canGate="update" :canResource="$resource"
|
||||||
placeholder="/tmp/root" id="mount_path" label="Destination Path"
|
placeholder="/tmp/root" id="mount_path" label="Destination Path"
|
||||||
required helper="Directory inside the container." />
|
required helper="Directory inside the container." />
|
||||||
|
|
|
||||||
|
|
@ -17,24 +17,20 @@
|
||||||
<x-forms.input id="name" label="Volume Name" required readonly
|
<x-forms.input id="name" label="Volume Name" required readonly
|
||||||
helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." />
|
helper="Warning: Changing the volume name after the initial start could cause problems. Only use it when you know what are you doing." />
|
||||||
@endif
|
@endif
|
||||||
@if ($isService || $startedAt)
|
@if ($hostPath)
|
||||||
<x-forms.input id="hostPath" readonly helper="Directory on the host system."
|
<x-forms.input id="hostPath" readonly helper="Directory on the host system."
|
||||||
label="Source Path"
|
label="Source Path"
|
||||||
helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
|
helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
|
||||||
<x-forms.input id="mountPath" label="Destination Path"
|
|
||||||
helper="Directory inside the container." required readonly />
|
|
||||||
@else
|
|
||||||
<x-forms.input id="hostPath" readonly helper="Directory on the host system."
|
|
||||||
label="Source Path"
|
|
||||||
helper="Warning: Changing the source path after the initial start could cause problems. Only use it when you know what are you doing." />
|
|
||||||
<x-forms.input id="mountPath" label="Destination Path"
|
|
||||||
helper="Directory inside the container." required readonly />
|
|
||||||
@endif
|
@endif
|
||||||
|
<x-forms.input id="mountPath" label="Destination Path"
|
||||||
|
helper="Directory inside the container." required readonly />
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="flex gap-2 items-end w-full">
|
<div class="flex gap-2 items-end w-full">
|
||||||
<x-forms.input id="name" required readonly />
|
<x-forms.input id="name" required readonly />
|
||||||
<x-forms.input id="hostPath" readonly />
|
@if ($hostPath)
|
||||||
|
<x-forms.input id="hostPath" readonly />
|
||||||
|
@endif
|
||||||
<x-forms.input id="mountPath" required readonly />
|
<x-forms.input id="mountPath" required readonly />
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
@ -43,14 +39,18 @@
|
||||||
@if ($isFirst)
|
@if ($isFirst)
|
||||||
<div class="flex gap-2 items-end w-full">
|
<div class="flex gap-2 items-end w-full">
|
||||||
<x-forms.input id="name" label="Volume Name" required />
|
<x-forms.input id="name" label="Volume Name" required />
|
||||||
<x-forms.input id="hostPath" helper="Directory on the host system." label="Source Path" />
|
@if ($hostPath)
|
||||||
|
<x-forms.input id="hostPath" helper="Directory on the host system." label="Source Path" />
|
||||||
|
@endif
|
||||||
<x-forms.input id="mountPath" label="Destination Path"
|
<x-forms.input id="mountPath" label="Destination Path"
|
||||||
helper="Directory inside the container." required />
|
helper="Directory inside the container." required />
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="flex gap-2 items-end w-full">
|
<div class="flex gap-2 items-end w-full">
|
||||||
<x-forms.input id="name" required />
|
<x-forms.input id="name" required />
|
||||||
<x-forms.input id="hostPath" />
|
@if ($hostPath)
|
||||||
|
<x-forms.input id="hostPath" />
|
||||||
|
@endif
|
||||||
<x-forms.input id="mountPath" required />
|
<x-forms.input id="mountPath" required />
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
@ -58,6 +58,13 @@
|
||||||
<x-forms.button type="submit">
|
<x-forms.button type="submit">
|
||||||
Update
|
Update
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
|
@if ($hostPath)
|
||||||
|
<x-modal-confirmation title="Remove Source Path?" isErrorButton buttonTitle="Remove"
|
||||||
|
submitAction="clearHostPath" :actions="[
|
||||||
|
'Are you sure you want to remove the source path?',
|
||||||
|
'If you need to mount a host directory, use Directory Mount instead of Volume Mount.',
|
||||||
|
]" />
|
||||||
|
@endif
|
||||||
<x-modal-confirmation title="Confirm persistent storage deletion?" isErrorButton buttonTitle="Delete"
|
<x-modal-confirmation title="Confirm persistent storage deletion?" isErrorButton buttonTitle="Delete"
|
||||||
submitAction="delete" :actions="[
|
submitAction="delete" :actions="[
|
||||||
'The selected persistent storage/volume will be permanently deleted.',
|
'The selected persistent storage/volume will be permanently deleted.',
|
||||||
|
|
@ -70,15 +77,19 @@
|
||||||
@if ($isFirst)
|
@if ($isFirst)
|
||||||
<div class="flex gap-2 items-end w-full">
|
<div class="flex gap-2 items-end w-full">
|
||||||
<x-forms.input id="name" label="Volume Name" required disabled />
|
<x-forms.input id="name" label="Volume Name" required disabled />
|
||||||
<x-forms.input id="hostPath" helper="Directory on the host system." label="Source Path"
|
@if ($hostPath)
|
||||||
disabled />
|
<x-forms.input id="hostPath" helper="Directory on the host system." label="Source Path"
|
||||||
|
disabled />
|
||||||
|
@endif
|
||||||
<x-forms.input id="mountPath" label="Destination Path"
|
<x-forms.input id="mountPath" label="Destination Path"
|
||||||
helper="Directory inside the container." required disabled />
|
helper="Directory inside the container." required disabled />
|
||||||
</div>
|
</div>
|
||||||
@else
|
@else
|
||||||
<div class="flex gap-2 items-end w-full">
|
<div class="flex gap-2 items-end w-full">
|
||||||
<x-forms.input id="name" required disabled />
|
<x-forms.input id="name" required disabled />
|
||||||
<x-forms.input id="hostPath" disabled />
|
@if ($hostPath)
|
||||||
|
<x-forms.input id="hostPath" disabled />
|
||||||
|
@endif
|
||||||
<x-forms.input id="mountPath" required disabled />
|
<x-forms.input id="mountPath" required disabled />
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue