Skip to content

Commit 43df918

Browse files
authored
Merge pull request coollabsio#3550 from coollabsio/next
v4.0.0-beta.343
2 parents d4d9268 + 1a8d153 commit 43df918

File tree

13 files changed

+94
-60
lines changed

13 files changed

+94
-60
lines changed

app/Actions/Docker/GetContainersStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ private function old_way()
543543
}
544544
}
545545
}
546-
$exitedServices = $exitedServices->unique('id');
546+
$exitedServices = $exitedServices->unique('uuid');
547547
foreach ($exitedServices as $exitedService) {
548548
if (str($exitedService->status)->startsWith('exited')) {
549549
continue;

app/Livewire/Project/Service/StackForm.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function mount()
3333
$key = data_get($field, 'key');
3434
$value = data_get($field, 'value');
3535
$rules = data_get($field, 'rules', 'nullable');
36-
$isPassword = data_get($field, 'isPassword');
36+
$isPassword = data_get($field, 'isPassword', false);
3737
$this->fields->put($key, [
3838
'serviceName' => $serviceName,
3939
'key' => $key,
@@ -47,7 +47,15 @@ public function mount()
4747
$this->validationAttributes["fields.$key.value"] = $fieldKey;
4848
}
4949
}
50-
$this->fields = $this->fields->sortBy('name');
50+
$this->fields = $this->fields->groupBy('serviceName')->map(function ($group) {
51+
return $group->sortBy(function ($field) {
52+
return data_get($field, 'isPassword') ? 1 : 0;
53+
})->mapWithKeys(function ($field) {
54+
return [$field['key'] => $field];
55+
});
56+
})->flatMap(function ($group) {
57+
return $group;
58+
});
5159
}
5260

5361
public function saveCompose($raw)

bootstrap/helpers/shared.php

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
29282928
}
29292929

29302930
$parsedServices = collect([]);
2931-
ray()->clearAll();
2931+
// ray()->clearAll();
29322932

29332933
$allMagicEnvironments = collect([]);
29342934
foreach ($services as $serviceName => $service) {
@@ -3484,6 +3484,18 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
34843484
$value = $value->after('?');
34853485
}
34863486
if ($originalValue->value() === $value->value()) {
3487+
// This means the variable does not have a default value, so it needs to be created in Coolify
3488+
$parsedKeyValue = replaceVariables($value);
3489+
$resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->firstOrCreate([
3490+
'key' => $parsedKeyValue,
3491+
$nameOfId => $resource->id,
3492+
], [
3493+
'is_build_time' => false,
3494+
'is_preview' => false,
3495+
]);
3496+
// Add the variable to the environment so it will be shown in the deployable compose file
3497+
$environment[$parsedKeyValue->value()] = $resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->first()->value;
3498+
34873499
continue;
34883500
}
34893501
$resource->environment_variables()->where('key', $key)->where($nameOfId, $resource->id)->firstOrCreate([
@@ -3576,6 +3588,17 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
35763588
if ($environment->count() > 0) {
35773589
$environment = $environment->filter(function ($value, $key) {
35783590
return ! str($key)->startsWith('SERVICE_FQDN_');
3591+
})->map(function ($value, $key) use ($resource) {
3592+
// if value is empty, set it to null so if you set the environment variable in the .env file (Coolify's UI), it will used
3593+
if (str($value)->isEmpty()) {
3594+
if ($resource->environment_variables()->where('key', $key)->exists()) {
3595+
$value = $resource->environment_variables()->where('key', $key)->first()->value;
3596+
} else {
3597+
$value = null;
3598+
}
3599+
}
3600+
3601+
return $value;
35793602
});
35803603
}
35813604
$serviceLabels = $labels->merge($defaultLabels);

config/sentry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// The release version of your application
99
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
10-
'release' => '4.0.0-beta.342',
10+
'release' => '4.0.0-beta.343',
1111
// When left empty or `null` the Laravel environment will be used
1212
'environment' => config('app.env'),
1313

config/version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
22

3-
return '4.0.0-beta.342';
3+
return '4.0.0-beta.343';

other/nightly/versions.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"coolify": {
33
"v4": {
4-
"version": "4.0.0-beta.341"
4+
"version": "4.0.0-beta.343"
55
},
66
"nightly": {
7-
"version": "4.0.0-beta.342"
7+
"version": "4.0.0-beta.344"
88
},
99
"helper": {
1010
"version": "1.0.1"

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

resources/views/components/forms/checkbox.blade.php

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,26 @@
66
'instantSave' => false,
77
'value' => null,
88
'hideLabel' => false,
9+
'fullWidth' => false,
910
])
1011

11-
<div class="flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100">
12-
@if(!$hideLabel)
13-
<label class="flex gap-4 px-0 min-w-fit label">
14-
<span class="flex gap-2">
15-
@if ($label)
16-
{!! $label !!}
17-
@else
18-
{{ $id }}
19-
@endif
20-
@if ($helper)
21-
<x-helper :helper="$helper" />
22-
@endif
23-
</span>
24-
</label>
12+
<div @class([
13+
'flex flex-row items-center gap-4 px-2 py-1 form-control min-w-fit dark:hover:bg-coolgray-100',
14+
'w-full' => $fullWidth,
15+
])>
16+
@if (!$hideLabel)
17+
<label class="flex gap-4 px-0 min-w-fit label">
18+
<span class="flex gap-2">
19+
@if ($label)
20+
{!! $label !!}
21+
@else
22+
{{ $id }}
23+
@endif
24+
@if ($helper)
25+
<x-helper :helper="$helper" />
26+
@endif
27+
</span>
28+
</label>
2529
@endif
2630
<span class="flex-grow"></span>
2731
<input @disabled($disabled) type="checkbox" {{ $attributes->merge(['class' => $defaultClass]) }}

resources/views/components/forms/input.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'w-full' => !$isMultiline,
44
])>
55
@if ($label)
6-
<label class="flex items-center gap-1 mb-1 text-sm font-medium">{{ $label }}
6+
<label class="flex gap-1 items-center mb-1 text-sm font-medium">{{ $label }}
77
@if ($required)
88
<x-highlighted text="*" />
99
@endif
@@ -16,7 +16,7 @@
1616
<div class="relative" x-data="{ type: 'password' }">
1717
@if ($allowToPeak)
1818
<div x-on:click="changePasswordFieldType"
19-
class="absolute inset-y-0 right-0 flex items-center pr-2 cursor-pointer hover:dark:text-white">
19+
class="flex absolute inset-y-0 right-0 items-center pr-2 cursor-pointer hover:dark:text-white">
2020
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
2121
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
2222
<path stroke="none" d="M0 0h24v24H0z" fill="none" />

