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.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix: services view
Andras Bacsaife8a7fc54f0a
diff --git a/app/Http/Controllers/ProjectController.php b/app/Http/Controllers/ProjectController.phpindex 827052ad9c..48bf7909e7 100644--- a/app/Http/Controllers/ProjectController.php+++ b/app/Http/Controllers/ProjectController.php@@ -73,7 +73,6 @@ class ProjectController extends Controllerif ($oneClickDotEnvs) {$oneClickDotEnvs = Str::of(base64_decode($oneClickDotEnvs))->split('/\r\n|\r|\n/');}- ray($oneClickDotEnvs);if ($oneClickService) {$service = Service::create(['name' => "$oneClickServiceName-" . Str::random(10),@@ -83,7 +82,7 @@ class ProjectController extends Controller]);$service->name = "$oneClickServiceName-" . $service->uuid;$service->save();- if ($oneClickDotEnvs->count() > 0) {+ if ($oneClickDotEnvs?->count() > 0) {$oneClickDotEnvs->each(function ($value) use ($service) {$key = Str::before($value, '=');$value = Str::of(Str::after($value, '='));diff --git a/app/Http/Livewire/Project/Service/Index.php b/app/Http/Livewire/Project/Service/Index.phpindex 017c878e79..0a09484ff1 100644--- a/app/Http/Livewire/Project/Service/Index.php+++ b/app/Http/Livewire/Project/Service/Index.php@@ -9,7 +9,6 @@ use Livewire\Component;class Index extends Component{- use WithRateLimiting;public Service $service;public $applications;public $databases;@@ -21,26 +20,22 @@ class Index extends Component'service.name' => 'required','service.description' => 'nullable',];- public function manualRefreshStack() {- try {- $this->rateLimit(5);- dispatch_sync(new ContainerStatusJob($this->service->server));- $this->refreshStack();- } catch(\Throwable $e) {- return handleError($e, $this);- }+ public function checkStatus() {+ dispatch_sync(new ContainerStatusJob($this->service->server));+ $this->refreshStack();}public function refreshStack(){$this->applications = $this->service->applications->sort();$this->applications->each(function ($application) {+ $application->refresh();$application->configuration_required = $application->configurationRequired();});$this->databases = $this->service->databases->sort();$this->databases->each(function ($database) {+ $database->refresh();$database->configuration_required = $database->configurationRequired();});- $this->emit('success', 'Stack refreshed successfully.');}public function mount(){diff --git a/app/Models/Service.php b/app/Models/Service.phpindex f03ef8a862..2b18193663 100644--- a/app/Models/Service.php+++ b/app/Models/Service.php@@ -115,30 +115,30 @@ class Service extends BaseModel}return "{$server->ip}.sslip.io";}- private function generateFqdn($serviceVariables, $serviceName, Collection $configuration)- {- // Add sslip.io to the service- $defaultUsableFqdn = null;- $sslip = $this->sslip($this->server);- if (Str::of($serviceVariables)->contains('SERVICE_FQDN') || Str::of($serviceVariables)->contains('SERVICE_URL')) {- $defaultUsableFqdn = "http://$serviceName-{$this->uuid}.{$sslip}";- }- if ($configuration->count() > 0) {- foreach ($configuration as $requiredFqdn) {- $requiredFqdn = (array)$requiredFqdn;- $name = data_get($requiredFqdn, 'name');- $path = data_get($requiredFqdn, 'path');- $customFqdn = data_get($requiredFqdn, 'customFqdn');- if ($serviceName === $name) {- $defaultUsableFqdn = "http://$serviceName-{$this->uuid}.{$sslip}{$path}";- if ($customFqdn) {- $defaultUsableFqdn = "http://$customFqdn-{$this->uuid}.{$sslip}{$path}";- }- }- }- }- return $defaultUsableFqdn ?? null;- }+ // private function generateFqdn($serviceVariables, $serviceName, Collection $configuration)+ // {+ // // Add sslip.io to the service+ // $defaultUsableFqdn = null;+ // $sslip = $this->sslip($this->server);+ // if (Str::of($serviceVariables)->contains('SERVICE_FQDN') || Str::of($serviceVariables)->contains('SERVICE_URL')) {+ // $defaultUsableFqdn = "http://$serviceName-{$this->uuid}.{$sslip}";+ // }+ // if ($configuration->count() > 0) {+ // foreach ($configuration as $requiredFqdn) {+ // $requiredFqdn = (array)$requiredFqdn;+ // $name = data_get($requiredFqdn, 'name');+ // $path = data_get($requiredFqdn, 'path');+ // $customFqdn = data_get($requiredFqdn, 'customFqdn');+ // if ($serviceName === $name) {+ // $defaultUsableFqdn = "http://$serviceName-{$this->uuid}.{$sslip}{$path}";+ // if ($customFqdn) {+ // $defaultUsableFqdn = "http://$customFqdn-{$this->uuid}.{$sslip}{$path}";+ // }+ // }+ // }+ // }+ // return $defaultUsableFqdn ?? null;+ // }public function parse(bool $isNew = false): Collection{// ray()->clearAll();@@ -376,14 +376,10 @@ class Service extends BaseModel$generatedServiceFQDNS->put($key->value(), $fqdn);}} else {- ray($key, $fqdn);$generatedServiceFQDNS->put($key->value(), $fqdn);}$fqdn = "http://$containerName.$sslip$path";-- ray($fqdn);}-if (!$isDatabase) {$savedService->fqdn = $fqdn;$savedService->save();diff --git a/resources/views/components/navbar-subscription.blade.php b/resources/views/components/navbar-subscription.blade.phpindex 91629f99e3..ddb9d1a44f 100644--- a/resources/views/components/navbar-subscription.blade.php+++ b/resources/views/components/navbar-subscription.blade.php@@ -11,9 +11,9 @@</svg></a></li>- <li title="Send feedback or get help" class="fixed top-0 right-0 p-2 px-4 pt-4 mt-auto">+ <li title="Send us feedback or get help!" class="fixed top-0 right-0 p-2 px-4 pt-4 mt-auto text-xs"><div class="justify-center" wire:click="help" onclick="help.showModal()">- <svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <svg class="w-5 h-5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor"d="M22 5.5H9c-1.1 0-2 .9-2 2v9a2 2 0 0 0 2 2h13c1.11 0 2-.89 2-2v-9a2 2 0 0 0-2-2m0 11H9V9.17l6.5 3.33L22 9.17v7.33m-6.5-5.69L9 7.5h13l-6.5 3.31M5 16.5c0 .17.03.33.05.5H1c-.552 0-1-.45-1-1s.448-1 1-1h4v1.5M3 7h2.05c-.02.17-.05.33-.05.5V9H3c-.55 0-1-.45-1-1s.45-1 1-1m-2 5c0-.55.45-1 1-1h3v2H2c-.55 0-1-.45-1-1Z" /></svg>diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.phpindex 4a86f7dd5b..ca0410284c 100644--- a/resources/views/components/navbar.blade.php+++ b/resources/views/components/navbar.blade.php@@ -115,9 +115,9 @@</li>@endif@if (isSubscriptionActive() || isDev())- <li title="Send feedback or get help" class="fixed top-0 right-0 p-2 px-4 pt-4 mt-auto">+ <li title="Send us feedback or get help!" class="fixed top-0 right-0 p-2 px-4 pt-4 mt-auto text-xs"><div class="justify-center" wire:click="help" onclick="help.showModal()">- <svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">+ <svg class="w-5 h-5" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path fill="currentColor"d="M22 5.5H9c-1.1 0-2 .9-2 2v9a2 2 0 0 0 2 2h13c1.11 0 2-.89 2-2v-9a2 2 0 0 0-2-2m0 11H9V9.17l6.5 3.33L22 9.17v7.33m-6.5-5.69L9 7.5h13l-6.5 3.31M5 16.5c0 .17.03.33.05.5H1c-.552 0-1-.45-1-1s.448-1 1-1h4v1.5M3 7h2.05c-.02.17-.05.33-.05.5V9H3c-.55 0-1-.45-1-1s.45-1 1-1m-2 5c0-.55.45-1 1-1h3v2H2c-.55 0-1-.45-1-1Z" /></svg>diff --git a/resources/views/livewire/project/service/index.blade.php b/resources/views/livewire/project/service/index.blade.phpindex 8c08f1ff23..8494115b9e 100644--- a/resources/views/livewire/project/service/index.blade.php+++ b/resources/views/livewire/project/service/index.blade.php@@ -1,7 +1,7 @@-<div x-data="{ raw: true, activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }">+<div x-data="{ raw: true, activeTab: window.location.hash ? window.location.hash.substring(1) : 'service-stack' }" wire:poll.10000ms="checkStatus"><livewire:project.service.navbar :service="$service" :parameters="$parameters" :query="$query" /><div class="flex h-full pt-6">- <div class="flex flex-col gap-4 min-w-fit">+ <div class="flex flex-col items-start gap-4 min-w-fit"><a target="_blank" href="{{ $service->documentation() }}">Documentation <x-external-link /></a><a :class="activeTab === 'service-stack' && 'text-white'"@click.prevent="activeTab = 'service-stack'; window.location.hash = 'service-stack'"@@ -23,7 +23,6 @@<div>Configuration</div></div><x-forms.button type="submit">Save</x-forms.button>- <x-forms.button wire:click='manualRefreshStack'>Refresh Status</x-forms.button><div x-cloak x-show="raw"><x-forms.button class="w-64" @click.prevent="raw = !raw">Show DeployableCompose</x-forms.button>@@ -59,7 +58,7 @@</div></form><div class="grid grid-cols-1 gap-2 pt-4 xl:grid-cols-3">- @foreach ($applications as $application)+ @foreach ($service->applications as $application)<a @class(['border-l border-dashed border-red-500' => Str::of($application->status)->contains(['exited']),@@ -107,7 +106,7 @@<span class="text-xs text-error">(configuration required)</span>@endif@if ($database->description)- <span class="text-xs">{{ Str::limit($database->description, 60) }}</span>+ <span class="text-xs">{{ Str::limit($database->description, 60) }}</span>@endif<div class="text-xs">{{ $database->status }}</div></a>