coolify/resources/views/project/resources.blade.php

98 lines
6.2 KiB
PHP
Raw Normal View History

<x-layout>
2023-05-22 22:30:33 +02:00
<div class="flex flex-col">
<div class="flex items-center gap-2">
2023-06-02 12:34:45 +02:00
<h1>Resources</h1>
@if ($environment->isEmpty())
2023-12-07 19:06:32 +01:00
<a wire:navigate class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
2023-10-24 10:42:33 +02:00
href="{{ route('project.clone', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
Clone
</a>
2023-08-11 20:19:42 +02:00
<livewire:project.delete-environment :environment_id="$environment->id" />
2023-10-10 10:56:11 +02:00
@else
2023-12-07 19:06:32 +01:00
<a wire:navigate href="{{ route('project.resources.new', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
2023-10-10 10:56:11 +02:00
class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation">+
New</a>
2023-10-24 10:42:33 +02:00
<a class="font-normal text-white normal-case border-none rounded hover:no-underline btn btn-primary btn-sm no-animation"
href="{{ route('project.clone', ['project_uuid' => data_get($project, 'uuid'), 'environment_name' => request()->route('environment_name')]) }}">
Clone
</a>
2023-06-16 12:35:40 +02:00
@endif
2023-05-22 22:30:33 +02:00
</div>
2023-06-16 12:35:40 +02:00
<nav class="flex pt-2 pb-10">
<ol class="flex items-center">
2023-06-07 21:44:16 +02:00
<li class="inline-flex items-center">
2023-06-16 12:35:40 +02:00
<a class="text-xs truncate lg:text-sm"
2023-08-11 20:19:42 +02:00
href="{{ route('project.show', ['project_uuid' => request()->route('project_uuid')]) }}">
2023-06-16 12:35:40 +02:00
{{ $project->name }}</a>
2023-05-22 22:30:33 +02:00
</li>
<li>
2023-06-07 21:44:16 +02:00
<div class="flex items-center">
<svg aria-hidden="true" class="w-4 h-4 mx-1 font-bold text-warning" fill="currentColor"
2023-08-11 20:19:42 +02:00
viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
2023-06-07 21:44:16 +02:00
<path fill-rule="evenodd"
2023-08-11 20:19:42 +02:00
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
clip-rule="evenodd"></path>
2023-06-07 21:44:16 +02:00
</svg>
2023-06-16 12:35:40 +02:00
<a class="text-xs truncate lg:text-sm"
2023-08-11 20:19:42 +02:00
href="{{ route('project.resources', ['environment_name' => request()->route('environment_name'), 'project_uuid' => request()->route('project_uuid')]) }}">{{ request()->route('environment_name') }}</a>
2023-06-07 21:44:16 +02:00
</div>
2023-05-23 09:53:24 +02:00
</li>
2023-06-07 21:44:16 +02:00
</ol>
</nav>
2023-05-09 11:33:50 +02:00
</div>
@if ($environment->isEmpty())
2023-12-07 22:56:55 +01:00
<a wire:navigate href="{{ route('project.resources.new', ['project_uuid' => request()->route('project_uuid'), 'environment_name' => request()->route('environment_name')]) }} "
2023-10-10 10:56:11 +02:00
class="items-center justify-center box">+ Add New Resource</a>
2023-05-09 11:33:50 +02:00
@endif
2023-06-16 12:35:40 +02:00
<div class="grid gap-2 lg:grid-cols-2">
2023-05-16 15:27:47 +02:00
@foreach ($environment->applications->sortBy('name') as $application)
2023-12-07 19:06:32 +01:00
<a wire:navigate class="relative box group"
2023-08-11 20:19:42 +02:00
href="{{ route('project.application.configuration', [$project->uuid, $environment->name, $application->uuid]) }}">
2023-08-25 12:13:22 +02:00
<div class="flex flex-col mx-6">
2023-10-10 11:28:57 +02:00
<div class="font-bold text-white">{{ $application->name }}</div>
2023-10-20 09:29:09 +02:00
<div class="description">{{ $application->description }}</div>
2023-08-07 18:46:40 +02:00
</div>
@if (Str::of(data_get($application, 'status'))->startsWith('running'))
2023-10-18 09:03:14 +02:00
<div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
@elseif (Str::of(data_get($application, 'status'))->startsWith('exited'))
<div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
2023-10-18 09:03:14 +02:00
@elseif (Str::of(data_get($application, 'status'))->startsWith('restarting'))
<div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
@endif
2023-08-07 18:46:40 +02:00
</a>
@endforeach
@foreach ($environment->databases()->sortBy('name') as $database)
2023-12-07 19:06:32 +01:00
<a wire:navigate class="relative box group"
href="{{ route('project.database.configuration', [$project->uuid, $environment->name, $database->uuid]) }}">
2023-08-25 12:13:22 +02:00
<div class="flex flex-col mx-6">
<div class="font-bold text-white">{{ $database->name }}</div>
2023-10-20 09:29:09 +02:00
<div class="description">{{ $database->description }}</div>
2023-08-07 18:46:40 +02:00
</div>
@if (Str::of(data_get($database, 'status'))->startsWith('running'))
2023-10-18 09:03:14 +02:00
<div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
@elseif (Str::of(data_get($database, 'status'))->startsWith('exited'))
<div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
2023-10-18 09:03:14 +02:00
@elseif (Str::of(data_get($database, 'status'))->startsWith('restaring'))
<div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
@endif
2023-05-16 09:35:09 +02:00
</a>
2023-03-29 13:13:27 +02:00
@endforeach
2023-09-20 15:42:41 +02:00
@foreach ($environment->services->sortBy('name') as $service)
2023-12-07 19:06:32 +01:00
<a wire:navigate class="relative box group"
href="{{ route('project.service.configuration', [$project->uuid, $environment->name, $service->uuid]) }}">
2023-10-10 10:56:11 +02:00
<div class="flex flex-col mx-6">
2023-10-10 11:29:33 +02:00
<div class="font-bold text-white">{{ $service->name }}</div>
2023-10-20 09:29:09 +02:00
<div class="description">{{ $service->description }}</div>
2023-10-10 10:56:11 +02:00
</div>
@if (Str::of(serviceStatus($service))->startsWith('running'))
2023-10-18 09:03:14 +02:00
<div class="absolute bg-success -top-1 -left-1 badge badge-xs"></div>
@elseif (Str::of(serviceStatus($service))->startsWith('degraded'))
2023-10-18 09:03:14 +02:00
<div class="absolute bg-warning -top-1 -left-1 badge badge-xs"></div>
@elseif (Str::of(serviceStatus($service))->startsWith('exited'))
<div class="absolute bg-error -top-1 -left-1 badge badge-xs"></div>
@endif
2023-10-10 10:56:11 +02:00
</a>
@endforeach
2023-03-29 13:13:27 +02:00
</div>
</x-layout>