@if ($loading_data)
@elseif ($provider_data_error)
{{ $provider_data_error }}
@else
@php
$locationOptions = collect($locations)->map(fn ($location) => [
'value' => $location['name'],
'label' => $location['city'] . ' · ' . $location['country'],
])->values()->all();
$serverTypeOptions = collect($this->availableServerTypes)->map(function ($type) {
$price = data_get($type, 'prices.0.price_monthly.gross');
$label = ($type['description'] ?? $type['name'])
. ' · ' . ($type['cores'] ?? '?') . ' vCPU'
. ' · ' . ($type['memory'] ?? '?') . ' GB RAM'
. ' · ' . ($type['disk'] ?? '?') . ' GB';
return [
'value' => $type['name'],
'label' => $price ? $label . ' · €' . number_format($price, 2) . '/mo' : $label,
];
})->values()->all();
$imageOptions = collect($this->availableImages)->map(fn ($image) => [
'value' => $image['id'],
'label' => ($image['description'] ?? $image['name'])
. (isset($image['architecture']) ? ' · ' . $image['architecture'] : ''),
])->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