mirror of
https://github.com/coollabsio/coolify.git
synced 2026-03-11 08:55:47 +00:00
Add auto-generated default volume name
Pre-fill volume name with <app-name>-data (slugified) when creating a new volume mount, improving UX by providing a sensible default. 🤖 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
687d0f88a3
commit
de214d0bf7
1 changed files with 10 additions and 1 deletions
|
|
@ -56,6 +56,7 @@ class Storage extends Component
|
|||
}
|
||||
|
||||
$this->refreshStorages();
|
||||
$this->name = $this->generateDefaultVolumeName();
|
||||
}
|
||||
|
||||
public function refreshStoragesFromEvent()
|
||||
|
|
@ -202,7 +203,7 @@ class Storage extends Component
|
|||
|
||||
public function clearForm()
|
||||
{
|
||||
$this->name = '';
|
||||
$this->name = $this->generateDefaultVolumeName();
|
||||
$this->mount_path = '';
|
||||
$this->host_path = null;
|
||||
$this->file_storage_path = '';
|
||||
|
|
@ -216,6 +217,14 @@ class Storage extends Component
|
|||
}
|
||||
}
|
||||
|
||||
private function generateDefaultVolumeName(): string
|
||||
{
|
||||
return str($this->resource->name ?? 'volume')
|
||||
->slug()
|
||||
->append('-data')
|
||||
->value();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.project.service.storage');
|
||||
|
|
|
|||
Loading…
Reference in a new issue