Skip to content

Commit 3b97bb1

Browse files
committed
feat: Add Argilla service configuration to Service model
1 parent a4c8f83 commit 3b97bb1

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

app/Models/Service.php

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,44 @@ public function extraFields()
285285
foreach ($applications as $application) {
286286
$image = str($application->image)->before(':')->value();
287287
switch ($image) {
288+
case str($image)?->contains('argilla'):
289+
$data = collect([]);
290+
$api_key = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_APIKEY')->first();
291+
$data = $data->merge([
292+
'API Key' => [
293+
'key' => data_get($api_key, 'key'),
294+
'value' => data_get($api_key, 'value'),
295+
'isPassword' => true,
296+
'rules' => 'required',
297+
],
298+
]);
299+
$data = $data->merge([
300+
'API Key' => [
301+
'key' => data_get($api_key, 'key'),
302+
'value' => data_get($api_key, 'value'),
303+
'isPassword' => true,
304+
'rules' => 'required',
305+
],
306+
]);
307+
$username = $this->environment_variables()->where('key', 'ARGILLA_USERNAME')->first();
308+
$data = $data->merge([
309+
'Username' => [
310+
'key' => data_get($username, 'key'),
311+
'value' => data_get($username, 'value'),
312+
'rules' => 'required',
313+
],
314+
]);
315+
$password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_ARGILLA')->first();
316+
$data = $data->merge([
317+
'Password' => [
318+
'key' => data_get($password, 'key'),
319+
'value' => data_get($password, 'value'),
320+
'rules' => 'required',
321+
'isPassword' => true,
322+
],
323+
]);
324+
$fields->put('Argilla', $data->toArray());
325+
break;
288326
case str($image)?->contains('rabbitmq'):
289327
$data = collect([]);
290328
$host_port = $this->environment_variables()->where('key', 'PORT')->first();

0 commit comments

Comments
 (0)