{{-- What a Proxmox product sells. The drop-downs are filled from the cluster itself (nodes, storages, bridges, templates); until that answer arrives each shows the value already saved, so saving without it changes nothing. --}} @php $pve = fn (string $key, $default = '') => $cfg["pve_{$key}"] ?? $default; $pveType = $pve('type', $cfg['type'] ?? 'qemu') === 'lxc' ? 'lxc' : 'qemu'; $choices = collect(is_array($pve('os_choices', [])) ? $pve('os_choices', []) : []); $current = fn (string $key, string $legacy = '') => (string) ($pve($key, '') !== '' ? $pve($key) : ($legacy !== '' ? ($cfg[$legacy] ?? '') : '')); @endphp @php $pveMemory = (int) $pve('memory', $cfg['memory'] ?? 1024); $pveCores = (int) $pve('cores', $cfg['cores'] ?? 1); $pveDisk = (int) $pve('disk', $cfg['disk'] ?? 20); $pveCurrency = \App\Models\Currency::getDefault(); $pveLinked = $pveOrderOptions ?? []; $pveLinkedKeys = collect($pveLinked)->pluck('key')->all(); $pveTiers = [ 'memory' => collect([$pveMemory, $pveMemory * 2, $pveMemory * 4])->map(fn ($v, $i) => ['value' => $v, 'price' => [0, 5, 12][$i]])->all(), 'cores' => collect([$pveCores, $pveCores * 2, $pveCores * 4])->map(fn ($v, $i) => ['value' => $v, 'price' => [0, 4, 10][$i]])->all(), 'disk' => collect([$pveDisk, $pveDisk * 2, $pveDisk * 4])->map(fn ($v, $i) => ['value' => $v, 'price' => [0, 2, 5][$i]])->all(), ]; $pvePresets = [[1, 1024, 20], [1, 2048, 40], [2, 4096, 80], [4, 8192, 160], [8, 16384, 320]]; @endphp
@push('scripts') @endpush