From 6241f2c85ca4a462dcca035c10dc50a4feb9ce97 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Fri, 27 Sep 2024 16:29:51 +0300 Subject: [PATCH] update --- .../Resources/EmailDomainResource.php | 12 ++++++--- .../Email/App/Http/Livewire/DkimSetup.php | 27 +++++++++++++++++++ .../views/livewire/dkim-setup.blade.php | 19 +++++++++++++ 3 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 web/Modules/Email/App/Http/Livewire/DkimSetup.php create mode 100644 web/Modules/Email/resources/views/livewire/dkim-setup.blade.php diff --git a/web/Modules/Email/App/Filament/Resources/EmailDomainResource.php b/web/Modules/Email/App/Filament/Resources/EmailDomainResource.php index bfdc4cea..9b9a2f30 100644 --- a/web/Modules/Email/App/Filament/Resources/EmailDomainResource.php +++ b/web/Modules/Email/App/Filament/Resources/EmailDomainResource.php @@ -11,6 +11,7 @@ use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; use Illuminate\Database\Eloquent\SoftDeletingScope; +use Modules\Email\App\Http\Livewire\DkimSetup; use Modules\Email\App\Models\EmailBox; use Modules\Email\DkimDomainSetup; @@ -47,11 +48,14 @@ public static function table(Table $table): Table // ]) ->actions([ - Tables\Actions\Action::make('dkimSetup') + Tables\Actions\ViewAction::make('dkimSetup') ->label('DKIM Setup') - ->action(function (Domain $record) { - $output = DkimDomainSetup::run($record->domain); - dd($output); + ->form(function (Domain $record) { + return [ + Forms\Components\Livewire::make(DkimSetup::class, [ + 'domain' => $record->domain, + ]), + ]; }) ->icon('heroicon-o-pencil'), ]) diff --git a/web/Modules/Email/App/Http/Livewire/DkimSetup.php b/web/Modules/Email/App/Http/Livewire/DkimSetup.php new file mode 100644 index 00000000..c2c41b2a --- /dev/null +++ b/web/Modules/Email/App/Http/Livewire/DkimSetup.php @@ -0,0 +1,27 @@ +secure(); + + return view('email::livewire.dkim-setup', [ + 'secure' => $secure, + ]); + } + + public function secure() + { + $output = DkimDomainSetup::run($this->domain); + + return $output; + } +} diff --git a/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php b/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php new file mode 100644 index 00000000..1e2ec0f5 --- /dev/null +++ b/web/Modules/Email/resources/views/livewire/dkim-setup.blade.php @@ -0,0 +1,19 @@ +
+ @if(isset($secure['text'])) + +
+ Please add the following DNS record to your domain's DNS settings: +
+ +
+ +
+ + + Check DNS Record + + + @endif +