mirror of
https://github.com/tiennm99/coolify.git
synced 2026-08-20 16:23:30 +00:00
feat(service): warn when required environment variables are missing
Surface unset required service env vars in the configuration checker popup and sidebar, refresh on env updates, and keep the env table horizontally scrollable with correct managed/hardcoded pagination order.
This commit is contained in:
+10
-10
@@ -1640,16 +1640,16 @@ class Service extends BaseModel
|
||||
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;
|
||||
}
|
||||
get: fn (): bool => $this->missingRequiredEnvironmentVariables()->isEmpty()
|
||||
);
|
||||
}
|
||||
|
||||
public function missingRequiredEnvironmentVariables(): Collection
|
||||
{
|
||||
return $this->environment_variables()
|
||||
->where('is_required', true)
|
||||
->get()
|
||||
->filter(fn (EnvironmentVariable $environmentVariable): bool => $environmentVariable->is_really_required)
|
||||
->values();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user