Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Update modal input behavior and limit-reached layout

Andras Bacsai04c92ec4bdf4
diff --git a/app/Http/Livewire/Server/New/ByIp.php b/app/Http/Livewire/Server/New/ByIp.php
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/app/Livewire/Project/New/Select.php b/app/Livewire/Project/New/Select.php
index 8178590a38..00a243624a 100644
--- a/app/Livewire/Project/New/Select.php
+++ b/app/Livewire/Project/New/Select.php
@@ -90,8 +90,7 @@ class Select extends Component
$this->allServices = getServiceTemplates();
$this->services = $this->allServices->filter(function ($service, $key) {
return str_contains(strtolower($key), strtolower($this->search));
- });;
- $this->dispatch('success', 'Successfully loaded services.');
+ });
}
} catch (\Throwable $e) {
return handleError($e, $this);
diff --git a/resources/views/components/limit-reached.blade.php b/resources/views/components/limit-reached.blade.php
index 4d44b43285..584fd24281 100644
--- a/resources/views/components/limit-reached.blade.php
+++ b/resources/views/components/limit-reached.blade.php
@@ -1,4 +1,4 @@
-<div class="flex flex-col items-center justify-center h-screen">
+<div class="flex flex-col items-center justify-center h-32">
<span class="text-xl font-bold text-white">You have reached the limit of {{ $name }} you can create.</span>
<span>Please <a class="text-white underline "href="{{ route('subscription.show') }}">upgrade your
subscription</a> to create more
diff --git a/resources/views/components/modal-input.blade.php b/resources/views/components/modal-input.blade.php
index a7dc5da4be..dce9ec611b 100644
--- a/resources/views/components/modal-input.blade.php
+++ b/resources/views/components/modal-input.blade.php
@@ -6,7 +6,7 @@
'action' => 'delete',
'content' => null,
])
-<div x-data="{ modalOpen: false }" :class="{ 'z-40': modalOpen }" class="relative w-auto h-auto">
+<div x-data="{ modalOpen: false }" :class="{ 'z-40': modalOpen }" @keydown.window.escape="modalOpen=false" class="relative w-auto h-auto">
@if ($content)
<div @click="modalOpen=true">
{{ $content }}
diff --git a/resources/views/destination/all.blade.php b/resources/views/destination/all.blade.php
index 19fe86b2a4..3d3c347619 100644
--- a/resources/views/destination/all.blade.php
+++ b/resources/views/destination/all.blade.php
@@ -1,14 +1,9 @@
<x-layout>
<div class="flex items-start gap-2">
<h1>Destinations</h1>
- <x-slide-over fullScreen closeWithX>
- <x-slot:title>New Destination</x-slot:title>
- <x-slot:content>
- <livewire:destination.new.docker :server_id="$server_id" />
- </x-slot:content>
- <button @click="slideOverOpen=true" class="button">+
- Add</button>
- </x-slide-over>
+ <x-modal-input buttonTitle="+ Add" title="New Destination">
+ <livewire:destination.new.docker :server_id="$server_id" />
+ </x-modal-input>
</div>
<div class="subtitle">Endpoints to deploy your resources.</div>
<div class="grid gap-2 lg:grid-cols-2">
diff --git a/resources/views/livewire/dashboard.blade.php b/resources/views/livewire/dashboard.blade.php
index 06737c53c6..70912a37ca 100644
--- a/resources/views/livewire/dashboard.blade.php
+++ b/resources/views/livewire/dashboard.blade.php
@@ -38,8 +38,7 @@
<div class="flex items-center group">
<a class="mx-4 rounded hover:no-underline"
href="{{ route('project.resource.create', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => data_get($project, 'environments.0.name', 'production')]) }}">
- <span
- class="p-2 font-bold on-box">+
+ <span class="p-2 font-bold on-box">+
Add Resource</span>
</a>
<a class="mx-4"
@@ -59,18 +58,11 @@
</div>
@else
<div class="flex flex-col gap-1">
- <div class='font-bold text-warning'>No projects found.</div>
- <div class="flex gap-1">Add your first project
- <div>
- <x-slide-over fullScreen closeWithX>
- <x-slot:title>New Project</x-slot:title>
- <x-slot:content>
- <livewire:project.add-empty />
- </x-slot:content>
- <div class="underline cursor-pointer dark:text-white" @click="slideOverOpen=true">here
- </div>
- </x-slide-over>
- </div> or
+ <div class='font-bold dark:text-warning'>No projects found.</div>
+ <div class="flex items-center gap-1">
+ <x-modal-input buttonTitle="Add" title="New Project">
+ <livewire:project.add-empty />
+ </x-modal-input> your first project or
go to the <a class="underline dark:text-white" href="{{ route('onboarding') }}">onboarding</a> page.
</div>
</div>
@@ -111,78 +103,69 @@
@else
@if ($private_keys->count() === 0)
<div class="flex flex-col gap-1">
- <div class='font-bold text-warning'>No private keys found.</div>
- <div class="flex gap-1">Before you can add your server, first add a private key
- <div>
- <x-slide-over fullScreen closeWithX>
- <x-slot:title>New Private Key</x-slot:title>
- <x-slot:content>
- <livewire:security.private-key.create from="server" />
- </x-slot:content>
- <div class="underline cursor-pointer dark:text-white" @click="slideOverOpen=true">here
- </div>
- </x-slide-over>
- </div> or
+ <div class='font-bold dark:text-warning'>No private keys found.</div>
+ <div class="flex items-center gap-1">Before you can add your server, first <x-modal-input
+ buttonTitle="add" title="New Private Key">
+ <livewire:security.private-key.create from="server" />
+ </x-modal-input> a private key
+ or
go to the <a class="underline dark:text-white" href="{{ route('onboarding') }}">onboarding</a>
page.
</div>
</div>
@else
<div class="flex gap-1">
- <span class='font-bold text-warning'>No servers found.</span> Add your first server
- <div>
- <x-slide-over fullScreen closeWithX>
- <x-slot:title>New Server</x-slot:title>
- <x-slot:content>
- <livewire:server.create />
- </x-slot:content>
- <div class="underline cursor-pointer dark:text-white" @click="slideOverOpen=true">here
- </div>
- </x-slide-over>
- </div> or
+ <span class='font-bold text-warning'>No servers found.</span>
+ <x-modal-input buttonTitle="Add"
+ title="New Server">
+ <livewire:server.create />
+ </x-modal-input> your first server
+ or
go to the <a class="underline dark:text-white" href="{{ route('onboarding') }}">onboarding</a>
page.
</div>
@endif
@endif
- <div class="flex items-center gap-2">
- <h3 class="py-4">Deployments</h3>
- @if (count($deployments_per_server) > 0)
- <x-loading />
- @endif
- <x-forms.button wire:click='cleanup_queue'>Cleanup Queues</x-forms.button>
- </div>
- <div wire:poll.1000ms="get_deployments" class="grid grid-cols-1">
- @forelse ($deployments_per_server as $server_name => $deployments)
- <h4 class="py-4">{{ $server_name }}</h4>
- <div class="grid grid-cols-1 gap-2 lg:grid-cols-3">
- @foreach ($deployments as $deployment)
- <a href="{{ data_get($deployment, 'deployment_url') }}" @class([
- 'gap-2 cursor-pointer box group border-l-2 border-dotted',
- 'dark:border-coolgray-300' => data_get($deployment, 'status') === 'queued',
- 'border-yellow-500' => data_get($deployment, 'status') === 'in_progress',
- ])>
- <div class="flex flex-col mx-6">
- <div class="box-title">
- {{ data_get($deployment, 'application_name') }}
- </div>
- @if (data_get($deployment, 'pull_request_id') !== 0)
+ @if ($servers->count() > 0 && $projects->count() > 0)
+ <div class="flex items-center gap-2">
+ <h3 class="py-4">Deployments</h3>
+ @if (count($deployments_per_server) > 0)
+ <x-loading />
+ @endif
+ <x-forms.button wire:click='cleanup_queue'>Cleanup Queues</x-forms.button>
+ </div>
+ <div wire:poll.1000ms="get_deployments" class="grid grid-cols-1">
+ @forelse ($deployments_per_server as $server_name => $deployments)
+ <h4 class="py-4">{{ $server_name }}</h4>
+ <div class="grid grid-cols-1 gap-2 lg:grid-cols-3">
+ @foreach ($deployments as $deployment)
+ <a href="{{ data_get($deployment, 'deployment_url') }}" @class([
+ 'gap-2 cursor-pointer box group border-l-2 border-dotted',
+ 'dark:border-coolgray-300' => data_get($deployment, 'status') === 'queued',
+ 'border-yellow-500' => data_get($deployment, 'status') === 'in_progress',
+ ])>
+ <div class="flex flex-col mx-6">
+ <div class="box-title">
+ {{ data_get($deployment, 'application_name') }}
+ </div>
+ @if (data_get($deployment, 'pull_request_id') !== 0)
+ <div class="box-description">
+ PR #{{ data_get($deployment, 'pull_request_id') }}
+ </div>
+ @endif
<div class="box-description">
- PR #{{ data_get($deployment, 'pull_request_id') }}
+ {{ str(data_get($deployment, 'status'))->headline() }}
</div>
- @endif
- <div class="box-description">
- {{ str(data_get($deployment, 'status'))->headline() }}
</div>
- </div>
- <div class="flex-1"></div>
- </a>
- @endforeach
- </div>
- @empty
- <div>No deployments running.</div>
- @endforelse
- </div>
+ <div class="flex-1"></div>
+ </a>
+ @endforeach
+ </div>
+ @empty
+ <div>No deployments running.</div>
+ @endforelse
+ </div>
+ @endif
<script>
diff --git a/resources/views/livewire/server/index.blade.php b/resources/views/livewire/server/index.blade.php
index c9fc0132ff..751c1f2363 100644
--- a/resources/views/livewire/server/index.blade.php
+++ b/resources/views/livewire/server/index.blade.php
@@ -1,17 +1,11 @@
<div>
<div class="flex items-start gap-2">
<h1>Servers</h1>
- <x-slide-over fullScreen closeWithX>
- <x-slot:title>New Server</x-slot:title>
- <x-slot:content>
- <livewire:server.create />
- </x-slot:content>
- <button @click="slideOverOpen=true" class="button">+
- Add</button>
- </x-slide-over>
+ <x-modal-input buttonTitle="+ Add" title="New Server">
+ <livewire:server.create />
+ </x-modal-input>
</div>
<div class="subtitle">All your servers are here.</div>
-
<div class="grid gap-2 lg:grid-cols-2">
@forelse ($servers as $server)
<a href="{{ route('server.show', ['server_uuid' => data_get($server, 'uuid')]) }}"