ui: updated dashboard

This commit is contained in:
Andras Bacsai
2023-10-10 10:56:11 +02:00
parent f2c32b9aeb
commit 46f7ae9588
5 changed files with 95 additions and 30 deletions

View File

@@ -9,21 +9,21 @@ use Livewire\Component;
class Dashboard extends Component
{
public int $projects = 0;
public int $servers = 0;
public $projects = [];
public $servers = [];
public int $s3s = 0;
public int $resources = 0;
public function mount()
{
$this->servers = Server::ownedByCurrentTeam()->get()->count();
$this->servers = Server::ownedByCurrentTeam()->get();
$this->s3s = S3Storage::ownedByCurrentTeam()->get()->count();
$projects = Project::ownedByCurrentTeam()->get();
foreach ($projects as $project) {
$this->resources += $project->applications->count();
$this->resources += $project->postgresqls->count();
}
$this->projects = $projects->count();
$this->projects = $projects;
}
// public function getIptables()
// {