ui: fixes

This commit is contained in:
Andras Bacsai 2023-09-24 10:55:15 +02:00
parent 92a53a151e
commit 250d7cbc53
5 changed files with 14 additions and 14 deletions

View File

@ -28,14 +28,14 @@ class StartProxy
$commands = $commands->merge([ $commands = $commands->merge([
"apt-get update > /dev/null 2>&1 || true", "apt-get update > /dev/null 2>&1 || true",
"command -v lsof >/dev/null || echo '####### Installing lsof...'", "command -v lsof >/dev/null || echo '####### Installing lsof.'",
"command -v lsof >/dev/null || apt install -y lsof", "command -v lsof >/dev/null || apt install -y lsof",
"command -v lsof >/dev/null || command -v fuser >/dev/null || apt install -y psmisc", "command -v lsof >/dev/null || command -v fuser >/dev/null || apt install -y psmisc",
"mkdir -p $proxy_path && cd $proxy_path", "mkdir -p $proxy_path && cd $proxy_path",
"echo '####### Creating Docker Compose file...'", "echo '####### Creating Docker Compose file.'",
"echo '####### Pulling docker image...'", "echo '####### Pulling docker image.'",
'docker compose pull', 'docker compose pull',
"echo '####### Stopping existing coolify-proxy...'", "echo '####### Stopping existing coolify-proxy.'",
"docker compose down -v --remove-orphans > /dev/null 2>&1", "docker compose down -v --remove-orphans > /dev/null 2>&1",
"command -v fuser >/dev/null || command -v lsof >/dev/null || echo '####### Could not kill existing processes listening on port 80 & 443. Please stop the process holding these ports...'", "command -v fuser >/dev/null || command -v lsof >/dev/null || echo '####### Could not kill existing processes listening on port 80 & 443. Please stop the process holding these ports...'",
"command -v lsof >/dev/null && lsof -nt -i:80 | xargs -r kill -9 || true", "command -v lsof >/dev/null && lsof -nt -i:80 | xargs -r kill -9 || true",
@ -45,9 +45,9 @@ class StartProxy
"systemctl disable nginx > /dev/null 2>&1 || true", "systemctl disable nginx > /dev/null 2>&1 || true",
"systemctl disable apache2 > /dev/null 2>&1 || true", "systemctl disable apache2 > /dev/null 2>&1 || true",
"systemctl disable apache > /dev/null 2>&1 || true", "systemctl disable apache > /dev/null 2>&1 || true",
"echo '####### Starting coolify-proxy...'", "echo '####### Starting coolify-proxy.'",
'docker compose up -d --remove-orphans', 'docker compose up -d --remove-orphans',
"echo '####### Proxy installed successfully...'" "echo '####### Proxy installed successfully.'"
]); ]);
$commands = $commands->merge(connectProxyToNetworks($server)); $commands = $commands->merge(connectProxyToNetworks($server));
if (!$async) { if (!$async) {

View File

@ -20,7 +20,7 @@ function connectProxyToNetworks(Server $server) {
$commands = $networks->map(function ($network) { $commands = $networks->map(function ($network) {
return [ return [
"echo '####### Connecting coolify-proxy to $network network...'", "echo '####### Connecting coolify-proxy to $network network...'",
"docker network ls --format '{{.Name}}' | grep '^$network$' || docker network create --attachable $network", "docker network ls --format '{{.Name}}' | grep '^$network$' || docker network create --attachable $network >/dev/null",
"docker network connect $network coolify-proxy >/dev/null 2>&1 || true", "docker network connect $network coolify-proxy >/dev/null 2>&1 || true",
]; ];
}); });

View File

@ -101,7 +101,7 @@ function generateSshCommand(Server $server, string $command, bool $isMux = true)
. " 'bash -se' << \\$delimiter" . PHP_EOL . " 'bash -se' << \\$delimiter" . PHP_EOL
. $command . PHP_EOL . $command . PHP_EOL
. $delimiter; . $delimiter;
ray($ssh_command); // ray($ssh_command);
return $ssh_command; return $ssh_command;
} }
function instant_remote_process(Collection|array $command, Server $server, $throwError = true) function instant_remote_process(Collection|array $command, Server $server, $throwError = true)

View File

@ -24,7 +24,7 @@
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path> <path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path> <path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z"></path>
</svg> </svg>
Stop Stop Proxy
</x-forms.button> </x-forms.button>
</div> </div>
@else @else

View File

@ -1,12 +1,12 @@
<div> <div>
@if ($server->isFunctional()) @if ($server->isFunctional())
<div class="flex gap-2" x-init="$wire.getProxyStatus"> <div class="flex gap-2" x-init="$wire.getProxyStatus">
@if ($server->proxy->status === 'running') @if (data_get($server, 'proxy.status') === 'running')
<x-status.running text="Proxy Running" /> <x-status.running status="Proxy Running" />
@elseif ($server->proxy->status === 'restarting') @elseif (data_get($server, 'proxy.status') === 'restarting')
<x-status.restarting text="Proxy Restarting" /> <x-status.restarting status="Proxy Restarting" />
@else @else
<x-status.stopped text="Proxy Stopped" /> <x-status.stopped status="Proxy Stopped" />
@endif @endif
<button wire:loading.remove.delay.longer wire:click.prevent='getProxyStatusWithNoti'> <button wire:loading.remove.delay.longer wire:click.prevent='getProxyStatusWithNoti'>
<svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"> <svg class="icon" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">