Skip to content

Commit

Permalink
Add option to log all htmx requests to browser console
Browse files Browse the repository at this point in the history
Add a new option to RT_Config.pm, $HtmxLogAll, which when set to a true
value will cause all htmx requests to be logged to the browser console.
  • Loading branch information
richieri-bps committed Apr 22, 2024
1 parent 326a028 commit bc16d5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
9 changes: 9 additions & 0 deletions etc/RT_Config.pm.in
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,15 @@ reason, add this to config:

See also L<DBIx::SearchBuilder/BuildSelectQuery>.

=item C<$HtmxLogAll>

Turns on logging of all HTMX requests. This is useful for debugging
HTMX requests and responses.

=cut

Set($HtmxLogAll, 0);

=back


Expand Down
4 changes: 4 additions & 0 deletions share/html/Elements/HeaderJavascript
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,8 @@ else {
@js_files = "/NoAuth/js/squished-$key.js";
}

if ( RT->Config->Get('HtmxLogAll') ) {
push @js_files, "/static/js/htmx-log-all.js";
}

</%INIT>
1 change: 1 addition & 0 deletions share/static/js/htmx-log-all.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
htmx.logAll();

0 comments on commit bc16d5b

Please sign in to comment.