fix: get service stack as uuid, not name
This commit is contained in:
		@@ -27,12 +27,12 @@ class Index extends Component
 | 
				
			|||||||
            $this->parameters = get_route_parameters();
 | 
					            $this->parameters = get_route_parameters();
 | 
				
			||||||
            $this->query = request()->query();
 | 
					            $this->query = request()->query();
 | 
				
			||||||
            $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
 | 
					            $this->service = Service::whereUuid($this->parameters['service_uuid'])->firstOrFail();
 | 
				
			||||||
            $service = $this->service->applications()->whereName($this->parameters['service_name'])->first();
 | 
					            $service = $this->service->applications()->whereUuid($this->parameters['stack_service_uuid'])->first();
 | 
				
			||||||
            if ($service) {
 | 
					            if ($service) {
 | 
				
			||||||
                $this->serviceApplication = $service;
 | 
					                $this->serviceApplication = $service;
 | 
				
			||||||
                $this->serviceApplication->getFilesFromServer();
 | 
					                $this->serviceApplication->getFilesFromServer();
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                $this->serviceDatabase = $this->service->databases()->whereName($this->parameters['service_name'])->first();
 | 
					                $this->serviceDatabase = $this->service->databases()->whereUuid($this->parameters['stack_service_uuid'])->first();
 | 
				
			||||||
                $this->serviceDatabase->getFilesFromServer();
 | 
					                $this->serviceDatabase->getFilesFromServer();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            $this->s3s = currentTeam()->s3s;
 | 
					            $this->s3s = currentTeam()->s3s;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -76,7 +76,7 @@
 | 
				
			|||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
                                <div class="flex items-center px-4">
 | 
					                                <div class="flex items-center px-4">
 | 
				
			||||||
                                    <a class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
 | 
					                                    <a class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
 | 
				
			||||||
                                        href="{{ route('project.service.index', [...$parameters, 'service_name' => $application->name]) }}">
 | 
					                                        href="{{ route('project.service.index', [...$parameters, 'stack_service_uuid' => $application->uuid]) }}">
 | 
				
			||||||
                                        <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
 | 
					                                        <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
 | 
				
			||||||
                                            viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
 | 
					                                            viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
 | 
				
			||||||
                                            stroke-linecap="round" stroke-linejoin="round">
 | 
					                                            stroke-linecap="round" stroke-linejoin="round">
 | 
				
			||||||
@@ -122,7 +122,7 @@
 | 
				
			|||||||
                                </div>
 | 
					                                </div>
 | 
				
			||||||
                                <div class="flex items-center px-4">
 | 
					                                <div class="flex items-center px-4">
 | 
				
			||||||
                                    <a class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
 | 
					                                    <a class="flex flex-col flex-1 group-hover:text-white hover:no-underline"
 | 
				
			||||||
                                        href="{{ route('project.service.index', [...$parameters, 'service_name' => $database->name]) }}">
 | 
					                                        href="{{ route('project.service.index', [...$parameters, 'stack_service_uuid' => $database->uuid]) }}">
 | 
				
			||||||
                                        <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
 | 
					                                        <svg xmlns="http://www.w3.org/2000/svg" class="icon hover:text-warning"
 | 
				
			||||||
                                            viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
 | 
					                                            viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none"
 | 
				
			||||||
                                            stroke-linecap="round" stroke-linejoin="round">
 | 
					                                            stroke-linecap="round" stroke-linejoin="round">
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -163,7 +163,7 @@ Route::middleware(['auth', 'verified'])->group(function () {
 | 
				
			|||||||
    });
 | 
					    });
 | 
				
			||||||
    Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
 | 
					    Route::prefix('project/{project_uuid}/{environment_name}/service/{service_uuid}')->group(function () {
 | 
				
			||||||
        Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
 | 
					        Route::get('/', ServiceConfiguration::class)->name('project.service.configuration');
 | 
				
			||||||
        Route::get('/{service_name}', ServiceIndex::class)->name('project.service.index');
 | 
					        Route::get('/{stack_service_uuid}', ServiceIndex::class)->name('project.service.index');
 | 
				
			||||||
        Route::get('/command', ExecuteContainerCommand::class)->name('project.service.command');
 | 
					        Route::get('/command', ExecuteContainerCommand::class)->name('project.service.command');
 | 
				
			||||||
        Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.service.scheduled-tasks');
 | 
					        Route::get('/tasks/{task_uuid}', ScheduledTaskShow::class)->name('project.service.scheduled-tasks');
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user