load linode regions and plans dynamically (#367)

This commit is contained in:
Saeed Vaziry
2024-11-17 10:58:09 +01:00
committed by GitHub
parent cc79aa9fbf
commit 34c5750950
4 changed files with 82 additions and 43 deletions

View File

@ -107,7 +107,12 @@ public function plans(?string $region): array
return collect($plans)
->mapWithKeys(fn ($value) => [
$value['InstanceType'] => $value['InstanceType'].' - '.$value['VCpuInfo']['DefaultVCpus'].' vCPUs, '.$value['MemoryInfo']['SizeInMiB'].' MB RAM',
$value['InstanceType'] => __('server_providers.plan', [
'name' => $value['InstanceType'],
'cpu' => $value['VCpuInfo']['DefaultVCpus'] ?? 'N/A',
'memory' => $value['MemoryInfo']['SizeInMiB'] ?? 'N/A',
'disk' => $value['InstanceStorageInfo']['TotalSizeInGB'] ?? 'N/A',
]),
])
->toArray();
}