@if ($loading_data)
@elseif ($provider_data_error)
{{ $provider_data_error }}
@else
@php
$regionOptions = collect($regions)->map(fn ($region) => [
'value' => $region['slug'],
'label' => $region['name'] ?? $region['slug'],
])->values()->all();
$sizeOptions = collect($this->availableSizes)->map(function ($size) {
$label = $size['slug']
. ' · ' . ($size['memory'] ?? '?') . ' MB RAM'
. ' · ' . ($size['vcpus'] ?? '?') . ' vCPU'
. (isset($size['disk']) ? ' · ' . $size['disk'] . ' GB' : '');
return [
'value' => $size['slug'],
'label' => isset($size['price_monthly'])
? $label . ' · $' . number_format((float) $size['price_monthly'], 2) . '/mo'
: $label,
];
})->values()->all();
$imageOptions = collect($this->availableImages)->map(fn ($image) => [
'value' => $image['slug'] ?? $image['id'],
'label' => trim(($image['distribution'] ?? '') . ' ' . ($image['name'] ?? $image['slug'] ?? $image['id'])),
])->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