fix(hostinger): use a searchable listbox for extra SSH keys

This commit is contained in:
Andras Bacsai
2026-10-13 11:25:33 +02:00
parent 8dfad2c16c
commit c35d3d5c8c
2 changed files with 8 additions and 10 deletions
@@ -120,14 +120,11 @@
<x-forms.checkbox id="enable_backups" label="Enable weekly Hostinger backups (extra cost)" fullWidth
helper="Hostinger charges extra for backups. Check the price in hPanel before you enable them." />
</div>
<x-forms.datalist label="Extra SSH keys" id="selected_public_key_ids"
helper="Existing keys from the Hostinger account." :multiple="true"
:disabled="count($hostinger_public_keys) === 0"
:placeholder="count($hostinger_public_keys) ? 'Search SSH keys' : 'No account keys found'">
@foreach ($hostinger_public_keys as $publicKey)
<option value="{{ $publicKey['id'] }}">{{ $publicKey['name'] }}</option>
@endforeach
</x-forms.datalist>
<x-forms.listbox label="Extra SSH keys" id="selected_public_key_ids"
helper="Existing keys from the Hostinger account." multiple searchable
:disabled="count($hostinger_public_keys) === 0" searchPlaceholder="Search SSH keys…"
:placeholder="count($hostinger_public_keys) ? 'Select SSH keys' : 'No account keys found'"
:options="collect($hostinger_public_keys)->map(fn ($publicKey) => ['value' => $publicKey['id'], 'label' => $publicKey['name']])->values()->all()" />
@if ($post_install_scripts)
<x-forms.listbox id="selected_post_install_script_id"
label="Hostinger post-install script"
@@ -86,7 +86,8 @@ it('selects Hostinger account SSH keys with the same dropdown as Hetzner', funct
->assertSee('Extra SSH keys')
->assertSee('Existing keys from the Hostinger account.')
->assertSee('Search SSH keys')
->assertSeeHtml('<option value="42">&lt;b&gt;Operations&lt;/b&gt;</option>')
->assertSee('Operations')
->assertSeeHtml('x-text="current">Select SSH keys</span>')
->assertDontSeeHtml('<b>Operations</b>')
->assertDontSeeHtml('id="hostinger-public-key-42-');
@@ -413,7 +414,7 @@ it('labels the Hostinger status refresh button on the server page', function ()
Livewire::test(Show::class, ['server_uuid' => $server->uuid])
->assertSee('Hostinger · Running')
->assertSee('Refresh status')
->assertSee('Refresh provider status')
->assertSeeHtml('wire:click.prevent="checkHostingerVirtualMachineStatus(true)"');
});