From 4ba6aa350094373c0a145c5d38e1dde46a39c925 Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Mon, 10 Aug 2026 10:09:03 +0200 Subject: [PATCH] feat(servers): separate connection and provisioning options Group existing server connections separately from cloud provisioning and use a select for dedicated build server roles. --- .../views/livewire/boarding/index.blade.php | 43 +++-- .../views/livewire/server/create.blade.php | 160 +++++++++--------- .../views/livewire/server/new/by-ip.blade.php | 7 +- tests/Feature/ServerCreatePageLayoutTest.php | 39 +++++ .../ServerCreationBuildRoleLayoutTest.php | 4 + 5 files changed, 148 insertions(+), 105 deletions(-) diff --git a/resources/views/livewire/boarding/index.blade.php b/resources/views/livewire/boarding/index.blade.php index f51c82156..2f955f167 100644 --- a/resources/views/livewire/boarding/index.blade.php +++ b/resources/views/livewire/boarding/index.blade.php @@ -95,7 +95,11 @@ Select where to deploy your applications and databases. You can add more servers later. -
+
+
+

Add a server

+

Use this machine or connect a server you already manage.

+
+
+ + @can('viewAny', App\Models\CloudProviderToken::class) +
+

Provision a server

+

Create a server with a cloud provider.

+
@if ($currentState === 'select-server-type')
- - - - + Hetzner

Hetzner Cloud

@@ -170,12 +177,8 @@

- - - - + Vultr

Vultr Cloud

@@ -205,6 +208,8 @@ @endif +

+
@endcan
@@ -421,19 +426,13 @@ -
-

- Non-root user support is experimental. - Learn - more -

Validate Connection diff --git a/resources/views/livewire/server/create.blade.php b/resources/views/livewire/server/create.blade.php index 9b42400bd..b61640fb6 100644 --- a/resources/views/livewire/server/create.blade.php +++ b/resources/views/livewire/server/create.blade.php @@ -15,91 +15,89 @@ @if (!$selectedType) -
+ @else
diff --git a/resources/views/livewire/server/new/by-ip.blade.php b/resources/views/livewire/server/new/by-ip.blade.php index 51b93e99c..14c453da5 100644 --- a/resources/views/livewire/server/new/by-ip.blade.php +++ b/resources/views/livewire/server/new/by-ip.blade.php @@ -83,9 +83,12 @@ helper="Non-root SSH users are experimental." />
- + label="Use as a dedicated build server"> + + + diff --git a/tests/Feature/ServerCreatePageLayoutTest.php b/tests/Feature/ServerCreatePageLayoutTest.php index c8fde5863..3e8a8b48b 100644 --- a/tests/Feature/ServerCreatePageLayoutTest.php +++ b/tests/Feature/ServerCreatePageLayoutTest.php @@ -18,3 +18,42 @@ test('provider pages only show the token action in the account panel', function ->not->toContain('new-server-token-') ->not->toContain('tokenProviderName'); }); + +test('server selection separates existing servers from cloud provisioning', function (string $viewPath) { + $view = file_get_contents(resource_path($viewPath)); + + expect($view) + ->toContain('Add a server') + ->toContain('IP address or domain') + ->toContain('Provision a server') + ->and(strpos($view, 'Add a server'))->toBeLessThan(strpos($view, 'Provision a server')); +})->with([ + 'new server page' => 'views/livewire/server/create.blade.php', + 'onboarding' => 'views/livewire/boarding/index.blade.php', +]); + +test('new server sections have vertical spacing', function () { + $view = file_get_contents(resource_path('views/livewire/server/create.blade.php')); + + expect($view)->toContain('
'); +}); + +test('server selection uses the provider logos', function () { + $newServerView = file_get_contents(resource_path('views/livewire/server/create.blade.php')); + $onboardingView = file_get_contents(resource_path('views/livewire/boarding/index.blade.php')); + + expect($newServerView) + ->toContain('src="https://www.vultr.com/media/logo_ondark.svg"') + ->toContain("src=\"{{ asset('svgs/hetzner.svg') }}\"") + ->and($onboardingView) + ->toContain('src="https://www.vultr.com/media/logo_ondark.svg"') + ->toContain("src=\"{{ asset('svgs/hetzner.svg') }}\""); +}); + +test('new server cards do not show method badges', function () { + $view = file_get_contents(resource_path('views/livewire/server/create.blade.php')); + + expect($view) + ->not->toContain("\n Manual\n") + ->not->toContain("\n Provider\n"); +}); diff --git a/tests/Feature/ServerCreationBuildRoleLayoutTest.php b/tests/Feature/ServerCreationBuildRoleLayoutTest.php index af3271ae4..dd4645712 100644 --- a/tests/Feature/ServerCreationBuildRoleLayoutTest.php +++ b/tests/Feature/ServerCreationBuildRoleLayoutTest.php @@ -6,7 +6,11 @@ test('server creation keeps private key actions together and advanced options co expect($view) ->toContain('class="flex items-end gap-3"') ->toContain('toContain('toContain('label="Use as a dedicated build server"') + ->toContain('') + ->toContain('') + ->not->toContain('toContain('helper="Build servers compile applications but do not host deployments. Enabling this makes the server build-only."'); });