html logger not replacing template variables
See original GitHub issueHello! Thanks for all your efforts with this great library.
I’m running into an issue with the html logger, I did a fresh install pip install simplemonitor
and I am using nginx:alpine to show the HTML. The page is loading, but I’m seeing the following errors (also see screenshot).
[Error] ReferenceError: Can't find variable: _INTERVAL_
check_age (status.html:22)
onload (status.html:30)
[Warning] jQuery.Deferred exception: Can't find variable: _INTERVAL_ – "check_age@http://REDACTED:8081/s/status.html:22:31↵http://REDACTED:8081/s/status.html:65:1…" – undefined (jquery-3.4.1.slim.min.js, line 2)
[Error] ReferenceError: Can't find variable: _INTERVAL_
(anonymous function) (jquery-3.4.1.slim.min.js:2:31330)
The page is refreshing at the interval I set (15), so I know it is working…I’m just not sure what the issue is with the template vars. I don’t support you have an idea of what I am doing wrong?
A few more details, comparing the code vs what is generated SOME template variables are working. Here is the code vs. what is rendered in my browser (latest Safari)
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L7
<title>OK@5d77549f5fa3 Monitor</title>
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L11
<meta http-equiv="refresh" content="_INTERVAL_" />
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L21
var generated = 1591463515;
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L24
if (diff > (_INTERVAL_ * 2)) {
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L33
<div class="navbar navbar-light bg-light border-bottom OKBORDER_" id="summary">
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L35
<div class="navbar-text d-none d-lg-block" id="updated">
Updated at 2020-06-06 17:11:55 by 5d77549f5fa3 (_VERSION_)
</div>
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/header.html#L37
<div class="navbar-text">
<div id="summary" class="ok">
OK
<div id="details">
<span class="ok">1 OK</span>
<span class="fail">0 FAIL</span>
<span class="old">0 OLD</span>
<span class="remote">0 remote</span>
</div>
</div>
</div>
Here is the generated HTML table contents
<tr class="okrow">
<td class="monitor_name">localhost</td>
<td class="status ok">OK</td>
<td>5d77549f5fa3</td>
<td></td>
<td class="vfc"> </td>
<td>0+00:00:00</td>
<td> </td>
<td></td>
<td></td>
<td></td>
</tr>
https://github.com/jamesoff/simplemonitor/blob/develop/simplemonitor/html/footer.html#L2
<div class="navbar-text d-block d-lg-none" id="updated">
Updated at 2020-06-06 17:20:03<br />by 5d77549f5fa3 (_VERSION_)
</div>
Thanks
[Edit]: cleanup and details
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (6 by maintainers)
Top GitHub Comments
awesome. thanks so much for your help with this and taking some of your free time to take a look.
Cheers for the info. Something definitely not right there, I recall fixing something similar but thought it was after 1.9.0. Let me test it out on a fresh install…