rector: arrrrr

This commit is contained in:
Andras Bacsai
2025-01-07 14:52:08 +01:00
parent c702ebff6d
commit 16c0cd10d8
349 changed files with 4204 additions and 3712 deletions

View File

@@ -10,6 +10,7 @@ use Carbon\Carbon;
use Illuminate\Process\InvokedProcess;
use Illuminate\Support\Facades\Process;
use Livewire\Component;
use Throwable;
class Deploy extends Component
{
@@ -38,11 +39,7 @@ class Deploy extends Component
public function mount()
{
if ($this->server->id === 0) {
$this->serverIp = base_ip();
} else {
$this->serverIp = $this->server->ip;
}
$this->serverIp = $this->server->id === 0 ? base_ip() : $this->server->ip;
$this->currentRoute = request()->route()->getName();
}
@@ -67,9 +64,11 @@ class Deploy extends Component
try {
$this->stop();
$this->dispatch('checkProxy');
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function checkProxy()
@@ -78,9 +77,11 @@ class Deploy extends Component
CheckProxy::run($this->server, true);
$this->dispatch('startProxyPolling');
$this->dispatch('proxyChecked');
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function startProxy()
@@ -90,9 +91,11 @@ class Deploy extends Component
$this->server->save();
$activity = StartProxy::run($this->server, force: true);
$this->dispatch('activityMonitor', $activity->id, ProxyStatusChanged::class);
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
}
return null;
}
public function stop(bool $forceStop = true)
@@ -114,7 +117,7 @@ class Deploy extends Component
}
$this->removeContainer($containerName);
} catch (\Throwable $e) {
} catch (Throwable $e) {
return handleError($e, $this);
} finally {
$this->server->proxy->force_stop = $forceStop;
@@ -122,6 +125,8 @@ class Deploy extends Component
$this->server->save();
$this->dispatch('proxyStatusUpdated');
}
return null;
}
private function stopContainer(string $containerName, int $timeout): InvokedProcess