Merge branch 'next' into feat-db-ssl

This commit is contained in:
🏔️ Peak
2025-02-19 17:57:59 +01:00
committed by GitHub
24 changed files with 224 additions and 104 deletions

View File

@@ -35,10 +35,18 @@ class Docker extends Component
$this->network = new Cuid2;
$this->servers = Server::isUsable()->get();
if ($server_id) {
$this->selectedServer = $this->servers->find($server_id) ?: $this->servers->first();
$foundServer = $this->servers->find($server_id) ?: $this->servers->first();
if (! $foundServer) {
throw new \Exception('Server not found.');
}
$this->selectedServer = $foundServer;
$this->serverId = $this->selectedServer->id;
} else {
$this->selectedServer = $this->servers->first();
$foundServer = $this->servers->first();
if (! $foundServer) {
throw new \Exception('Server not found.');
}
$this->selectedServer = $foundServer;
$this->serverId = $this->selectedServer->id;
}
$this->generateName();

View File

@@ -53,13 +53,13 @@ class DeploymentNavbar extends Component
public function cancel()
{
$kill_command = "docker rm -f {$this->application_deployment_queue->deployment_uuid}";
$build_server_id = $this->application_deployment_queue->build_server_id;
$build_server_id = $this->application_deployment_queue->build_server_id ?? $this->application->destination->server_id;
$server_id = $this->application_deployment_queue->server_id ?? $this->application->destination->server_id;
try {
if ($this->application->settings->is_build_server_enabled) {
$server = Server::find($build_server_id);
$server = Server::ownedByCurrentTeam()->find($build_server_id);
} else {
$server = Server::find($server_id);
$server = Server::ownedByCurrentTeam()->find($server_id);
}
if ($this->application_deployment_queue->logs) {
$previous_logs = json_decode($this->application_deployment_queue->logs, associative: true, flags: JSON_THROW_ON_ERROR);

View File

@@ -32,7 +32,7 @@ class Configuration extends Component
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'check_status',
'check_status',
'refresh' => '$refresh',
'refreshStatus' => '$refresh',
];
}
@@ -99,7 +99,7 @@ class Configuration extends Component
$this->service->databases->each(function ($database) {
$database->refresh();
});
$this->dispatch('refresh');
$this->dispatch('refreshStatus');
} catch (\Exception $e) {
return handleError($e, $this);
}

View File

@@ -40,6 +40,7 @@ class Navbar extends Component
return [
"echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted',
'envsUpdated' => '$refresh',
'refreshStatus' => '$refresh',
];
}

View File

@@ -7,6 +7,7 @@ use App\Actions\Server\StopSentinel;
use App\Events\ServerReachabilityChanged;
use App\Models\Server;
use Livewire\Attributes\Computed;
use Livewire\Attributes\Locked;
use Livewire\Attributes\Validate;
use Livewire\Component;
@@ -50,6 +51,9 @@ class Show extends Component
#[Validate(['required'])]
public bool $isBuildServer;
#[Locked]
public bool $isBuildServerLocked = false;
#[Validate(['required'])]
public bool $isMetricsEnabled;
@@ -95,6 +99,9 @@ class Show extends Component
try {
$this->server = Server::ownedByCurrentTeam()->whereUuid($server_uuid)->firstOrFail();
$this->syncData();
if (! $this->server->isEmpty()) {
$this->isBuildServerLocked = true;
}
} catch (\Throwable $e) {
return handleError($e, $this);
}