feat(services): add Jean Server one-click template and extra fields

Register the jean-server compose template, logo, and catalog entries,
and expose token and allowed-origins settings on the service form.
Sort extra fields by sortOrder and omit empty service-name prefixes.
This commit is contained in:
Andras Bacsai committed 2026-08-13 11:00:04 +02:00
1 parent 9794ce2686
commit c3f485e0d6
9 files changed
+165 -2

No files matched your search

+3 -1
View File
@@ -101,6 +101,7 @@ class StackForm extends Component
$rules = data_get($field, 'rules', 'nullable');
$isPassword = data_get($field, 'isPassword', false);
$customHelper = data_get($field, 'customHelper', false);
$sortOrder = data_get($field, 'sortOrder');
$this->fields->put($key, [
'serviceName' => $serviceName,
'key' => $key,
@@ -109,6 +110,7 @@ class StackForm extends Component
'isPassword' => $isPassword,
'rules' => $rules,
'customHelper' => $customHelper,
'sortOrder' => $sortOrder,
]);
$this->validationAttributes["fields.$key.value"] = $fieldKey;
@@ -116,7 +118,7 @@ class StackForm extends Component
}
$this->fields = $this->fields->groupBy('serviceName')->map(function ($group) {
return $group->sortBy(function ($field) {
return data_get($field, 'isPassword') ? 1 : 0;
return data_get($field, 'sortOrder') ?? (data_get($field, 'isPassword') ? 1 : 0);
})->mapWithKeys(function ($field) {
return [$field['key'] => $field];
});
+21
View File
@@ -1180,6 +1180,27 @@ class Service extends BaseModel
}
$fields->put('Openclaw', $data->toArray());
break;
case $image->contains('coollabsio/jean-server'):
$data = collect([]);
$settings = [
'Token' => ['key' => 'SERVICE_PASSWORD_64_JEAN', 'rules' => 'required', 'isPassword' => true, 'sortOrder' => 1, 'customHelper' => 'Token required to access Jean Server. Variable name: SERVICE_PASSWORD_64_JEAN'],
'Allowed Origins' => ['key' => 'JEAN_ALLOWED_ORIGINS', 'rules' => 'nullable|string', 'sortOrder' => 2, 'customHelper' => 'Comma-separated additional browser origins. Same-origin access is always allowed. Variable name: JEAN_ALLOWED_ORIGINS'],
];
foreach ($settings as $label => $setting) {
$variable = $this->environment_variables()->where('key', $setting['key'])->first();
if (! $variable) {
continue;
}
$data->put($label, [
...$setting,
'value' => data_get($variable, 'value'),
]);
}
$fields->put('', $data->toArray());
break;
default:
$data = collect([]);
$admin_user = $this->environment_variables()->where('key', 'SERVICE_USER_ADMIN')->first();