Add Directus service fields to extraFields method
This commit is contained in:
parent
f1e7b870aa
commit
53cd3091f7
1 changed files with 26 additions and 0 deletions
|
|
@ -102,6 +102,32 @@ public function extraFields()
|
||||||
foreach ($applications as $application) {
|
foreach ($applications as $application) {
|
||||||
$image = str($application->image)->before(':')->value();
|
$image = str($application->image)->before(':')->value();
|
||||||
switch ($image) {
|
switch ($image) {
|
||||||
|
case str($image)?->contains('directus'):
|
||||||
|
$data = collect([]);
|
||||||
|
$admin_email = $this->environment_variables()->where('key', 'ADMIN_EMAIL')->first();
|
||||||
|
$admin_password = $this->environment_variables()->where('key', 'SERVICE_PASSWORD_ADMIN')->first();
|
||||||
|
|
||||||
|
if ($admin_email) {
|
||||||
|
$data = $data->merge([
|
||||||
|
'Admin Email' => [
|
||||||
|
'key' => data_get($admin_email, 'key'),
|
||||||
|
'value' => data_get($admin_email, 'value'),
|
||||||
|
'rules' => 'required|email',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
if ($admin_password) {
|
||||||
|
$data = $data->merge([
|
||||||
|
'Admin Password' => [
|
||||||
|
'key' => data_get($admin_password, 'key'),
|
||||||
|
'value' => data_get($admin_password, 'value'),
|
||||||
|
'rules' => 'required',
|
||||||
|
'isPassword' => true,
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
$fields->put('Directus', $data);
|
||||||
|
break;
|
||||||
case str($image)?->contains('kong'):
|
case str($image)?->contains('kong'):
|
||||||
$data = collect([]);
|
$data = collect([]);
|
||||||
$dashboard_user = $this->environment_variables()->where('key', 'SERVICE_USER_ADMIN')->first();
|
$dashboard_user = $this->environment_variables()->where('key', 'SERVICE_USER_ADMIN')->first();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue