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.

proejct wildcard domain

Andras Bacsai6aa7cbade079
diff --git a/app/Http/Livewire/Project/Application/General.php b/app/Http/Livewire/Project/Application/General.php
index 8f4623861a..eeef8020bf 100644
--- a/app/Http/Livewire/Project/Application/General.php
+++ b/app/Http/Livewire/Project/Application/General.php
@@ -105,6 +105,7 @@ class General extends Component
$scheme = $url->getScheme();
$this->application->fqdn = $scheme . '://' . $this->application->uuid . '.' . $host . $path;
$this->application->save();
+ $this->emit('success', 'Application settings updated!');
}
public function generateProjectRandomDomain()
{
@@ -115,6 +116,7 @@ class General extends Component
$scheme = $url->getScheme();
$this->application->fqdn = $scheme . '://' . $this->application->uuid . '.' . $host . $path;
$this->application->save();
+ $this->emit('success', 'Application settings updated!');
}
public function submit()
{
diff --git a/app/Http/Livewire/Project/Edit.php b/app/Http/Livewire/Project/Edit.php
index aa759e05e8..79652607c1 100644
--- a/app/Http/Livewire/Project/Edit.php
+++ b/app/Http/Livewire/Project/Edit.php
@@ -8,14 +8,22 @@ use Livewire\Component;
class Edit extends Component
{
public Project $project;
+ public string|null $wildcard_domain = null;
protected $rules = [
'project.name' => 'required|min:3|max:255',
'project.description' => 'nullable|string|max:255',
+ 'wildcard_domain' => 'nullable|string|max:255',
];
+ public function mount()
+ {
+ $this->wildcard_domain = $this->project->settings->wildcard_domain;
+ }
public function submit()
{
$this->validate();
try {
+ $this->project->settings->wildcard_domain = $this->wildcard_domain;
+ $this->project->settings->save();
$this->project->save();
$this->emit('saved');
} catch (\Exception $e) {
diff --git a/resources/views/livewire/project/application/general.blade.php b/resources/views/livewire/project/application/general.blade.php
index 25f0a8f330..ec8ee781fe 100644
--- a/resources/views/livewire/project/application/general.blade.php
+++ b/resources/views/livewire/project/application/general.blade.php
@@ -12,21 +12,19 @@
<x-forms.input id="application.name" label="Name" required />
<x-forms.input placeholder="https://coolify.io" id="application.fqdn" label="Domains"
helper="You can specify one domain with path or more with comma.<br><span class='text-helper'>Example</span>- http://app.coolify.io, https://cloud.coolify.io/dashboard<br>- http://app.coolify.io/api/v3" />
-
+ @if ($wildcard_domain)
+ <div class="flex flex-row gap-2">
+ @if ($global_wildcard_domain)
+ <x-forms.button wire:click="generateGlobalRandomDomain">Global Wildcard
+ </x-forms.button>
+ @endif
+ @if ($project_wildcard_domain)
+ <x-forms.button wire:click="generateProjectRandomDomain">Project Wildcard
+ </x-forms.button>
+ @endif
+ </div>
+ @endif
</div>
- @if ($wildcard_domain)
- <div class="pb-6">
- <div class="">Set Random Domain</div>
- @if ($global_wildcard_domain)
- <x-forms.button wire:click="generateGlobalRandomDomain">Global Wildcard
- </x-forms.button>
- @endif
- @if ($project_wildcard_domain)
- <x-forms.button wire:click="generateProjectRandomDomain">Project Wildcard
- </x-forms.button>
- @endif
- </div>
- @endif
<x-forms.select id="application.build_pack" label="Build Pack" required>
<option value="nixpacks">Nixpacks</option>
<option disabled value="docker">Docker</option>
diff --git a/resources/views/livewire/project/edit.blade.php b/resources/views/livewire/project/edit.blade.php
index a7ff0f68fa..ad58e3c59e 100644
--- a/resources/views/livewire/project/edit.blade.php
+++ b/resources/views/livewire/project/edit.blade.php
@@ -1,9 +1,14 @@
<div>
- <h1>{{ data_get($project, 'name') }}</h1>
- <div class="pt-2 pb-10">Edit project details</div>
- <form wire:submit.prevent='submit' class="flex items-end gap-2 ">
- <x-forms.input label="Name" id="project.name" />
- <x-forms.input label="Description" id="project.description" />
- <x-forms.button type="submit">Save</x-forms.button>
+ <form wire:submit.prevent='submit' class="flex flex-col gap-2 ">
+ <div class="flex items-end gap-2">
+ <h1>Project: {{ data_get($project, 'name') }}</h1>
+ <x-forms.button type="submit">Save</x-forms.button>
+ </div>
+ <div class="pb-10">Edit project details here.</div>
+ <div class="flex gap-2">
+ <x-forms.input label="Name" id="project.name" />
+ <x-forms.input label="Description" id="project.description" />
+ <x-forms.input label="Wildcard Domain" id="wildcard_domain" />
+ </div>
</form>
</div>