Private
Public Access
1
0

feat: enhance max allowed storage loading by integrating ExtensionHelper for improved settings management

This commit is contained in:
2025-12-05 04:15:49 -05:00
parent 061ec6145c
commit 940c97da9f

View File

@@ -2,6 +2,7 @@
namespace Paymenter\Extensions\Servers\Proxmox\Livewire; namespace Paymenter\Extensions\Servers\Proxmox\Livewire;
use App\Helpers\ExtensionHelper;
use Illuminate\Support\Str; use Illuminate\Support\Str;
use Livewire\Attributes\Locked; use Livewire\Attributes\Locked;
use Paymenter\Extensions\Servers\Proxmox\Models\Server; use Paymenter\Extensions\Servers\Proxmox\Models\Server;
@@ -123,14 +124,17 @@ class Storage extends Component
/** /**
* Load the maximum allowed storage from the plan configuration. * Load the maximum allowed storage from the plan configuration.
* Uses ExtensionHelper to merge product settings with service properties,
* ensuring upgraded disk sizes are properly reflected.
*/ */
protected function loadMaxAllowedStorage(): void protected function loadMaxAllowedStorage(): void
{ {
$diskSetting = $this->server->service->product->settings() $settings = array_merge(
->where('key', 'disk') ExtensionHelper::settingsToArray($this->server->service->product->settings),
->first(); ExtensionHelper::getServiceProperties($this->server->service)
);
$this->maxAllowedStorage = $diskSetting ? (float) $diskSetting->value : 0; $this->maxAllowedStorage = isset($settings['disk']) ? (float) $settings['disk'] : 0;
} }
/** /**