diff --git a/app/Mailman/Actions/SettingIndexAction.php b/app/Mailman/Actions/SettingIndexAction.php
index e1dd093d..0d33762d 100644
--- a/app/Mailman/Actions/SettingIndexAction.php
+++ b/app/Mailman/Actions/SettingIndexAction.php
@@ -21,6 +21,10 @@ class SettingIndexAction
'is_active' => $settings->is_active,
'base_url' => $settings->base_url,
'username' => $settings->username,
+ 'all_list' => $settings->all_list,
+ 'all_parents_list' => $settings->all_parents_list,
+ 'active_leaders_list' => $settings->active_leaders_list,
+ 'passive_leaders_list' => $settings->passive_leaders_list,
'password' => '',
];
}
@@ -30,13 +34,18 @@ class SettingIndexAction
session()->put('menu', 'setting');
session()->put('title', 'Mailman-Einstellungen');
- $state = $settings->base_url && $settings->username && $settings->password && $settings->is_active
- ? app(MailmanService::class)->fromSettings($settings)->check()
- : null;
+ if ($settings->is_active) {
+ $state = app(MailmanService::class)->fromSettings($settings)->check();
+ $lists = app(MailmanService::class)->fromSettings($settings)->getLists();
+ } else {
+ $state = null;
+ $lists = [];
+ }
return Inertia::render('setting/Mailman', [
'data' => $this->handle($settings),
'state' => $state,
+ 'lists' => $lists,
]);
}
}
diff --git a/app/Mailman/Actions/SettingSaveAction.php b/app/Mailman/Actions/SettingSaveAction.php
index 04b25b90..708cf2b5 100644
--- a/app/Mailman/Actions/SettingSaveAction.php
+++ b/app/Mailman/Actions/SettingSaveAction.php
@@ -24,6 +24,10 @@ class SettingSaveAction
'base_url' => $input['base_url'] ?? null,
'username' => $input['username'] ?? null,
'password' => $input['password'] ?? null,
+ 'all_list' => $input['all_list'] ?? null,
+ 'all_parents_list' => $input['all_parents_list'] ?? null,
+ 'active_leaders_list' => $input['active_leaders_list'] ?? null,
+ 'passive_leaders_list' => $input['passive_leaders_list'] ?? null,
'is_active' => $input['is_active'] ?? false,
]);
diff --git a/app/Mailman/Data/MailingList.php b/app/Mailman/Data/MailingList.php
index 24a0cedb..dca67997 100644
--- a/app/Mailman/Data/MailingList.php
+++ b/app/Mailman/Data/MailingList.php
@@ -3,6 +3,7 @@
namespace App\Mailman\Data;
use Spatie\LaravelData\Attributes\MapName;
+use Spatie\LaravelData\Attributes\MapOutputName;
use Spatie\LaravelData\Data;
use Spatie\LaravelData\Mappers\SnakeCaseMapper;
@@ -12,7 +13,9 @@ class MailingList extends Data
public function __construct(
public string $description,
public string $displayName,
+ #[MapOutputName('name')]
public string $fqdnListname,
+ #[MapOutputName('id')]
public string $listId,
public string $listName,
public string $mailHost,
diff --git a/app/Mailman/MailmanSettings.php b/app/Mailman/MailmanSettings.php
index a3269a43..71421d38 100644
--- a/app/Mailman/MailmanSettings.php
+++ b/app/Mailman/MailmanSettings.php
@@ -16,6 +16,14 @@ class MailmanSettings extends LocalSettings
public bool $is_active;
+ public ?string $all_list;
+
+ public ?string $all_parents_list;
+
+ public ?string $active_leaders_list;
+
+ public ?string $passive_leaders_list;
+
public static function group(): string
{
return 'mailman';
diff --git a/database/settings/2022_10_18_123919_mailman_lists.php b/database/settings/2022_10_18_123919_mailman_lists.php
new file mode 100644
index 00000000..2286a222
--- /dev/null
+++ b/database/settings/2022_10_18_123919_mailman_lists.php
@@ -0,0 +1,14 @@
+migrator->add('mailman.all_parents_list', null);
+ $this->migrator->add('mailman.all_list', null);
+ $this->migrator->add('mailman.active_leaders_list', null);
+ $this->migrator->add('mailman.passive_leaders_list', null);
+ }
+}
diff --git a/resources/js/views/setting/Mailman.vue b/resources/js/views/setting/Mailman.vue
index 274d0a21..fde12259 100644
--- a/resources/js/views/setting/Mailman.vue
+++ b/resources/js/views/setting/Mailman.vue
@@ -20,6 +20,34 @@