Refactor deployments_per_server variable and update dashboard view

This commit refactors the `deployments_per_server` variable in the `Dashboard` class to remove the type hint and updates the corresponding view file to handle the changes. The `deployments_per_server` variable is now grouped by `server_name` and converted to an array. This improves the organization and readability of the code.
This commit is contained in:
Andras Bacsai
2024-01-29 13:26:50 +01:00
parent de3a7b6eca
commit f7853ee174
2 changed files with 29 additions and 23 deletions

View File

@@ -12,7 +12,7 @@ class Dashboard extends Component
{
public $projects = [];
public Collection $servers;
public Collection $deployments_per_server;
public $deployments_per_server;
public function mount()
{
$this->servers = Server::ownedByCurrentTeam()->get();
@@ -30,7 +30,7 @@ class Dashboard extends Component
"server_name",
"server_id",
"status"
])->sortBy('id');
])->sortBy('id')->groupBy('server_name')->toArray();
}
// public function getIptables()
// {