fix: show real storage name on services
This commit is contained in:
@@ -11,6 +11,7 @@ class Show extends Component
|
|||||||
public LocalPersistentVolume $storage;
|
public LocalPersistentVolume $storage;
|
||||||
public bool $isReadOnly = false;
|
public bool $isReadOnly = false;
|
||||||
public ?string $modalId = null;
|
public ?string $modalId = null;
|
||||||
|
public ?string $realName = null;
|
||||||
|
|
||||||
protected $rules = [
|
protected $rules = [
|
||||||
'storage.name' => 'required|string',
|
'storage.name' => 'required|string',
|
||||||
@@ -25,6 +26,11 @@ class Show extends Component
|
|||||||
|
|
||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
|
if ($this->storage->resource_type === 'App\Models\ServiceApplication' || $this->storage->resource_type === 'App\Models\ServiceDatabase') {
|
||||||
|
$this->realName = "{$this->storage->service->service->uuid}_{$this->storage->name}";
|
||||||
|
} else {
|
||||||
|
$this->realName = $this->storage->name;
|
||||||
|
}
|
||||||
$this->modalId = new Cuid2(7);
|
$this->modalId = new Cuid2(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,16 +12,19 @@ class LocalPersistentVolume extends Model
|
|||||||
|
|
||||||
public function application()
|
public function application()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo('resource');
|
||||||
}
|
}
|
||||||
public function service()
|
public function service()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo('resource');
|
||||||
|
}
|
||||||
|
public function database()
|
||||||
|
{
|
||||||
|
return $this->morphTo('resource');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function standalone_postgresql()
|
public function standalone_postgresql()
|
||||||
{
|
{
|
||||||
return $this->morphTo();
|
return $this->morphTo('resource');
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function name(): Attribute
|
protected function name(): Attribute
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
<a :class="activeTab === 'general' && 'text-white'"
|
<a :class="activeTab === 'general' && 'text-white'"
|
||||||
@click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
|
@click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
|
||||||
<a :class="activeTab === 'storages' && 'text-white'"
|
<a :class="activeTab === 'storages' && 'text-white'"
|
||||||
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Persistent Storages
|
@click.prevent="activeTab = 'storages'; window.location.hash = 'storages'" href="#">Storages
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full pl-8">
|
<div class="w-full pl-8">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
@endif
|
@endif
|
||||||
<form wire:submit.prevent='submit' class="flex flex-col gap-2 pt-4 xl:items-end xl:flex-row">
|
<form wire:submit.prevent='submit' class="flex flex-col gap-2 pt-4 xl:items-end xl:flex-row">
|
||||||
@if ($isReadOnly)
|
@if ($isReadOnly)
|
||||||
<x-forms.input id="storage.name" label="Name" required readonly />
|
<x-forms.input id="realName" label="Volume Name" required readonly />
|
||||||
<x-forms.input id="storage.host_path" label="Source Path" readonly />
|
<x-forms.input id="storage.host_path" label="Source Path" readonly />
|
||||||
<x-forms.input id="storage.mount_path" label="Destination Path" required readonly />
|
<x-forms.input id="storage.mount_path" label="Destination Path" required readonly />
|
||||||
@else
|
@else
|
||||||
|
|||||||
Reference in New Issue
Block a user