refactor(storage): separate volumes from directory mounts

This commit is contained in:
Andras Bacsai
2026-08-18 20:01:36 +02:00
parent e62a2d45a0
commit f5f904a403
6 changed files with 90 additions and 30 deletions
@@ -116,25 +116,9 @@
<p class="text-[13px] leading-5 text-neutral-500 dark:text-fg-dim">
Mount a Docker volume inside the container.
</p>
@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-4">
<x-forms.input canGate="update" :canResource="$resource" placeholder="pv-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"
placeholder="/tmp/root" id="mount_path" label="Destination Path"
required helper="Directory inside the container." />
@@ -154,7 +154,21 @@
<div class="volumes-col-source min-w-0">
<span class="volumes-mobile-label volumes-field-label">Source Path</span>
<x-forms.input id="forms.{{ $id }}.hostPath" placeholder="Host path (optional)" />
@if (filled($form['hostPath']))
<div class="flex items-center gap-1.5">
<div class="min-w-0 flex-1">
<x-forms.input id="forms.{{ $id }}.hostPath" />
</div>
<x-modal-confirmation title="Remove Source Path?" isErrorButton
buttonTitle="Remove" submitAction="clearHostPath({{ $id }})"
:actions="[
'Are you sure you want to remove the source path?',
'Use a Directory Mount when you need to mount a host directory.',
]" />
</div>
@else
<span class="data-table-cell-dash">-</span>
@endif
</div>
<div class="volumes-cell-dest min-w-0">