mirror of
https://github.com/ershisan99/coolify.git
synced 2025-12-17 20:49:32 +00:00
lots of UI fixes
This commit is contained in:
@@ -117,7 +117,7 @@ class ApplicationDeploymentJob implements ShouldQueue
|
||||
} else {
|
||||
$this->deploy();
|
||||
}
|
||||
if ($this->application->fqdn) dispatch(new ProxyCheckJob($this->server));
|
||||
if ($this->application->fqdn) dispatch(new ProxyStartJob($this->server));
|
||||
$this->next(ApplicationDeploymentStatus::FINISHED->value);
|
||||
} catch (\Exception $e) {
|
||||
ray($e);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Actions\Proxy\InstallProxy;
|
||||
use App\Actions\Proxy\StartProxy;
|
||||
use App\Enums\ProxyTypes;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
@@ -15,30 +15,20 @@ class ProxyCheckJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(protected Server|null $server = null)
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
$container_name = 'coolify-proxy';
|
||||
if ($this->server) {
|
||||
ray('Checking proxy for server: ' . $this->server->name);
|
||||
$status = get_container_status(server: $this->server, container_id: $container_name);
|
||||
$servers = Server::isUsable()->whereNotNull('proxy')->get();
|
||||
foreach ($servers as $server) {
|
||||
$status = get_container_status(server: $server, container_id: $container_name);
|
||||
if ($status === 'running') {
|
||||
return;
|
||||
}
|
||||
resolve(InstallProxy::class)($this->server);
|
||||
} else {
|
||||
$servers = Server::whereRelation('settings', 'is_usable', true)->get();
|
||||
|
||||
foreach ($servers as $server) {
|
||||
$status = get_container_status(server: $server, container_id: $container_name);
|
||||
if ($status === 'running') {
|
||||
continue;
|
||||
}
|
||||
resolve(InstallProxy::class)($server);
|
||||
continue;
|
||||
}
|
||||
resolve(StartProxy::class)($server);
|
||||
}
|
||||
} catch (\Throwable $th) {
|
||||
ray($th->getMessage());
|
||||
|
||||
35
app/Jobs/ProxyStartJob.php
Executable file
35
app/Jobs/ProxyStartJob.php
Executable file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs;
|
||||
|
||||
use App\Actions\Proxy\StartProxy;
|
||||
use App\Models\Server;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class ProxyStartJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(protected Server $server)
|
||||
{
|
||||
}
|
||||
public function handle()
|
||||
{
|
||||
try {
|
||||
$container_name = 'coolify-proxy';
|
||||
ray('Starting proxy for server: ' . $this->server->name);
|
||||
$status = get_container_status(server: $this->server, container_id: $container_name);
|
||||
if ($status === 'running') {
|
||||
return;
|
||||
}
|
||||
resolve(StartProxy::class)($this->server);
|
||||
} catch (\Throwable $th) {
|
||||
ray($th->getMessage());
|
||||
//throw $th;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user