@if ($loading_data)
@elseif ($provider_data_error)
{{ $provider_data_error }}
@else
@php
$regionOptions = collect($regions)->map(fn ($region) => [
'value' => $region['id'],
'label' => ($region['city'] ?? $region['id']) . ' · ' . ($region['country'] ?? $region['id']),
])->values()->all();
$planOptions = collect($this->availablePlans)->map(function ($plan) {
$label = $plan['id']
. ' · ' . ($plan['vcpu_count'] ?? '?') . ' vCPU'
. ' · ' . (isset($plan['ram']) ? number_format($plan['ram'] / 1024, 1) : '?') . ' GB RAM'
. ' · ' . ($plan['disk'] ?? '?') . ' GB';
return [
'value' => $plan['id'],
'label' => isset($plan['monthly_cost'])
? $label . ' · $' . number_format((float) $plan['monthly_cost'], 2) . '/mo'
: $label,
];
})->values()->all();
$osOptions = collect($operatingSystems)->map(fn ($os) => [
'value' => $os['id'],
'label' => $os['name'],
])->values()->all();
$privateKeyOptions = $private_keys->map(fn ($key) => [
'value' => $key->id,
'label' => $key->name,
])->values()->all();
$scriptOptions = collect([
['value' => '', 'label' => 'Start with an empty script'],
...$saved_cloud_init_scripts->map(fn ($script) => [
'value' => $script->id,
'label' => $script->name,
])->all(),
])->all();
@endphp
@endif
@endif