fix: add uuid to volume names

This commit is contained in:
Andras Bacsai
2023-10-02 09:08:41 +02:00
parent 41672f75d0
commit d523becb29
2 changed files with 4 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ use Livewire\Component;
class Add extends Component class Add extends Component
{ {
public $uuid;
public $parameters; public $parameters;
public string $name; public string $name;
public string $mount_path; public string $mount_path;
@@ -31,8 +32,9 @@ class Add extends Component
public function submit() public function submit()
{ {
$this->validate(); $this->validate();
$name = $this->uuid . '-' . $this->name;
$this->emitUp('submit', [ $this->emitUp('submit', [
'name' => $this->name, 'name' => $name,
'mount_path' => $this->mount_path, 'mount_path' => $this->mount_path,
'host_path' => $this->host_path, 'host_path' => $this->host_path,
]); ]);

View File

@@ -8,7 +8,7 @@
volume volume
name, example: <span class='text-helper'>-pr-1</span>" /> name, example: <span class='text-helper'>-pr-1</span>" />
<x-forms.button class="btn" onclick="newStorage.showModal()">+ Add</x-forms.button> <x-forms.button class="btn" onclick="newStorage.showModal()">+ Add</x-forms.button>
<livewire:project.shared.storages.add /> <livewire:project.shared.storages.add :uuid="$resource->uuid" />
@endif @endif
</div> </div>
<div>Persistent storage to preserve data between deployments.</div> <div>Persistent storage to preserve data between deployments.</div>