fix: create destination properly
This commit is contained in:
@@ -83,9 +83,7 @@ class Docker extends Component
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$connectProxyToDockerNetworks = connectProxyToNetworks($this->selectedServer);
|
$this->redirect(route('destination.show', $docker->uuid));
|
||||||
instant_remote_process($connectProxyToDockerNetworks, $this->selectedServer, false);
|
|
||||||
$this->dispatch('reloadWindow');
|
|
||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
return handleError($e, $this);
|
return handleError($e, $this);
|
||||||
}
|
}
|
||||||
|
@@ -6,6 +6,19 @@ class StandaloneDocker extends BaseModel
|
|||||||
{
|
{
|
||||||
protected $guarded = [];
|
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()
|
public function applications()
|
||||||
{
|
{
|
||||||
return $this->morphMany(Application::class, 'destination');
|
return $this->morphMany(Application::class, 'destination');
|
||||||
|
Reference in New Issue
Block a user