fix: refactor run-command
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Livewire;
|
||||
|
||||
use App\Models\Server;
|
||||
use Livewire\Attributes\On;
|
||||
use Livewire\Component;
|
||||
|
||||
@@ -13,12 +14,12 @@ class RunCommand extends Component
|
||||
|
||||
public $containers = [];
|
||||
|
||||
public function mount($servers)
|
||||
public function mount()
|
||||
{
|
||||
if (! auth()->user()->isAdmin()) {
|
||||
abort(403);
|
||||
}
|
||||
$this->servers = $servers;
|
||||
$this->servers = Server::isReachable()->get();
|
||||
$this->containers = $this->getAllActiveContainers();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,18 +2,10 @@
|
||||
|
||||
namespace App\Livewire\Terminal;
|
||||
|
||||
use App\Models\Server;
|
||||
use Livewire\Component;
|
||||
|
||||
class Index extends Component
|
||||
{
|
||||
public $servers = [];
|
||||
|
||||
public function mount()
|
||||
{
|
||||
$this->servers = Server::isReachable()->get();
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.terminal.index');
|
||||
|
||||
Reference in New Issue
Block a user