diff --git a/resources/views/infolists/entries/formatted-json.blade.php b/resources/views/infolists/entries/formatted-json.blade.php new file mode 100644 index 0000000..e0aba4c --- /dev/null +++ b/resources/views/infolists/entries/formatted-json.blade.php @@ -0,0 +1,8 @@ + +
+{{ json_encode(
+    $getState(),
+    JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
+) }}
+
+
diff --git a/src/FilamentWebhookClientServiceProvider.php b/src/FilamentWebhookClientServiceProvider.php index ace2d92..6aa197f 100644 --- a/src/FilamentWebhookClientServiceProvider.php +++ b/src/FilamentWebhookClientServiceProvider.php @@ -13,6 +13,7 @@ public function configurePackage(Package $package): void $package ->name('filament-webhook-client') ->hasConfigFile() + ->hasViews() ->hasTranslations(); } diff --git a/src/Resources/WebhookCallResource.php b/src/Resources/WebhookCallResource.php index 5afdda3..37d5a1c 100644 --- a/src/Resources/WebhookCallResource.php +++ b/src/Resources/WebhookCallResource.php @@ -49,11 +49,14 @@ public static function infolist(Infolist $infolist): Infolist ->label('ID'), Infolists\Components\TextEntry::make('name'), Infolists\Components\TextEntry::make('url'), - Infolists\Components\KeyValueEntry::make('headers') + Infolists\Components\ViewEntry::make('headers') + ->view('filament-webhook-client::infolists.entries.formatted-json') ->columnSpanFull(), - Infolists\Components\KeyValueEntry::make('payload') + Infolists\Components\ViewEntry::make('payload') + ->view('filament-webhook-client::infolists.entries.formatted-json') ->columnSpanFull(), - Infolists\Components\KeyValueEntry::make('exception') + Infolists\Components\ViewEntry::make('exception') + ->view('filament-webhook-client::infolists.entries.formatted-json') ->columnSpanFull(), ]); } @@ -100,7 +103,9 @@ public static function table(Table $table): Table // ]) ->actions([ - Tables\Actions\ViewAction::make(), + Tables\Actions\ViewAction::make() + ->stickyModalFooter() + ->stickyModalHeader(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([