wip: broadcast

This commit is contained in:
Andras Bacsai
2023-12-04 20:47:32 +01:00
parent 17deff4d86
commit 42ee4ca032
22 changed files with 142 additions and 103 deletions

View File

@@ -26,7 +26,7 @@ class Configuration extends Component
return redirect()->route('dashboard');
}
$this->application = $application;
$mainServer = $application->destination->server;
$mainServer = $this->application->destination->server;
$servers = Server::ownedByCurrentTeam()->get();
$this->servers = $servers->filter(function ($server) use ($mainServer) {
return $server->id != $mainServer->id;

View File

@@ -17,11 +17,7 @@ class DeploymentNavbar extends Component
public Application $application;
public Server $server;
public bool $is_debug_enabled = false;
protected $listeners = ['deploymentFinished','echo:custom-channel,ApplicationDeploymentFinished' => 'notifyNewOrder'];
public function notifyNewOrder() {
ray('New order received');
}
protected $listeners = ['deploymentFinished'];
public function mount()
{
$this->application = Application::find($this->application_deployment_queue->application_id);

View File

@@ -11,11 +11,24 @@ use Visus\Cuid2\Cuid2;
class Heading extends Component
{
protected string $deploymentUuid;
public Application $application;
public array $parameters;
public function getListeners()
{
$teamId = auth()->user()->currentTeam()->id;
return [
"echo-private:custom.{$teamId},ApplicationDeploymentFinished" => 'updateStatus',
];
}
protected string $deploymentUuid;
public function updateStatus($message)
{
$applicationUuid = data_get($message, 'applicationUuid');
if ($this->application->uuid === $applicationUuid) {
$this->application->status = data_get($message, 'status');
}
}
public function mount()
{
$this->parameters = get_route_parameters();