fix: create destination properly
This commit is contained in:
parent
0905479c8b
commit
18f03dc173
2 changed files with 14 additions and 3 deletions
|
|
@ -83,9 +83,7 @@ public function submit()
|
|||
]);
|
||||
}
|
||||
}
|
||||
$connectProxyToDockerNetworks = connectProxyToNetworks($this->selectedServer);
|
||||
instant_remote_process($connectProxyToDockerNetworks, $this->selectedServer, false);
|
||||
$this->dispatch('reloadWindow');
|
||||
$this->redirect(route('destination.show', $docker->uuid));
|
||||
} catch (\Throwable $e) {
|
||||
return handleError($e, $this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,19 @@ class StandaloneDocker extends BaseModel
|
|||
{
|
||||
protected $guarded = [];
|
||||
|
||||
protected static function boot()
|
||||
{
|
||||
parent::boot();
|
||||
static::created(function ($newStandaloneDocker) {
|
||||
$server = $newStandaloneDocker->server;
|
||||
instant_remote_process([
|
||||
"docker network inspect $newStandaloneDocker->network >/dev/null 2>&1 || docker network create --driver overlay --attachable $newStandaloneDocker->network >/dev/null",
|
||||
], $server, false);
|
||||
$connectProxyToDockerNetworks = connectProxyToNetworks($server);
|
||||
instant_remote_process($connectProxyToDockerNetworks, $server, false);
|
||||
});
|
||||
}
|
||||
|
||||
public function applications()
|
||||
{
|
||||
return $this->morphMany(Application::class, 'destination');
|
||||
|
|
|
|||
Loading…
Reference in a new issue