-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to generate HTML report without Javascript (for mailing) #685
Comments
|
I definitely agree that having an HTML-only report would be nice (or even a plain text report). Versions prior to v1.0 did this, however, now it's going to be a challenge since all the rendering is done given a JSON object which then is parsed by the templating engine to finally build the document. I wonder if there is a tool out there that can parse the JS report and spit out a pure HTML report or if it would need to be built-in within goaccess. |
|
+1. That would be a nice feature to have. |
|
Perhaps we could use Casperjs to obtain the resulting HTML. It will simulate a browser and render the page as one. We can thereafter save the HTML or take screenshots, of the full page or portions of it. Might be too much of an hassle to bring a dependency for this small feature. What do you guys thing? |
|
@Lusitaniae Thanks for posting that link. it looks like that could help, but like you said, the dependency would be a hassle. I was looking at what it would take to make that report pure html/css and I think generating it as it used to be in previous versions of goaccess wouldn't be too bad. The only issue is maintaining both versions (JS and straight static). A caveat is that it would only work to generate a static report (wouldn't work with |
|
i'd love to see a plain-text export as well... i'm still using analog right now because if this and well.. that's painful. :) |
|
for what it's worth, i'm using the following pipeline in a cronjob now: this mostly works - even though my email client doesn't support HTML (let alone javascript) so well, i can open this in a web browser and get the graphics display in all its glory. it would still be nice to have a text-friendly format. |
|
Hey guys, I wrote a little template placeholder replacement library. It is written in C so would be easy to implement with GoAccess. Just write up the plain HTML files loaded with placeholders and fill them with data upon request. I would happy to help if needed. https://github.com/dafky2000/simplectemplate |
|
@dafky2000 Thanks for posting this. It certainly looks nice and handy :) especially since it may address this issue (#685). Though, I'd like to keep one set of templates (for maintainability) that work with the current JSON output (for clients with JS-enabled) and if possible use your code to generate from the same templates the same output but as plain HTML. That brings me to the next question, is simplectemplate able to handle loops and conditionals? I believe I'm currently using some in the current mustache code? Thanks. |
|
Currently it is logic-less. Right now it is essentially a search and replace tool. I have plans to support "conditionals" with dafky2000/simplectemplate#23. Basically if the I have created an issue to support loops. dafky2000/simplectemplate#51 These are both dependent on nested placeholders (dafky2000/simplectemplate#22) otherwise aren't super useful. I use a javascript version of this library at work but need the functionality server side too. dafky2000/simplectemplate#23 and dafky2000/simplectemplate#22 are required for me to use simplectemplate in that project. If simplectemplate (with the added features) would work for your use-case too, I would make them a higher priority :) |
|
I do like where your project is going :) It would be great if you could make it compatible with mustache though. I'd definitely give it a shot and try to incorporate it into goaccess if I could use the same templates I currently use, mainly cause it would be a pain to maintain multiple duplicate templates. |
|
Ok, give me some time with that, I think it would very valuable as well. |
|
Just wanted to drop a ping and let you know I am making good progress with those issues. Just pushed to https://github.com/dafky2000/simplectemplate/tree/i23 I was able to implement it in a way so the format is pretty customizable but the default style is mustache syntax! Just fixing up a couple leftover There are a couple new tests here: |
|
@dafky2000 Thanks for the update. Certainly looking forward to it :) |
|
I write a python script to generate plain html report, it use the goaccess bright theme, now it's available at https://github.com/qijianjun/goaccess-render-plain-html |
|
@qijianjun Thanks for sharing that. This is great!!! |
The man page states "You can even email the HTML file since it is composed of a single file with no external file dependencies, how neat is that!" and that is basically right, but I have configured it and noticed, that those mails are not getting displayed directly.
However it is possible to make an attachment out of it and to open that in a browser, but the internal browser of my Thunderbird does not support javascript (to be more precise has it been deactivated by purpose years ago). I think it would be great to have html reports without that javascript requirement.
The text was updated successfully, but these errors were encountered: