fix: service ui structure
This commit is contained in:
@@ -9,16 +9,22 @@ use Livewire\Component;
|
||||
|
||||
class Configuration extends Component
|
||||
{
|
||||
public $currentRoute;
|
||||
|
||||
public $project;
|
||||
|
||||
public $environment;
|
||||
|
||||
public ?Service $service = null;
|
||||
|
||||
public $applications;
|
||||
|
||||
public $databases;
|
||||
|
||||
public array $parameters;
|
||||
|
||||
public array $query;
|
||||
|
||||
public array $parameters;
|
||||
|
||||
public function getListeners()
|
||||
{
|
||||
$userId = Auth::id();
|
||||
@@ -38,11 +44,21 @@ class Configuration extends Component
|
||||
public function mount()
|
||||
{
|
||||
$this->parameters = get_route_parameters();
|
||||
$this->currentRoute = request()->route()->getName();
|
||||
$this->query = request()->query();
|
||||
$this->service = Service::whereUuid($this->parameters['service_uuid'])->first();
|
||||
if (! $this->service) {
|
||||
return redirect()->route('dashboard');
|
||||
}
|
||||
$project = currentTeam()
|
||||
->projects()
|
||||
->select('id', 'uuid', 'team_id')
|
||||
->where('uuid', request()->route('project_uuid'))
|
||||
->firstOrFail();
|
||||
$environment = $project->environments()
|
||||
->select('id', 'name', 'project_id')
|
||||
->where('name', request()->route('environment_name'))
|
||||
->firstOrFail();
|
||||
$this->service = $environment->services()->whereUuid(request()->route('service_uuid'))->firstOrFail();
|
||||
|
||||
$this->project = $project;
|
||||
$this->environment = $environment;
|
||||
$this->applications = $this->service->applications->sort();
|
||||
$this->databases = $this->service->databases->sort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user