shared variables are more visible now on the ui

This commit is contained in:
Andras Bacsai
2024-04-26 14:59:03 +02:00
parent 50c5d533b0
commit 8a4c2bf208
19 changed files with 307 additions and 97 deletions

View File

@@ -170,6 +170,19 @@
S3 Storages
</a>
</li>
<li>
<a title="Shared variables"
class="{{ request()->is('shared-variables*') ? 'menu-item-active menu-item' : 'menu-item' }}"
href="{{ route('shared-variables.index') }}">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" viewBox="0 0 24 24">
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
<path d="M5 4C2.5 9 2.5 14 5 20M19 4c2.5 5 2.5 10 0 16M9 9h1c1 0 1 1 2.016 3.527C13 15 13 16 14 16h1"/>
<path d="M8 16c1.5 0 3-2 4-3.5S14.5 9 16 9"/>
</g>
</svg>
Shared Variables
</a>
</li>
<li>
<a title="Notifications"
class="{{ request()->is('notifications*') ? 'menu-item-active menu-item' : 'menu-item' }}"

View File

@@ -2,7 +2,7 @@
<div class="flex items-end gap-2">
<h1>Team</h1>
<x-modal-input buttonTitle="+ Add" title="New Team">
<livewire:team.create/>
<livewire:team.create />
</x-modal-input>
</div>
<div class="subtitle">Team wide configurations.</div>
@@ -14,10 +14,6 @@
href="{{ route('team.member.index') }}">
<button>Members</button>
</a>
<a class="{{ request()->routeIs('team.shared-variables.index') ? 'dark:text-white' : '' }}"
href="{{ route('team.shared-variables.index') }}">
<button>Shared Variables</button>
</a>
<div class="flex-1"></div>
</nav>
</div>

View File

@@ -14,24 +14,4 @@
<x-forms.input label="Description" id="project.description" />
</div>
</form>
<div class="flex gap-2">
<h2>Shared Variables</h2>
<x-modal-input buttonTitle="+ Add" title="New Shared Variable">
<livewire:project.shared.environment-variable.add :shared="true" />
</x-modal-input>
</div>
<div class="pb-4 lg:flex lg:gap-1">
<div>You can use these variables anywhere with</div>
<div class=" dark:text-warning text-coollabs">@{{ project.VARIABLENAME }} </div>
<x-helper
helper="More info <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>
<div class="flex flex-col gap-2">
@forelse ($project->environment_variables->sort()->sortBy('key') as $env)
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" type="project" />
@empty
<div>No environment variables found.</div>
@endforelse
</div>
</div>

View File

@@ -42,21 +42,4 @@
<x-forms.input label="Description" id="environment.description" />
</div>
</form>
<div class="flex gap-2 pt-10">
<h2>Shared Variables</h2>
<x-modal-input buttonTitle="+ Add" title="New Shared Variable">
<livewire:project.shared.environment-variable.add :shared="true" />
</x-modal-input>
</div>
<div class="flex items-center gap-2 pb-4">You can use these variables anywhere with <span class="dark:text-warning text-coollabs">@{{environment.VARIABLENAME}}</span><x-helper
helper="More info <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>
<div class="flex flex-col gap-2">
@forelse ($environment->environment_variables->sort()->sortBy('key') as $env)
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" type="environment" />
@empty
<div>No environment variables found.</div>
@endforelse
</div>
</div>

View File

@@ -0,0 +1,28 @@
<div>
<div class="flex gap-2">
<h1>Environments</h1>
</div>
<div class="subtitle">List of your environments by projects.</div>
<div class="flex flex-col gap-2">
@forelse ($projects as $project)
<h2>{{ data_get($project, 'name') }}</h2>
<div class="pt-0 pb-3">{{ data_get($project, 'description') }}</div>
@forelse ($project->environments as $environment)
<a class="box group"
href="{{ route('shared-variables.environment.show', ['project_uuid' => $project->uuid, 'environment_name' => $environment->name]) }}">
<div class="flex flex-col justify-center flex-1 mx-6 ">
<div class="box-title"> {{ $environment->name }}</div>
<div class="box-description">
{{ $environment->description }}</div>
</div>
</a>
@empty
<p>No environments found.</p>
@endforelse
@empty
<div>
<div>No project found.</div>
</div>
@endforelse
</div>
</div>

