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

View File

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