2023-08-29 14:36:17 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Livewire;
|
|
|
|
|
|
|
|
use App\Models\Project;
|
|
|
|
use App\Models\Server;
|
|
|
|
use Livewire\Component;
|
|
|
|
|
|
|
|
class Dashboard extends Component
|
|
|
|
{
|
2023-10-10 10:56:11 +02:00
|
|
|
public $projects = [];
|
|
|
|
public $servers = [];
|
2023-12-05 12:18:23 +01:00
|
|
|
// protected $listeners = ['echo:public,TestEvent' => 'notifyNewOrder'];
|
2023-12-05 11:17:52 +01:00
|
|
|
|
2023-12-05 12:18:23 +01:00
|
|
|
// public function notifyNewOrder()
|
|
|
|
// {
|
|
|
|
// $this->emit('success', 'New order received!');
|
|
|
|
// }
|
2023-08-29 14:36:17 +02:00
|
|
|
public function mount()
|
|
|
|
{
|
2023-10-10 10:56:11 +02:00
|
|
|
$this->servers = Server::ownedByCurrentTeam()->get();
|
2023-10-11 10:08:37 +02:00
|
|
|
$this->projects = Project::ownedByCurrentTeam()->get();
|
2023-08-29 14:36:17 +02:00
|
|
|
}
|
2023-09-04 16:03:11 +02:00
|
|
|
// public function getIptables()
|
|
|
|
// {
|
|
|
|
// $servers = Server::ownedByCurrentTeam()->get();
|
|
|
|
// foreach ($servers as $server) {
|
|
|
|
// checkRequiredCommands($server);
|
|
|
|
// $iptables = instant_remote_process(['docker run --privileged --net=host --pid=host --ipc=host --volume /:/host busybox chroot /host bash -c "iptables -L -n | jc --iptables"'], $server);
|
|
|
|
// ray($iptables);
|
|
|
|
// }
|
|
|
|
// }
|
2023-08-29 14:36:17 +02:00
|
|
|
public function render()
|
|
|
|
{
|
|
|
|
return view('livewire.dashboard');
|
|
|
|
}
|
|
|
|
}
|