Enhance Proxmox components with input validation, error handling, and UI improvements
This commit is contained in:
@@ -24,7 +24,7 @@ class Create extends Component
|
||||
}
|
||||
|
||||
$backupSettings = $this->server->service->product->settings()->where('key', 'backups')->first();
|
||||
$backupLimit = $backupSettings?->value ?? 0;
|
||||
$backupLimit = (int) ($backupSettings?->value ?? 0);
|
||||
|
||||
// If limit is 0 or not set, allow unlimited backups
|
||||
if ($backupLimit <= 0) {
|
||||
@@ -74,7 +74,7 @@ class Create extends Component
|
||||
|
||||
// Check backup limit
|
||||
$backupSettings = $this->server->service->product->settings()->where('key', 'backups')->first();
|
||||
$backupLimit = $backupSettings?->value ?? 0;
|
||||
$backupLimit = (int) ($backupSettings?->value ?? 0);
|
||||
|
||||
if ($backupLimit > 0 && !empty($this->server->node->backup_location)) {
|
||||
try {
|
||||
@@ -96,6 +96,11 @@ class Create extends Component
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($this->server->node->backup_location)) {
|
||||
$this->notify('Backup storage location is not configured.', 'error');
|
||||
return;
|
||||
}
|
||||
|
||||
$proxmox = new Proxmox;
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user