resources/views/components/modal-confirmation.blade.php

Lines changed: 24 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ class="relative w-auto h-auto">
139139
@endif
140140
@else
141141
@if ($buttonFullWidth)
142-
<x-forms.button @click="modalOpen=true" class="flex w-full gap-2" wire:target>
142+
<x-forms.button @click="modalOpen=true" class="flex gap-2 w-full" wire:target>
143143
{{ $buttonTitle }}
144144
</x-forms.button>
145145
@else
@@ -162,41 +162,37 @@ class="absolute inset-0 w-full h-full bg-black bg-opacity-20 backdrop-blur-sm"><
162162
x-transition:leave-start="opacity-100 translate-y-0 sm:scale-100"
163163
x-transition:leave-end="opacity-0 -translate-y-2 sm:scale-95"
164164
class="relative w-full py-6 border rounded min-w-full lg:min-w-[36rem] max-w-[48rem] bg-neutral-100 border-neutral-400 dark:bg-base px-7 dark:border-coolgray-300">
165-
<div class="flex items-center justify-between pb-3">
166-
<h3 class="text-2xl font-bold pr-8">{{ $title }}</h3>
165+
<div class="flex justify-between items-center pb-3">
166+
<h3 class="pr-8 text-2xl font-bold">{{ $title }}</h3>
167167
<button @click="modalOpen = false; resetModal()"
168-
class="absolute top-2 right-2 flex items-center justify-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
168+
class="flex absolute top-2 right-2 justify-center items-center w-8 h-8 rounded-full dark:text-white hover:bg-coolgray-300">
169169
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
170170
stroke-width="1.5" stroke="currentColor">
171171
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
172172
</svg>
173173
</button>
174174
</div>
175-
<div class="relative w-auto pb-8">
175+
<div class="relative pb-8 w-auto">
176176
@if (!empty($checkboxes))
177177
<!-- Step 1: Select actions -->
178178
<div x-show="step === 1">
179179
<div class="flex justify-between items-center">
180180
<h4>Actions</h4>
181181
</div>
182182
@foreach ($checkboxes as $index => $checkbox)
183-
<div class="flex items-center justify-between mb-2">
184-
<label for="{{ $checkbox['id'] }}"
185-
class="text-sm leading-5 text-gray-700 dark:text-gray-300 flex-grow pr-4">
186-
{{ $checkbox['label'] }}
187-
</label>
188-
<x-forms.checkbox :id="$checkbox['id']" :wire:model="$checkbox['id']"
183+
<div class="flex justify-between items-center mb-2">
184+
<x-forms.checkbox fullWidth :label="$checkbox['label']" :id="$checkbox['id']"
185+
:wire:model="$checkbox['id']"
189186
x-on:change="toggleAction('{{ $checkbox['id'] }}')" :checked="$this->{$checkbox['id']}"
190-
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')"
191-
class="flex-shrink-0" :hideLabel="true" />
187+
x-bind:checked="selectedActions.includes('{{ $checkbox['id'] }}')" />
192188
</div>
193189
@endforeach
194190
</div>
195191
@endif
196192

