From efd3a360d0f8947fdf7b29bc12738fd8bd8d6db6 Mon Sep 17 00:00:00 2001 From: aaryan359 Date: Tue, 12 Aug 2025 22:05:26 +0530 Subject: [PATCH 1/3] fix the ui for breadcrumbing --- .../resources/breadcrumbs.blade.php | 264 ++++++++++++++++-- 1 file changed, 235 insertions(+), 29 deletions(-) diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php index 5f7029fd0..78f3f0ba1 100644 --- a/resources/views/components/resources/breadcrumbs.blade.php +++ b/resources/views/components/resources/breadcrumbs.blade.php @@ -5,45 +5,242 @@ ]) + + From 7af5d7683ab12f5aebbc7bb4a6c833362f1cb0fc Mon Sep 17 00:00:00 2001 From: aaryan359 Date: Sat, 23 Aug 2025 17:07:29 +0530 Subject: [PATCH 2/3] fix hover area and app level margin --- .../views/components/resources/breadcrumbs.blade.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/views/components/resources/breadcrumbs.blade.php b/resources/views/components/resources/breadcrumbs.blade.php index 78f3f0ba1..4d047c477 100644 --- a/resources/views/components/resources/breadcrumbs.blade.php +++ b/resources/views/components/resources/breadcrumbs.blade.php @@ -13,7 +13,7 @@ {{ data_get($resource, 'environment.project.name', 'Undefined Name') }} + -
- - Overview - - - Settings - - - All Resources - +
+ @foreach ($projects as $project) + + {{ $project->name }} + + @endforeach
-
  • -
    +
  • +
    {{ data_get($resource, 'environment.name') }} - + - -
    - - All Resources - - - Environment Settings - - - Clone Environment - + +
    + +
    + @foreach ($environments as $environment) + @php + $envResources = collect() + ->merge($environment->applications->map(fn($app) => ['type' => 'application', 'resource' => $app])) + ->merge($environment->databases()->map(fn($db) => ['type' => 'database', 'resource' => $db])) + ->merge($environment->services->map(fn($svc) => ['type' => 'service', 'resource' => $svc])); + @endphp + + @endforeach +
    + + + @foreach ($environments as $environment) + @php + $envResources = collect() + ->merge($environment->applications->map(fn($app) => ['type' => 'application', 'resource' => $app])) + ->merge($environment->databases()->map(fn($db) => ['type' => 'database', 'resource' => $db])) + ->merge($environment->services->map(fn($svc) => ['type' => 'service', 'resource' => $svc])); + @endphp + @if ($envResources->count() > 0) +
    +
    + @foreach ($envResources as $envResource) + @php + $resType = $envResource['type']; + $res = $envResource['resource']; + $resRoute = match($resType) { + 'application' => route('project.application.configuration', [ + 'project_uuid' => $currentProjectUuid, + 'environment_uuid' => $environment->uuid, + 'application_uuid' => $res->uuid, + ]), + 'service' => route('project.service.configuration', [ + 'project_uuid' => $currentProjectUuid, + 'environment_uuid' => $environment->uuid, + 'service_uuid' => $res->uuid, + ]), + 'database' => route('project.database.configuration', [ + 'project_uuid' => $currentProjectUuid, + 'environment_uuid' => $environment->uuid, + 'database_uuid' => $res->uuid, + ]), + }; + $isCurrentResource = $res->uuid === $currentResourceUuid; + @endphp + + @endforeach +
    + + + @foreach ($envResources as $envResource) + @php + $resType = $envResource['type']; + $res = $envResource['resource']; + $resParams = [ + 'project_uuid' => $currentProjectUuid, + 'environment_uuid' => $environment->uuid, + ]; + if ($resType === 'application') { + $resParams['application_uuid'] = $res->uuid; + } elseif ($resType === 'service') { + $resParams['service_uuid'] = $res->uuid; + } else { + $resParams['database_uuid'] = $res->uuid; + } + $resKey = $environment->uuid . '-' . $res->uuid; + @endphp +
    + +
    + @if ($resType === 'application') + + Deployments + Logs + @can('canAccessTerminal') + Terminal + @endcan + @elseif ($resType === 'service') + + Logs + @can('canAccessTerminal') + Terminal + @endcan + @else + + Logs + @can('canAccessTerminal') + Terminal + @endcan + @if ( + $res->getMorphClass() === 'App\Models\StandalonePostgresql' || + $res->getMorphClass() === 'App\Models\StandaloneMongodb' || + $res->getMorphClass() === 'App\Models\StandaloneMysql' || + $res->getMorphClass() === 'App\Models\StandaloneMariadb') + Backups + @endif + @endif +
    + + + +
    + @endforeach +
    + @endif + @endforeach
  • -
  • -
    + @php + $resourceUuid = data_get($resource, 'uuid'); + $resourceType = $resource->getMorphClass(); + $isApplication = $resourceType === 'App\Models\Application'; + $isService = $resourceType === 'App\Models\Service'; + $isDatabase = str_contains($resourceType, 'Database') || str_contains($resourceType, 'Standalone'); + $routeParams = [ + 'project_uuid' => $currentProjectUuid, + 'environment_uuid' => $currentEnvironmentUuid, + ]; + if ($isApplication) { + $routeParams['application_uuid'] = $resourceUuid; + } elseif ($isService) { + $routeParams['service_uuid'] = $resourceUuid; + } else { + $routeParams['database_uuid'] = $resourceUuid; + } + @endphp +
  • +
    + href="{{ $isApplication + ? route('project.application.configuration', $routeParams) + : ($isService + ? route('project.service.configuration', $routeParams) + : route('project.database.configuration', $routeParams)) }}"> {{ data_get($resource, 'name') }} - + - -
    - @if($resource->getMorphClass() === 'App\Models\Application') - - - Configuration - - - Deployments - - - Logs - - - Terminal - - @elseif(str_contains($resource->getMorphClass(), 'Database')) - - - Configuration - - - Backups - - - Logs - - - Terminal - - @elseif($resource->getMorphClass() === 'App\Models\Service') - - - Configuration - - - Logs - - - Terminal - - @endif + +
    + +
    + @if ($isApplication) + + + + Deployments + + + Logs + + @can('canAccessTerminal') + + Terminal + + @endcan + @elseif ($isService) + + + + Logs + + @can('canAccessTerminal') + + Terminal + + @endcan + @else + + + + Logs + + @can('canAccessTerminal') + + Terminal + + @endcan + @if ( + $resourceType === 'App\Models\StandalonePostgresql' || + $resourceType === 'App\Models\StandaloneMongodb' || + $resourceType === 'App\Models\StandaloneMysql' || + $resourceType === 'App\Models\StandaloneMariadb') + + Backups + + @endif + @endif +
    + + +
  • @@ -251,8 +464,9 @@ class="block px-4 py-2 text-sm hover:bg-coolgray-200 dark:hover:bg-coolgray-200"