Add extra fields for MinIO, Weblate, and Ghost services
This commit is contained in:
parent
6f886e8b6f
commit
10e5a58b9e
@ -31,6 +31,7 @@ public function mount()
|
||||
"name" => $fieldKey,
|
||||
"value" => $value,
|
||||
"isPassword" => $isPassword,
|
||||
"rules" => $rules
|
||||
];
|
||||
$this->rules["fields.$key.value"] = $rules;
|
||||
$this->validationAttributes["fields.$key.value"] = $fieldKey;
|
||||
|
@ -52,7 +52,7 @@ public function extraFields()
|
||||
foreach ($applications as $application) {
|
||||
$image = str($application->image)->before(':')->value();
|
||||
switch ($image) {
|
||||
case str($image)->contains('minio'):
|
||||
case str($image)?->contains('minio'):
|
||||
$data = collect([]);
|
||||
$console_url = $this->environment_variables()->where('key', 'MINIO_BROWSER_REDIRECT_URL')->first();
|
||||
$s3_api_url = $this->environment_variables()->where('key', 'MINIO_SERVER_URL')->first();
|
||||
@ -105,7 +105,7 @@ public function extraFields()
|
||||
|
||||
$fields->put('MinIO', $data->toArray());
|
||||
break;
|
||||
case str($image)->contains('weblate'):
|
||||
case str($image)?->contains('weblate'):
|
||||
$data = collect([]);
|
||||
$admin_email = $this->environment_variables()->where('key', 'WEBLATE_ADMIN_EMAIL')->first();
|
||||
$admin_password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_WEBLATE')->first();
|
||||
@ -130,6 +130,67 @@ public function extraFields()
|
||||
]);
|
||||
}
|
||||
$fields->put('Weblate', $data);
|
||||
break;
|
||||
case str($image)?->contains('ghost'):
|
||||
$data = collect([]);
|
||||
$MAIL_OPTIONS_AUTH_PASS = $this->environment_variables()->where('key', 'MAIL_OPTIONS_AUTH_PASS')->first();
|
||||
$MAIL_OPTIONS_AUTH_USER = $this->environment_variables()->where('key', 'MAIL_OPTIONS_AUTH_USER')->first();
|
||||
$MAIL_OPTIONS_SECURE = $this->environment_variables()->where('key', 'MAIL_OPTIONS_SECURE')->first();
|
||||
$MAIL_OPTIONS_PORT = $this->environment_variables()->where('key', 'MAIL_OPTIONS_PORT')->first();
|
||||
$MAIL_OPTIONS_SERVICE = $this->environment_variables()->where('key', 'MAIL_OPTIONS_SERVICE')->first();
|
||||
$MAIL_OPTIONS_HOST = $this->environment_variables()->where('key', 'MAIL_OPTIONS_HOST')->first();
|
||||
if ($MAIL_OPTIONS_AUTH_PASS) {
|
||||
$data = $data->merge([
|
||||
'Mail Password' => [
|
||||
'key' => data_get($MAIL_OPTIONS_AUTH_PASS, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_AUTH_PASS, 'value'),
|
||||
'isPassword' => true,
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($MAIL_OPTIONS_AUTH_USER) {
|
||||
$data = $data->merge([
|
||||
'Mail User' => [
|
||||
'key' => data_get($MAIL_OPTIONS_AUTH_USER, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_AUTH_USER, 'value'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($MAIL_OPTIONS_SECURE) {
|
||||
$data = $data->merge([
|
||||
'Mail Secure' => [
|
||||
'key' => data_get($MAIL_OPTIONS_SECURE, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_SECURE, 'value'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($MAIL_OPTIONS_PORT) {
|
||||
$data = $data->merge([
|
||||
'Mail Port' => [
|
||||
'key' => data_get($MAIL_OPTIONS_PORT, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_PORT, 'value'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($MAIL_OPTIONS_SERVICE) {
|
||||
$data = $data->merge([
|
||||
'Mail Service' => [
|
||||
'key' => data_get($MAIL_OPTIONS_SERVICE, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_SERVICE, 'value'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
if ($MAIL_OPTIONS_HOST) {
|
||||
$data = $data->merge([
|
||||
'Mail Host' => [
|
||||
'key' => data_get($MAIL_OPTIONS_HOST, 'key'),
|
||||
'value' => data_get($MAIL_OPTIONS_HOST, 'value'),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
$fields->put('Ghost', $data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
$databases = $this->databases()->get();
|
||||
|
@ -188,6 +188,7 @@ function generateServiceSpecificFqdns(ServiceApplication|Application $resource,
|
||||
$MINIO_SERVER_URL->value,
|
||||
]);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $payload;
|
||||
}
|
||||
|
@ -18,7 +18,8 @@
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-2">
|
||||
@foreach ($fields as $serviceName => $field)
|
||||
<x-forms.input type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}" required
|
||||
<x-forms.input type="{{ data_get($field, 'isPassword') ? 'password' : 'text' }}"
|
||||
required="{{ str(data_get($field, 'rules'))?->contains('required') }}"
|
||||
helper="Variable name: {{ $serviceName }}"
|
||||
label="{{ data_get($field, 'serviceName') }} {{ data_get($field, 'name') }}"
|
||||
id="fields.{{ $serviceName }}.value"></x-forms.input>
|
||||
|
Loading…
Reference in New Issue
Block a user