Javascript Error in DisplayUI.pm during Search System Logs

This forum is only for reproducible bugs with csf and lfd (i.e. not iptables problems, lack of understanding how to use a feature, etc). Posts must be accompanied with full technical details of the problem and how it can be recreated. Any posts not adhering to this, or not considered bugs, will be moved to the General Discussion (csf) forum.
2 posts Page 1 of 1
BallyBasic79
Junior Member
Posts: 70
Joined: 22 Aug 2019, 21:43


On v13.06 Search System Logs page, a javascript error is produced in all cases due to the lack of the timer pause button id="CSFpauseID". While the pause button is omitted, the rest of the timer code is running and cannot set the missing timer button.
csf.cgi:2284 Uncaught TypeError: Cannot set property 'innerHTML' of null
at CSFpausetimer (csf.cgi:2284)
at csf.cgi:2480
I was able to prevent the error by adding the id="CSFpauseID" to the DisplayUI.pm in the main subroutine within the ($FORM{action} eq "loggrep") case at line 538 as follows:
Code: Select all
 ...
<button class='btn btn-default' onClick="CSFgrep()">Search</button>&nbsp;
<img src="$images/loader.gif" id="CSFrefreshing" style="display:none" /></div>
🆕  <span id="CSFpauseID"></span>
<div class='pull-right btn-group'><button class='btn btn-default' id='fontminus-btn'><strong>a</strong><span class='glyphicon glyphicon-arrow-down icon-configserver'></span></button>
...
I inserted it in the same relative location as when it is displayed in the ($FORM{action} eq "logtail") case. Tested only in Chrome 76.

This error prevents custom javascript placed in the csf.footer from executing.
Suggestion is to add the CSFpauseID to the Search page to prevent javascript error caused by its omission which causes user-added javascript from functioning (I added one-click select all function.) Feel free to let me know if you have any questions or concerns. Thanks!
ForumAdmin
Moderator
Posts: 1444
Joined: 01 Oct 2008, 09:24


We'll have a fix for this in the next release. The issue is with page load timing and JS execution rather than the timer running per se, as the timer itself should not be running at all on the search page.
2 posts Page 1 of 1