2023-05-03 05:23:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Server;
|
|
|
|
|
2023-05-12 18:42:39 +00:00
|
|
|
use App\Actions\Proxy\CheckProxySettingsInSync;
|
2023-05-03 08:27:44 +00:00
|
|
|
use App\Actions\Proxy\InstallProxy;
|
2023-05-03 06:53:50 +00:00
|
|
|
use App\Enums\ActivityTypes;
|
2023-05-03 05:23:45 +00:00
|
|
|
use App\Models\Server;
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class Proxy extends Component
|
|
|
|
{
|
|
|
|
public Server $server;
|
|
|
|
|
|
|
|
protected string $selectedProxy = '';
|
|
|
|
|
2023-05-12 18:15:36 +00:00
|
|
|
public $is_proxy_installed;
|
|
|
|
|
|
|
|
public $is_check_proxy_complete = false;
|
|
|
|
public $is_proxy_settings_in_sync = false;
|
|
|
|
|
2023-05-03 05:23:45 +00:00
|
|
|
public function mount(Server $server)
|
|
|
|
{
|
|
|
|
$this->server = $server;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function runInstallProxy()
|
|
|
|
{
|
2023-05-03 08:27:44 +00:00
|
|
|
$activity = resolve(InstallProxy::class)($this->server);
|
2023-05-03 05:23:45 +00:00
|
|
|
|
|
|
|
$this->emit('newMonitorActivity', $activity->id);
|
|
|
|
}
|
|
|
|
|
2023-05-12 18:15:36 +00:00
|
|
|
public function checkProxySettingsInSync()
|
|
|
|
{
|
2023-05-12 18:51:07 +00:00
|
|
|
$this->is_proxy_settings_in_sync = resolve(CheckProxySettingsInSync::class)($this->server);
|
|
|
|
|
2023-05-12 18:15:36 +00:00
|
|
|
$this->is_check_proxy_complete = true;
|
|
|
|
}
|
|
|
|
|
2023-05-03 05:23:45 +00:00
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.server.proxy');
|
|
|
|
}
|
|
|
|
}
|