@@ -118,20 +118,43 @@ public static function infolist(Infolist $infolist): Infolist
118118 ->label (__ ('inspirecms::resources/export.exporter.label ' ))
119119 ->inlineLabel (),
120120
121- \ SolutionForest \ InspireCms \ Filament \ Infolists \Components \JsonEntry ::make ('payload ' )
121+ Infolists \Components \TextEntry ::make ('process_message ' )
122122 ->label (__ ('inspirecms::resources/export.message.label ' ))
123123 ->columnSpanFull ()
124- ->darkTheme ('tomorrow_night_eighties ' )
124+ ->size ('xs ' )->color ('gray ' )
125+ ->extraAttributes ([
126+ 'class ' => 'bg-gray-100 dark:bg-gray-800 rounded-md p-2 overflow-x-auto ' ,
127+ ])
125128 ->getStateUsing (function ($ record ) {
126129 $ payload = $ record ->payload ;
130+ if (! is_array ($ payload )) {
131+ return '' ;
132+ }
133+ $ arr = Arr::except ($ payload , ['result ' ]);
127134
128- return collect ( $ payload )-> except ( ' result ' )->all ();
135+ return str ( json_encode ( $ arr , JSON_PRETTY_PRINT ))-> wrap ( ' <code> ' , ' </code> ' )->wrap ( ' <pre> ' , ' </pre> ' )-> toHtmlString ();
129136 }),
130137
131- \ SolutionForest \ InspireCms \ Filament \ Infolists \Components \JsonEntry ::make ('payload. result ' )
138+ Infolists \Components \TextEntry ::make ('result ' )
132139 ->label (__ ('inspirecms::resources/export.result.label ' ))
133140 ->columnSpanFull ()
134- ->darkTheme ('tomorrow_night_eighties ' ),
141+ ->size ('xs ' )->color ('gray ' )
142+ ->extraAttributes ([
143+ 'class ' => 'bg-gray-100 dark:bg-gray-800 rounded-md p-2 overflow-x-auto ' ,
144+ ])
145+ ->html ()
146+ ->getStateUsing (function ($ record ) {
147+ $ payload = $ record ->payload ;
148+ if (! is_array ($ payload )) {
149+ return '' ;
150+ }
151+ $ arr = $ payload ['result ' ] ?? [];
152+ if (! is_array ($ arr )) {
153+ $ arr = [$ arr ];
154+ }
155+
156+ return str (json_encode ($ arr , JSON_PRETTY_PRINT ))->wrap ('<code> ' , '</code> ' )->wrap ('<pre> ' , '</pre> ' )->toHtmlString ();
157+ }),
135158 ]),
136159 ]);
137160 }
0 commit comments