feat: enhance max allowed storage loading by integrating ExtensionHelper for improved settings management
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user