197193
<!-- Step 2: Confirm deletion -->
198194
<div x-show="step === 2">
199-
<div class="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
195+
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
200196
<p class="font-bold">Warning</p>
201197
<p>This operation is permanent and cannot be undone. Please think again before proceeding!
202198
</p>
@@ -205,7 +201,7 @@ class="flex-shrink-0" :hideLabel="true" />
205201
<ul class="mb-4 space-y-2">
206202
@foreach ($actions as $action)
207203
<li class="flex items-center text-red-500">
208-
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor"
204+
<svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
209205
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
210206
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
211207
d="M6 18L18 6M6 6l12 12"></path>
@@ -216,7 +212,7 @@ class="flex-shrink-0" :hideLabel="true" />
216212
@foreach ($checkboxes as $checkbox)
217213
<template x-if="selectedActions.includes('{{ $checkbox['id'] }}')">
218214
<li class="flex items-center text-red-500">
219-
<svg class="w-5 h-5 mr-2 flex-shrink-0" fill="none" stroke="currentColor"
215+
<svg class="flex-shrink-0 mr-2 w-5 h-5" fill="none" stroke="currentColor"
220216
viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
221217
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
222218
d="M6 18L18 6M6 6l12 12"></path>
@@ -228,24 +224,24 @@ class="flex-shrink-0" :hideLabel="true" />
228224
</ul>
229225
@if ($confirmWithText)
230226
<div class="mb-4">
231-
<h4 class="text-lg font-semibold mb-2">Confirm Actions</h4>
232-
<p class="text-sm mb-2">{{ $confirmationLabel }}</p>
227+
<h4 class="mb-2 text-lg font-semibold">Confirm Actions</h4>
228+
<p class="mb-2 text-sm">{{ $confirmationLabel }}</p>
233229
<div class="relative mb-2">
234230
<input type="text" x-model="confirmationText"
235-
class="w-full p-2 pr-10 rounded text-black input cursor-text" readonly>
231+
class="p-2 pr-10 w-full text-black rounded cursor-text input" readonly>
236232
<button @click="copyConfirmationText()"
237-
class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-500 hover:text-gray-700"
233+
class="absolute right-2 top-1/2 text-gray-500 transform -translate-y-1/2 hover:text-gray-700"
238234
title="Copy confirmation text" x-ref="copyButton">
239235
<template x-if="!copied">
240-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" viewBox="0 0 20 20"
236+
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5" viewBox="0 0 20 20"
241237
fill="currentColor">
242238
<path d="M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z" />
243239
<path
244240
d="M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z" />
245241
</svg>
246242
</template>
247243
<template x-if="copied">
248-
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 text-green-500"
244+
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-green-500"
249245
viewBox="0 0 20 20" fill="currentColor">
250246
<path fill-rule="evenodd"
251247
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z"
@@ -256,18 +252,18 @@ class="absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-500 hover:t
256252
</div>
257253

258254
<label for="userConfirmationText"
259-
class="block text-sm font-medium text-gray-700 dark:text-gray-300 mt-4">
255+
class="block mt-4 text-sm font-medium text-gray-700 dark:text-gray-300">
260256
{{ $shortConfirmationLabel }}
261257
</label>
262258
<input type="text" x-model="userConfirmationText"
263-
class="w-full p-2 rounded text-black input mt-1">
259+
class="p-2 mt-1 w-full text-black rounded input">
264260
</div>
265261
@endif
266262
</div>
267263

268264
<!-- Step 3: Password confirmation -->
269265
<div x-show="step === 3 && confirmWithPassword">
270-
<div class="bg-error border-l-4 border-red-500 text-white p-4 mb-4" role="alert">
266+
<div class="p-4 mb-4 text-white border-l-4 border-red-500 bg-error" role="alert">
271267
<p class="font-bold">Final Confirmation</p>
272268
<p>Please enter your password to confirm this destructive action.</p>
273269
</div>
@@ -276,11 +272,11 @@ class="w-full p-2 rounded text-black input mt-1">
276272
class="block text-sm font-medium text-gray-700 dark:text-gray-300">
277273
Your Password
278274
</label>
279-
<input type="password" id="password-confirm" x-model="password" class="input w-full"
275+
<input type="password" id="password-confirm" x-model="password" class="w-full input"
280276
placeholder="Enter your password">
281-
<p x-show="passwordError" x-text="passwordError" class="text-red-500 text-sm mt-1"></p>
277+
<p x-show="passwordError" x-text="passwordError" class="mt-1 text-sm text-red-500"></p>
282278
@error('password')
283-
<p class="text-red-500 text-sm mt-1">{{ $message }}</p>
279+
<p class="mt-1 text-sm text-red-500">{{ $message }}</p>
284280
@enderror
285281
</div>
286282
</div>

0 commit comments

Comments
 (0)