fix: traefik dashboard ip

This commit is contained in:
Andras Bacsai 2023-10-13 14:35:02 +02:00
parent 59eae3a44e
commit 2639bf92ad
2 changed files with 13 additions and 2 deletions

View File

@ -12,10 +12,17 @@ class Deploy extends Component
public Server $server;
public bool $traefikDashboardAvailable = false;
public ?string $currentRoute = null;
public ?string $serverIp = null;
protected $listeners = ['proxyStatusUpdated', 'traefikDashboardAvailable', 'serverRefresh' => 'proxyStatusUpdated', "checkProxy", "startProxy"];
public function mount()
{
if ($this->server->id === 0) {
$this->serverIp = base_ip();
} else {
$this->serverIp = $this->server->ip;
}
$this->currentRoute = request()->route()->getName();
}
public function traefikDashboardAvailable(bool $data)
@ -26,7 +33,11 @@ public function proxyStatusUpdated()
{
$this->server->refresh();
}
public function checkProxy() {
public function ip()
{
}
public function checkProxy()
{
try {
CheckProxy::run($this->server);
$this->emit('startProxyPolling');

View File

@ -12,7 +12,7 @@
<div class="flex gap-4">
@if ($currentRoute === 'server.proxy' && $traefikDashboardAvailable)
<button>
<a target="_blank" href="http://{{ $server->ip }}:8080">
<a target="_blank" href="http://{{ $serverIp }}:8080">
Traefik Dashboard
<x-external-link />
</a>