feat: required envs
This commit is contained in:
@@ -39,6 +39,7 @@ class Navbar extends Component
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
"echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted',
|
"echo-private:user.{$userId},ServiceStatusChanged" => 'serviceStarted',
|
||||||
|
"envsUpdated" => '$refresh',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class Show extends Component
|
|||||||
'env.is_literal' => 'required|boolean',
|
'env.is_literal' => 'required|boolean',
|
||||||
'env.is_shown_once' => 'required|boolean',
|
'env.is_shown_once' => 'required|boolean',
|
||||||
'env.real_value' => 'nullable',
|
'env.real_value' => 'nullable',
|
||||||
|
'env.is_required' => 'required|boolean',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $validationAttributes = [
|
protected $validationAttributes = [
|
||||||
@@ -46,6 +47,7 @@ class Show extends Component
|
|||||||
'env.is_multiline' => 'Multiline',
|
'env.is_multiline' => 'Multiline',
|
||||||
'env.is_literal' => 'Literal',
|
'env.is_literal' => 'Literal',
|
||||||
'env.is_shown_once' => 'Shown Once',
|
'env.is_shown_once' => 'Shown Once',
|
||||||
|
'env.is_required' => 'Required',
|
||||||
];
|
];
|
||||||
|
|
||||||
public function refresh()
|
public function refresh()
|
||||||
@@ -109,14 +111,14 @@ class Show extends Component
|
|||||||
} else {
|
} else {
|
||||||
$this->validate();
|
$this->validate();
|
||||||
}
|
}
|
||||||
// if (str($this->env->value)->startsWith('{{') && str($this->env->value)->endsWith('}}')) {
|
|
||||||
// $type = str($this->env->value)->after('{{')->before('.')->value;
|
|
||||||
// if (! collect(SHARED_VARIABLE_TYPES)->contains($type)) {
|
|
||||||
// $this->dispatch('error', 'Invalid shared variable type.', 'Valid types are: team, project, environment.');
|
|
||||||
|
|
||||||
// return;
|
if ($this->env->is_required && str($this->env->real_value)->isEmpty()) {
|
||||||
// }
|
$oldValue = $this->env->getOriginal('value');
|
||||||
// }
|
$this->env->value = $oldValue;
|
||||||
|
$this->dispatch('error', 'Required environment variable cannot be empty.');
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->serialize();
|
$this->serialize();
|
||||||
$this->env->save();
|
$this->env->save();
|
||||||
$this->dispatch('success', 'Environment variable updated.');
|
$this->dispatch('success', 'Environment variable updated.');
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class EnvironmentVariable extends Model
|
|||||||
'version' => 'string',
|
'version' => 'string',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $appends = ['real_value', 'is_shared'];
|
protected $appends = ['real_value', 'is_shared', 'is_really_required'];
|
||||||
|
|
||||||
protected static function booted()
|
protected static function booted()
|
||||||
{
|
{
|
||||||
@@ -130,6 +130,13 @@ class EnvironmentVariable extends Model
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isReallyRequired(): Attribute
|
||||||
|
{
|
||||||
|
return Attribute::make(
|
||||||
|
get: fn () => $this->is_required && str($this->real_value)->isEmpty(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
protected function isShared(): Attribute
|
protected function isShared(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
|
|||||||
@@ -1232,7 +1232,6 @@ class Service extends BaseModel
|
|||||||
|
|
||||||
public function environment_variables(): HasMany
|
public function environment_variables(): HasMany
|
||||||
{
|
{
|
||||||
|
|
||||||
return $this->hasMany(EnvironmentVariable::class)->orderByRaw("LOWER(key) LIKE LOWER('SERVICE%') DESC, LOWER(key) ASC");
|
return $this->hasMany(EnvironmentVariable::class)->orderByRaw("LOWER(key) LIKE LOWER('SERVICE%') DESC, LOWER(key) ASC");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1316,4 +1315,20 @@ class Service extends BaseModel
|
|||||||
|
|
||||||
return $networks;
|
return $networks;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function isDeployable(): Attribute
|
||||||
|
{
|
||||||
|
return Attribute::make(
|
||||||
|
get: function () {
|
||||||
|
$envs = $this->environment_variables()->where('is_required', true)->get();
|
||||||
|
foreach ($envs as $env) {
|
||||||
|
if ($env->is_really_required) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3569,6 +3569,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
|||||||
]);
|
]);
|
||||||
} else {
|
} else {
|
||||||
if ($value->startsWith('$')) {
|
if ($value->startsWith('$')) {
|
||||||
|
$isRequired = false;
|
||||||
if ($value->contains(':-')) {
|
if ($value->contains(':-')) {
|
||||||
$value = replaceVariables($value);
|
$value = replaceVariables($value);
|
||||||
$key = $value->before(':');
|
$key = $value->before(':');
|
||||||
@@ -3583,11 +3584,13 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
|||||||
|
|
||||||
$key = $value->before(':');
|
$key = $value->before(':');
|
||||||
$value = $value->after(':?');
|
$value = $value->after(':?');
|
||||||
|
$isRequired = true;
|
||||||
} elseif ($value->contains('?')) {
|
} elseif ($value->contains('?')) {
|
||||||
$value = replaceVariables($value);
|
$value = replaceVariables($value);
|
||||||
|
|
||||||
$key = $value->before('?');
|
$key = $value->before('?');
|
||||||
$value = $value->after('?');
|
$value = $value->after('?');
|
||||||
|
$isRequired = true;
|
||||||
}
|
}
|
||||||
if ($originalValue->value() === $value->value()) {
|
if ($originalValue->value() === $value->value()) {
|
||||||
// This means the variable does not have a default value, so it needs to be created in Coolify
|
// This means the variable does not have a default value, so it needs to be created in Coolify
|
||||||
@@ -3598,6 +3601,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
|||||||
], [
|
], [
|
||||||
'is_build_time' => false,
|
'is_build_time' => false,
|
||||||
'is_preview' => false,
|
'is_preview' => false,
|
||||||
|
'is_required' => $isRequired,
|
||||||
]);
|
]);
|
||||||
// Add the variable to the environment so it will be shown in the deployable compose file
|
// Add the variable to the environment so it will be shown in the deployable compose file
|
||||||
$environment[$parsedKeyValue->value()] = $resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->first()->value;
|
$environment[$parsedKeyValue->value()] = $resource->environment_variables()->where('key', $parsedKeyValue)->where($nameOfId, $resource->id)->first()->value;
|
||||||
@@ -3611,6 +3615,7 @@ function newParser(Application|Service $resource, int $pull_request_id = 0, ?int
|
|||||||
'value' => $value,
|
'value' => $value,
|
||||||
'is_build_time' => false,
|
'is_build_time' => false,
|
||||||
'is_preview' => false,
|
'is_preview' => false,
|
||||||
|
'is_required' => $isRequired,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('environment_variables', function (Blueprint $table) {
|
||||||
|
$table->boolean('is_required')->default(false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('environment_variables', function (Blueprint $table) {
|
||||||
|
$table->dropColumn('is_required');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -20,127 +20,143 @@
|
|||||||
</a>
|
</a>
|
||||||
<x-services.links :service="$service" />
|
<x-services.links :service="$service" />
|
||||||
</nav>
|
</nav>
|
||||||
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
@if ($service->isDeployable)
|
||||||
@if (str($service->status())->contains('running'))
|
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
||||||
<x-dropdown>
|
@if (str($service->status())->contains('running'))
|
||||||
<x-slot:title>
|
<x-dropdown>
|
||||||
Advanced
|
<x-slot:title>
|
||||||
</x-slot>
|
Advanced
|
||||||
<div class="dropdown-item" @click="$wire.dispatch('pullAndRestartEvent')">
|
</x-slot>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" stroke-width="1.5"
|
<div class="dropdown-item" @click="$wire.dispatch('pullAndRestartEvent')">
|
||||||
stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||||
|
<path
|
||||||
|
d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />
|
||||||
|
<path
|
||||||
|
d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />
|
||||||
|
<path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
|
||||||
|
<path d="M3 3l18 18" />
|
||||||
|
</svg>
|
||||||
|
Pull Latest Images & Restart
|
||||||
|
</div>
|
||||||
|
</x-dropdown>
|
||||||
|
<x-forms.button title="Restart" @click="$wire.dispatch('restartEvent')">
|
||||||
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
stroke-width="2">
|
||||||
|
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
||||||
|
<path d="M20 4v5h-5" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
Restart
|
||||||
|
</x-forms.button>
|
||||||
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
||||||
|
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
||||||
|
dispatchEventType="stopEvent">
|
||||||
|
<x-slot:button-title>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
</x-modal-confirmation>
|
||||||
|
@elseif (str($service->status())->contains('degraded'))
|
||||||
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
||||||
|
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
stroke-width="2">
|
||||||
|
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
||||||
|
<path d="M20 4v5h-5" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
Restart Degraded Services
|
||||||
|
</button>
|
||||||
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
||||||
|
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
||||||
|
dispatchEventType="stopEvent">
|
||||||
|
<x-slot:button-title>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
<path
|
||||||
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
|
</path>
|
||||||
|
</svg>
|
||||||
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
</x-modal-confirmation>
|
||||||
|
@elseif (str($service->status())->contains('exited'))
|
||||||
|
<button wire:click='stop(true)' class="gap-2 button">
|
||||||
|
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path fill="red" d="M26 20h-6v-2h6zm4 8h-6v-2h6zm-2-4h-6v-2h6z" />
|
||||||
|
<path fill="red"
|
||||||
|
d="M17.003 20a4.895 4.895 0 0 0-2.404-4.173L22 3l-1.73-1l-7.577 13.126a5.699 5.699 0 0 0-5.243 1.503C3.706 20.24 3.996 28.682 4.01 29.04a1 1 0 0 0 1 .96h14.991a1 1 0 0 0 .6-1.8c-3.54-2.656-3.598-8.146-3.598-8.2Zm-5.073-3.003A3.11 3.11 0 0 1 15.004 20c0 .038.002.208.017.469l-5.9-2.624a3.8 3.8 0 0 1 2.809-.848ZM15.45 28A5.2 5.2 0 0 1 14 25h-2a6.5 6.5 0 0 0 .968 3h-2.223A16.617 16.617 0 0 1 10 24H8a17.342 17.342 0 0 0 .665 4H6c.031-1.836.29-5.892 1.803-8.553l7.533 3.35A13.025 13.025 0 0 0 17.596 28Z" />
|
||||||
|
</svg>
|
||||||
|
Force Cleanup Containers
|
||||||
|
</button>
|
||||||
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
|
stroke-linejoin="round">
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||||
<path
|
<path d="M7 4v16l13 -8z" />
|
||||||
d="M12.983 8.978c3.955 -.182 7.017 -1.446 7.017 -2.978c0 -1.657 -3.582 -3 -8 -3c-1.661 0 -3.204 .19 -4.483 .515m-2.783 1.228c-.471 .382 -.734 .808 -.734 1.257c0 1.22 1.944 2.271 4.734 2.74" />
|
|
||||||
<path
|
|
||||||
d="M4 6v6c0 1.657 3.582 3 8 3c.986 0 1.93 -.067 2.802 -.19m3.187 -.82c1.251 -.53 2.011 -1.228 2.011 -1.99v-6" />
|
|
||||||
<path d="M4 12v6c0 1.657 3.582 3 8 3c3.217 0 5.991 -.712 7.261 -1.74m.739 -3.26v-4" />
|
|
||||||
<path d="M3 3l18 18" />
|
|
||||||
</svg>
|
</svg>
|
||||||
Pull Latest Images & Restart
|
Deploy
|
||||||
</div>
|
</button>
|
||||||
</x-dropdown>
|
@else
|
||||||
<x-forms.button title="Restart" @click="$wire.dispatch('restartEvent')">
|
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
||||||
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
||||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
||||||
stroke-width="2">
|
dispatchEventType="stopEvent">
|
||||||
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
<x-slot:button-title>
|
||||||
<path d="M20 4v5h-5" />
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
||||||
</g>
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
</svg>
|
stroke-linejoin="round">
|
||||||
Restart
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||||
</x-forms.button>
|
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
</path>
|
||||||
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false" step1ButtonText="Continue"
|
<path
|
||||||
step2ButtonText="Stop Service" :dispatchEvent="true" dispatchEventType="stopEvent">
|
d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
||||||
<x-slot:button-title>
|
</path>
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
</svg>
|
||||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
Stop
|
||||||
|
</x-slot:button-title>
|
||||||
|
</x-modal-confirmation>
|
||||||
|
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
||||||
|
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
||||||
stroke-linejoin="round">
|
stroke-linejoin="round">
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
<path d="M7 4v16l13 -8z" />
|
||||||
</path>
|
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
</svg>
|
</svg>
|
||||||
Stop
|
Deploy
|
||||||
</x-slot:button-title>
|
</button>
|
||||||
</x-modal-confirmation>
|
@endif
|
||||||
@elseif (str($service->status())->contains('degraded'))
|
</div>
|
||||||
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
@else
|
||||||
<svg class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
<div class="flex flex-wrap order-first gap-2 items-center sm:order-last">
|
||||||
<g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
<div class="text-error">
|
||||||
stroke-width="2">
|
Unable to deploy. <a
|
||||||
<path d="M19.933 13.041a8 8 0 1 1-9.925-8.788c3.899-1 7.935 1.007 9.425 4.747" />
|
class="underline font-bold cursor-pointer"
|
||||||
<path d="M20 4v5h-5" />
|
@click.prevent="activeTab = 'environment-variables'; window.location.hash = 'environment-variables'">
|
||||||
</g>
|
Required environment variables missing.</a>
|
||||||
</svg>
|
</div>
|
||||||
Restart Degraded Services
|
</div>
|
||||||
</button>
|
@endif
|
||||||
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
|
||||||
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
|
||||||
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
|
||||||
dispatchEventType="stopEvent">
|
|
||||||
<x-slot:button-title>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
|
||||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
</svg>
|
|
||||||
Stop
|
|
||||||
</x-slot:button-title>
|
|
||||||
</x-modal-confirmation>
|
|
||||||
@elseif (str($service->status())->contains('exited'))
|
|
||||||
<button wire:click='stop(true)' class="gap-2 button">
|
|
||||||
<svg class="w-5 h-5" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
|
|
||||||
<path fill="red" d="M26 20h-6v-2h6zm4 8h-6v-2h6zm-2-4h-6v-2h6z" />
|
|
||||||
<path fill="red"
|
|
||||||
d="M17.003 20a4.895 4.895 0 0 0-2.404-4.173L22 3l-1.73-1l-7.577 13.126a5.699 5.699 0 0 0-5.243 1.503C3.706 20.24 3.996 28.682 4.01 29.04a1 1 0 0 0 1 .96h14.991a1 1 0 0 0 .6-1.8c-3.54-2.656-3.598-8.146-3.598-8.2Zm-5.073-3.003A3.11 3.11 0 0 1 15.004 20c0 .038.002.208.017.469l-5.9-2.624a3.8 3.8 0 0 1 2.809-.848ZM15.45 28A5.2 5.2 0 0 1 14 25h-2a6.5 6.5 0 0 0 .968 3h-2.223A16.617 16.617 0 0 1 10 24H8a17.342 17.342 0 0 0 .665 4H6c.031-1.836.29-5.892 1.803-8.553l7.533 3.35A13.025 13.025 0 0 0 17.596 28Z" />
|
|
||||||
</svg>
|
|
||||||
Force Cleanup Containers
|
|
||||||
</button>
|
|
||||||
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
|
||||||
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
||||||
<path d="M7 4v16l13 -8z" />
|
|
||||||
</svg>
|
|
||||||
Deploy
|
|
||||||
</button>
|
|
||||||
@else
|
|
||||||
<x-modal-confirmation title="Confirm Service Stopping?" buttonTitle="Stop" submitAction="stop"
|
|
||||||
:checkboxes="$checkboxes" :actions="[__('service.stop'), __('resource.non_persistent')]" :confirmWithText="false" :confirmWithPassword="false"
|
|
||||||
step1ButtonText="Continue" step2ButtonText="Stop Service" :dispatchEvent="true"
|
|
||||||
dispatchEventType="stopEvent">
|
|
||||||
<x-slot:button-title>
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 text-error" viewBox="0 0 24 24"
|
|
||||||
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
||||||
<path d="M6 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
<path d="M14 5m0 1a1 1 0 0 1 1 -1h2a1 1 0 0 1 1 1v12a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1z">
|
|
||||||
</path>
|
|
||||||
</svg>
|
|
||||||
Stop
|
|
||||||
</x-slot:button-title>
|
|
||||||
</x-modal-confirmation>
|
|
||||||
<button @click="$wire.dispatch('startEvent')" class="gap-2 button">
|
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" class="w-5 h-5 dark:text-warning" viewBox="0 0 24 24"
|
|
||||||
stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
||||||
stroke-linejoin="round">
|
|
||||||
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
||||||
<path d="M7 4v16l13 -8z" />
|
|
||||||
</svg>
|
|
||||||
Deploy
|
|
||||||
</button>
|
|
||||||
@endif
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@script
|
@script
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@@ -37,7 +37,14 @@
|
|||||||
<h3>Production Environment Variables</h3>
|
<h3>Production Environment Variables</h3>
|
||||||
<div>Environment (secrets) variables for Production.</div>
|
<div>Environment (secrets) variables for Production.</div>
|
||||||
</div>
|
</div>
|
||||||
@forelse ($resource->environment_variables as $env)
|
@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)
|
||||||
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
|
<livewire:project.shared.environment-variable.show wire:key="environment-{{ $env->id }}"
|
||||||
:env="$env" :type="$resource->type()" />
|
:env="$env" :type="$resource->type()" />
|
||||||
@empty
|
@empty
|
||||||
|
|||||||
@@ -1,6 +1,11 @@
|
|||||||
<div>
|
<div>
|
||||||
<form wire:submit='submit'
|
<form wire:submit='submit'
|
||||||
class="flex flex-col items-center gap-4 p-4 bg-white border lg:items-start dark:bg-base dark:border-coolgray-300">
|
@class([
|
||||||
|
'flex flex-col items-center gap-4 p-4 bg-white border lg:items-start dark:bg-base',
|
||||||
|
'border-error' => $env->is_really_required,
|
||||||
|
'dark:border-coolgray-300' => !$env->is_really_required,
|
||||||
|
])
|
||||||
|
>
|
||||||
@if ($isLocked)
|
@if ($isLocked)
|
||||||
<div class="flex flex-1 w-full gap-2">
|
<div class="flex flex-1 w-full gap-2">
|
||||||
<x-forms.input disabled id="env.key" />
|
<x-forms.input disabled id="env.key" />
|
||||||
|
|||||||
Reference in New Issue
Block a user