mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-19 16:15:37 +00:00
fix: streamline proxy status handling in StartProxy and Navbar components
This commit is contained in:
1 parent
9c152fd40a
commit
bd88bbca5b
2 files changed
+6
-4
No files matched your search
@@ -19,6 +19,11 @@ class StartProxy
|
|||||||
if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) {
|
if ((is_null($proxyType) || $proxyType === 'NONE' || $server->proxy->force_stop || $server->isBuildServer()) && $force === false) {
|
||||||
return 'OK';
|
return 'OK';
|
||||||
}
|
}
|
||||||
|
$server->proxy->set('status', 'starting');
|
||||||
|
$server->save();
|
||||||
|
$server->refresh();
|
||||||
|
ProxyStatusChangedUI::dispatch($server->team_id);
|
||||||
|
|
||||||
$commands = collect([]);
|
$commands = collect([]);
|
||||||
$proxy_path = $server->proxyPath();
|
$proxy_path = $server->proxyPath();
|
||||||
$configuration = GetProxyConfiguration::run($server);
|
$configuration = GetProxyConfiguration::run($server);
|
||||||
@@ -64,14 +69,12 @@ class StartProxy
|
|||||||
]);
|
]);
|
||||||
$commands = $commands->merge(connectProxyToNetworks($server));
|
$commands = $commands->merge(connectProxyToNetworks($server));
|
||||||
}
|
}
|
||||||
$server->proxy->set('status', 'starting');
|
|
||||||
$server->save();
|
|
||||||
ProxyStatusChangedUI::dispatch($server->team_id);
|
|
||||||
|
|
||||||
if ($async) {
|
if ($async) {
|
||||||
return remote_process($commands, $server, callEventOnFinish: 'ProxyStatusChanged', callEventData: $server->id);
|
return remote_process($commands, $server, callEventOnFinish: 'ProxyStatusChanged', callEventData: $server->id);
|
||||||
} else {
|
} else {
|
||||||
instant_remote_process($commands, $server);
|
instant_remote_process($commands, $server);
|
||||||
|
|
||||||
$server->proxy->set('type', $proxyType);
|
$server->proxy->set('type', $proxyType);
|
||||||
$server->save();
|
$server->save();
|
||||||
ProxyStatusChanged::dispatch($server->id);
|
ProxyStatusChanged::dispatch($server->id);
|
||||||
|
|||||||
@@ -120,7 +120,6 @@ class Navbar extends Component
|
|||||||
{
|
{
|
||||||
$this->server->refresh();
|
$this->server->refresh();
|
||||||
$this->proxyStatus = $this->server->proxy->status ?? 'unknown';
|
$this->proxyStatus = $this->server->proxy->status ?? 'unknown';
|
||||||
$forceStop = $this->server->proxy->force_stop ?? false;
|
|
||||||
|
|
||||||
switch ($this->proxyStatus) {
|
switch ($this->proxyStatus) {
|
||||||
case 'running':
|
case 'running':
|
||||||
|
|||||||
Reference in new issue
Block a user