mirror of
https://github.com/tiennm99/coolify.git
synced 2026-04-18 01:20:31 +00:00
feat(project): enhance project index with resource creation capabilities
- Added logic to determine if the user can create resources for each project and generate the corresponding route for adding resources based on the project's first environment. - Updated the project index view to display the new resource creation option alongside existing project settings. - Adjusted various views to include a margin-top adjustment for better layout consistency.
This commit is contained in:
@@ -21,6 +21,14 @@ class Index extends Component
|
||||
$this->projects = Project::ownedByCurrentTeam()->get()->map(function ($project) {
|
||||
$project->settingsRoute = route('project.edit', ['project_uuid' => $project->uuid]);
|
||||
$project->canUpdate = auth()->user()->can('update', $project);
|
||||
$project->canCreateResource = auth()->user()->can('createAnyResource');
|
||||
$firstEnvironment = $project->environments->first();
|
||||
$project->addResourceRoute = $firstEnvironment
|
||||
? route('project.resource.create', [
|
||||
'project_uuid' => $project->uuid,
|
||||
'environment_uuid' => $firstEnvironment->uuid,
|
||||
])
|
||||
: null;
|
||||
|
||||
return $project;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user