View File

@@ -0,0 +1,20 @@
<div>
<div class="flex gap-2">
<h1>Shared Variables for {{ $project->name }}/{{ $environment->name }}</h1>
<x-modal-input buttonTitle="+ Add" title="New Shared Variable">
<livewire:project.shared.environment-variable.add :shared="true" />
</x-modal-input>
</div>
<div class="flex items-center gap-1 subtitle">You can use these variables anywhere with <span
class="dark:text-warning text-coollabs">@{{ environment.VARIABLENAME }}</span><x-helper
helper="More info <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>
<div class="flex flex-col gap-2">
@forelse ($environment->environment_variables->sort()->sortBy('key') as $env)
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" type="environment" />
@empty
<div>No environment variables found.</div>
@endforelse
</div>
</div>

View File

@@ -0,0 +1,28 @@
<div>
<div class="flex items-start gap-2">
<h1>Shared Variables</h1>
</div>
<div class="subtitle">Set Team / Project / Environment wide variables.</div>
<div class="flex flex-col gap-2">
<a class="box group" href="{{ route('shared-variables.team.index') }}">
<div class="flex flex-col justify-center mx-6">
<div class="box-title">Team wide</div>
<div class="box-description">Usable for all resources in a team.</div>
</div>
</a>
<a class="box group" href="{{ route('shared-variables.project.index') }}">
<div class="flex flex-col justify-center mx-6">
<div class="box-title">Project wide</div>
<div class="box-description">Usable for all resources in a project.</div>
</div>
</a>
<a class="box group" href="{{ route('shared-variables.environment.index') }}">
<div class="flex flex-col justify-center mx-6">
<div class="box-title">Environment wide</div>
<div class="box-description">Usable for all resources in an environment.</div>
</div>
</a>
</div>
</div>

View File

@@ -0,0 +1,22 @@
<div>
<div class="flex gap-2">
<h1>Projects</h1>
</div>
<div class="subtitle">List of your projects.</div>
<div class="flex flex-col gap-2">
@forelse ($projects as $project)
<a class="box group"
href="{{ route('shared-variables.project.show', ['project_uuid' => data_get($project, 'uuid')]) }}">
<div class="flex flex-col justify-center mx-6 ">
<div class="box-title">{{ $project->name }}</div>
<div class="box-description ">
{{ $project->description }}</div>
</div>
</a>
@empty
<div>
<div>No project found.</div>
</div>
@endforelse
</div>
</div>

View File

@@ -0,0 +1,22 @@
<div>
<div class="flex gap-2">
<h1>Shared Variables for {{data_get($project,'name')}}</h1>
<x-modal-input buttonTitle="+ Add" title="New Shared Variable">
<livewire:project.shared.environment-variable.add :shared="true" />
</x-modal-input>
</div>
<div class="flex flex-wrap gap-1 subtitle">
<div>You can use these variables anywhere with</div>
<div class="dark:text-warning text-coollabs">@{{ project.VARIABLENAME }} </div>
<x-helper
helper="More info <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>
<div class="flex flex-col gap-2">
@forelse ($project->environment_variables->sort()->sortBy('key') as $env)
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
:env="$env" type="project" />
@empty
<div>No environment variables found.</div>
@endforelse
</div>
</div>

View File

@@ -1,12 +1,11 @@
<div>
<x-team.navbar />
<div class="flex gap-2">
<h2>Shared Variables</h2>
<h1>Team Shared Variables</h1>
<x-modal-input buttonTitle="+ Add" title="New Shared Variable">
<livewire:project.shared.environment-variable.add :shared="true" />
</x-modal-input>
</div>
<div class="flex items-center gap-2 pb-4">You can use these variables anywhere with <span
<div class="flex items-center gap-1 subtitle">You can use these variables anywhere with <span
class="dark:text-warning text-coollabs">@{{ team.VARIABLENAME }}</span> <x-helper
helper="More info <a class='underline dark:text-white' href='https://coolify.io/docs/knowledge-base/environment-variables#shared-variables' target='_blank'>here</a>."></x-helper>
</div>