Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: show real storage name on services

Andras Bacsaiee20c3339e52
diff --git a/app/Http/Livewire/Project/Shared/Storages/Show.php b/app/Http/Livewire/Project/Shared/Storages/Show.php
index 84593aef31..46dd84affd 100644
--- a/app/Http/Livewire/Project/Shared/Storages/Show.php
+++ b/app/Http/Livewire/Project/Shared/Storages/Show.php
@@ -11,6 +11,7 @@ class Show extends Component
public LocalPersistentVolume $storage;
public bool $isReadOnly = false;
public ?string $modalId = null;
+ public ?string $realName = null;
protected $rules = [
'storage.name' => 'required|string',
@@ -25,6 +26,11 @@ class Show extends Component
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);
}
diff --git a/app/Models/LocalPersistentVolume.php b/app/Models/LocalPersistentVolume.php
index 20ea51c63d..2a29f8abb1 100644
--- a/app/Models/LocalPersistentVolume.php
+++ b/app/Models/LocalPersistentVolume.php
@@ -12,16 +12,19 @@ class LocalPersistentVolume extends Model
public function application()
{
- return $this->morphTo();
+ return $this->morphTo('resource');
}
public function service()
{
- return $this->morphTo();
+ return $this->morphTo('resource');
+ }
+ public function database()
+ {
+ return $this->morphTo('resource');
}
-
public function standalone_postgresql()
{
- return $this->morphTo();
+ return $this->morphTo('resource');
}
protected function name(): Attribute
diff --git a/resources/views/livewire/project/service/show.blade.php b/resources/views/livewire/project/service/show.blade.php
index e63225c05b..eba246615d 100644
--- a/resources/views/livewire/project/service/show.blade.php
+++ b/resources/views/livewire/project/service/show.blade.php
@@ -9,7 +9,7 @@
<a :class="activeTab === 'general' && 'text-white'"
@click.prevent="activeTab = 'general'; window.location.hash = 'general'" href="#">General</a>
<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>
</div>
<div class="w-full pl-8">
diff --git a/resources/views/livewire/project/shared/storages/show.blade.php b/resources/views/livewire/project/shared/storages/show.blade.php
index 5ee4efd334..3d60c27aee 100644
--- a/resources/views/livewire/project/shared/storages/show.blade.php
+++ b/resources/views/livewire/project/shared/storages/show.blade.php
@@ -12,7 +12,7 @@
@endif
<form wire:submit.prevent='submit' class="flex flex-col gap-2 pt-4 xl:items-end xl:flex-row">
@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.mount_path" label="Destination Path" required readonly />
@else