Skip to content

Commit f134171

Browse files
committed
fix: restart proxy does not work + status indicator on the UI
1 parent 320204d commit f134171

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

app/Livewire/Server/Proxy/Deploy.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function traefikDashboardAvailable(bool $data)
5050
public function proxyStarted()
5151
{
5252
CheckProxy::run($this->server, true);
53-
$this->dispatch('success', 'Proxy started.');
53+
$this->dispatch('proxyStatusUpdated');
5454
}
5555

5656
public function proxyStatusUpdated()
@@ -61,7 +61,7 @@ public function proxyStatusUpdated()
6161
public function restart()
6262
{
6363
try {
64-
$this->stop();
64+
$this->stop(forceStop: false);
6565
$this->dispatch('checkProxy');
6666
} catch (\Throwable $e) {
6767
return handleError($e, $this);
@@ -91,7 +91,7 @@ public function startProxy()
9191
}
9292
}
9393

94-
public function stop()
94+
public function stop(bool $forceStop = true)
9595
{
9696
try {
9797
if ($this->server->isSwarm()) {
@@ -104,7 +104,7 @@ public function stop()
104104
], $this->server);
105105
}
106106
$this->server->proxy->status = 'exited';
107-
$this->server->proxy->force_stop = true;
107+
$this->server->proxy->force_stop = $forceStop;
108108
$this->server->save();
109109
$this->dispatch('proxyStatusUpdated');
110110
} catch (\Throwable $e) {

app/Livewire/Server/Proxy/Status.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class Status extends Component
1616

1717
public int $numberOfPolls = 0;
1818

19-
protected $listeners = ['proxyStatusUpdated' => '$refresh', 'startProxyPolling'];
19+
protected $listeners = [
20+
'proxyStatusUpdated',
21+
'startProxyPolling',
22+
];
2023

2124
public function startProxyPolling()
2225
{

0 commit comments

Comments
 (0)