2023-05-03 05:23:45 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire\Server;
|
|
|
|
|
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 = '';
|
|
|
|
|
|
|
|
public function mount(Server $server)
|
|
|
|
{
|
|
|
|
$this->server = $server;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function runInstallProxy()
|
|
|
|
{
|
2023-05-03 06:53:50 +00:00
|
|
|
$activity = remoteProcess(['ls -alh'], $this->server, ActivityTypes::INLINE->value);
|
2023-05-03 05:23:45 +00:00
|
|
|
|
|
|
|
$this->emit('newMonitorActivity', $activity->id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.server.proxy');
|
|
|
|
}
|
|
|
|
}
|