This commit is contained in:
Joao Patricio
2023-05-12 19:15:36 +01:00
parent 982f5beaf5
commit 931664c0c0
9 changed files with 111 additions and 13 deletions

View File

@@ -3,12 +3,14 @@
namespace App\Actions\Proxy;
use App\Enums\ActivityTypes;
use App\Enums\ProxyTypes;
use App\Models\Server;
use Spatie\Activitylog\Models\Activity;
use Symfony\Component\Yaml\Yaml;
class InstallProxy
{
public function __invoke(Server $server)
public function __invoke(Server $server): Activity
{
$docker_compose_yml_base64 = base64_encode(
$this->getDockerComposeContents()
@@ -30,6 +32,10 @@ class InstallProxy
'docker ps',
], $server, ActivityTypes::INLINE->value);
// Persist to Database
$server->extra_attributes->proxy = ProxyTypes::TRAEFIK_V2->value;
$server->save();
return $activity;
}
@@ -47,8 +53,6 @@ class InstallProxy
? config('proxy.project_path_on_host') . '/_testing_hosts/host_2_proxy'
: '.';
ray($cwd);
return [
"version" => "3.7",
"networks" => [

View File

@@ -13,6 +13,11 @@ class Proxy extends Component
protected string $selectedProxy = '';
public $is_proxy_installed;
public $is_check_proxy_complete = false;
public $is_proxy_settings_in_sync = false;
public function mount(Server $server)
{
$this->server = $server;
@@ -25,6 +30,14 @@ class Proxy extends Component
$this->emit('newMonitorActivity', $activity->id);
}
public function checkProxySettingsInSync()
{
$this->is_check_proxy_complete = true;
$this->is_proxy_settings_in_sync = true;
}
public function render()
{
return view('livewire.server.proxy');