mirror of
https://github.com/tiennm99/coolify.git
synced 2026-10-14 04:15:55 +00:00
refactor(environment): streamline environment variable handling by replacing sorting methods with direct property access and enhancing query ordering for improved performance
This commit is contained in:
1 parent
c6b47da1e9
commit
8e155f25b3
12 files changed
+108
-43
No files matched your search
@@ -45,14 +45,7 @@
|
||||
<h3>Production Environment Variables</h3>
|
||||
<div>Environment (secrets) variables for Production.</div>
|
||||
</div>
|
||||
@php
|
||||
$requiredEmptyVars = $resource->environment_variables->filter(function ($env) {
|
||||
return $env->is_required && empty($env->value);
|
||||
});
|
||||
|
||||
$otherVars = $resource->environment_variables->diff($requiredEmptyVars);
|
||||
@endphp
|
||||
@forelse ($requiredEmptyVars->merge($otherVars) as $env)
|
||||
@forelse ($this->environmentVariables as $env)
|
||||
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
|
||||
:env="$env" :type="$resource->type()" />
|
||||
@empty
|
||||
@@ -63,7 +56,7 @@
|
||||
<h3>Preview Deployments Environment Variables</h3>
|
||||
<div>Environment (secrets) variables for Preview Deployments.</div>
|
||||
</div>
|
||||
@foreach ($resource->environment_variables_preview as $env)
|
||||
@foreach ($this->environmentVariablesPreview as $env)
|
||||
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
|
||||
:env="$env" :type="$resource->type()" />
|
||||
@endforeach
|
||||
|
||||
Reference in new issue
Block a user