fix: do not allow service storage mount point modifications
This commit is contained in:
parent
92828b22fa
commit
ad5c1639e8
@ -12,6 +12,8 @@ class Show extends Component
|
|||||||
public bool $isReadOnly = false;
|
public bool $isReadOnly = false;
|
||||||
public ?string $modalId = null;
|
public ?string $modalId = null;
|
||||||
public bool $isFirst = true;
|
public bool $isFirst = true;
|
||||||
|
public bool $isService = false;
|
||||||
|
public ?string $startedAt = null;
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'storage.name' => 'required|string',
|
'storage.name' => 'required|string',
|
||||||
|
@ -3,10 +3,11 @@
|
|||||||
@foreach ($resource->persistentStorages as $storage)
|
@foreach ($resource->persistentStorages as $storage)
|
||||||
@if ($resource->type() === 'service')
|
@if ($resource->type() === 'service')
|
||||||
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
|
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
|
||||||
:isFirst="$loop->first" isReadOnly='true' />
|
:isFirst="$loop->first" isReadOnly='true' isService='true' />
|
||||||
@else
|
@else
|
||||||
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
|
<livewire:project.shared.storages.show wire:key="storage-{{ $storage->id }}" :storage="$storage"
|
||||||
isReadOnly="{{ data_get($storage, 'is_readonly') }}" />
|
isReadOnly="{{ data_get($storage, 'is_readonly') }}"
|
||||||
|
startedAt="{{ data_get($resource, 'started_at') }}" />
|
||||||
@endif
|
@endif
|
||||||
@endforeach
|
@endforeach
|
||||||
</div>
|
</div>
|
||||||
|
@ -4,9 +4,16 @@
|
|||||||
@if ($isFirst)
|
@if ($isFirst)
|
||||||
<x-forms.input id="storage.name" label="Volume Name" required
|
<x-forms.input id="storage.name" label="Volume Name" required
|
||||||
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." />
|
||||||
|
@if ($isService || $startedAt)
|
||||||
|
<x-forms.input id="storage.host_path" 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." />
|
||||||
|
@else
|
||||||
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path"
|
<x-forms.input id="storage.host_path" 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." />
|
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="storage.mount_path" label="Destination Path" helper="Directory inside the container." required readonly />
|
@endif
|
||||||
|
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
|
||||||
|
required readonly />
|
||||||
<x-forms.button type="submit">
|
<x-forms.button type="submit">
|
||||||
Update
|
Update
|
||||||
</x-forms.button>
|
</x-forms.button>
|
||||||
@ -20,7 +27,8 @@
|
|||||||
@if ($isFirst)
|
@if ($isFirst)
|
||||||
<x-forms.input id="storage.name" label="Volume Name" required />
|
<x-forms.input id="storage.name" label="Volume Name" required />
|
||||||
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" />
|
<x-forms.input id="storage.host_path" helper="Directory on the host system." label="Source Path" />
|
||||||
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container." required />
|
<x-forms.input id="storage.mount_path" label="Destination Path" helper="Directory inside the container."
|
||||||
|
required />
|
||||||
@else
|
@else
|
||||||
<x-forms.input id="storage.name" required />
|
<x-forms.input id="storage.name" required />
|
||||||
<x-forms.input id="storage.host_path" helper="Directory on the host system." />
|
<x-forms.input id="storage.host_path" helper="Directory on the host system." />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user