fix: proxy UI

This commit is contained in:
Andras Bacsai
2023-07-28 14:44:26 +02:00
parent 6aa6f4c8a2
commit 5b6406d09d
10 changed files with 52 additions and 113 deletions

View File

@@ -50,13 +50,15 @@ class StartProxy
"echo 'Creating Docker Compose file...'",
"echo 'Pulling docker image...'",
'docker compose pull -q',
"echo 'Stopping old proxy...'",
"echo 'Stopping existing proxy...'",
'docker compose down -v --remove-orphans',
"echo 'Starting new proxy...'",
"lsof -nt -i:80 | xargs -r kill -9",
"lsof -nt -i:443 | xargs -r kill -9",
"echo 'Starting proxy...'",
'docker compose up -d --remove-orphans',
"echo 'Proxy installed successfully...'"
], $server);
return $activity;
}
}
}

View File

@@ -25,29 +25,20 @@ class Proxy extends Component
{
$this->server->refresh();
}
public function switchProxy()
public function change_proxy()
{
$this->server->proxy = null;
$this->server->save();
$this->emit('proxyStatusUpdated');
}
public function setProxy(string $proxy_type)
public function select_proxy(string $proxy_type)
{
$this->server->proxy->type = $proxy_type;
$this->server->proxy->status = 'exited';
$this->server->save();
$this->emit('proxyStatusUpdated');
}
public function stopProxy()
{
instant_remote_process([
"docker rm -f coolify-proxy",
], $this->server);
$this->server->proxy->status = 'exited';
$this->server->save();
$this->emit('proxyStatusUpdated');
}
public function saveConfiguration()
public function submit()
{
try {
$proxy_path = config('coolify.proxy_config_path');
@@ -67,7 +58,7 @@ class Proxy extends Component
return general_error_handler(err: $e);
}
}
public function resetProxy()
public function reset_proxy_configuration()
{
try {
$this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server, true);
@@ -75,7 +66,7 @@ class Proxy extends Component
return general_error_handler(err: $e);
}
}
public function checkProxySettingsInSync()
public function load_proxy_configuration()
{
try {
$this->proxy_settings = resolve(CheckProxySettingsInSync::class)($this->server);
@@ -83,4 +74,4 @@ class Proxy extends Component
return general_error_handler(err: $e);
}
}
}
}

View File

@@ -16,7 +16,7 @@ class Deploy extends Component
{
$this->server->refresh();
}
public function deploy()
public function start_proxy()
{
if (
$this->server->proxy->last_applied_settings &&

View File

@@ -14,7 +14,7 @@ class Status extends Component
{
$this->server->refresh();
}
public function proxyStatus()
public function get_status()
{
try {
dispatch_sync(new ProxyContainerStatusJob(
@@ -25,4 +25,4 @@ class Status extends Component
ray($e->getMessage());
}
}
}
}