darold / pgbadger

A fast PostgreSQL Log Analyzer
http://pgbadger.darold.net/
PostgreSQL License
3.51k stars 349 forks source link

Include source of javascript libraries used #298

Closed df7cb closed 7 years ago

df7cb commented 8 years ago

Hi,

pgbadger contains 22 embedded javascript/css files:

WRFILE: jquery.jqplot.min.css
WRFILE: jquery.min.js
WRFILE: jquery.jqplot.min.js
WRFILE: jqplot.pieRenderer.min.js
WRFILE: jqplot.barRenderer.min.js
WRFILE: jqplot.dateAxisRenderer.min.js
WRFILE: jqplot.canvasTextRenderer.min.js
WRFILE: jqplot.categoryAxisRenderer.min.js
WRFILE: jqplot.canvasAxisTickRenderer.min.js
WRFILE: jqplot.highlighter.min.js
WRFILE: jqplot.highlighter.min.js
WRFILE: jqplot.cursor.min.js
WRFILE: jqplot.pointLabels.min.js
WRFILE: bean.js
WRFILE: underscore.js
WRFILE: bootstrap.css
WRFILE: fontawesome.css
WRFILE: bootstrap.js
WRFILE: pgbadger_slide.js
WRFILE: pgbadger.css
WRFILE: pgbadger.js

Except for the pgbadger* ones, the files are minified (even if they aren't explicitely named .min.js).

From a free software (or Debian) viewpoint, this isn't the preferred form of modification. Even if all snippets are free software themselves, the compilation is at least on the verge of being non-free.

To fix this, I think two things would need to be done:

  1. Ship the non-minified form of all files in the git tree (and tar balls)
  2. Provide a script (or instructions) to convert the non-minified files to .min.js, and a script to update the embedded copies in the "pgbadger" file.

I'm willing to work on providing a pull request for this if we agree on the details.

Thanks!

darold commented 8 years ago

Hi Chris,

I'm agree with that. I think we can make use these changes to update all snippets to their latest version. Once it will be done I will publish a new release including all those changes. Do you want me to update the snippets before and provide a resources directory with non-minified form of all files ?

df7cb commented 8 years ago

Hi,

I'm not sure I understood the question, do you mean a pre-release including these changes?

darold commented 8 years ago

yes

df7cb commented 8 years ago

I'd be fine with the changes eventually appearing in git and the release. (As said I can help with it, but you'll likely have a better idea of how you'd want it to look like.)

Thanks!

PS: pgCluu has the same issue, btw

darold commented 8 years ago

Sorry for responding so late, but the upgrade from bootstrap 2 to bootstrap 3 kills me. There is lot of changes and pgbadger reports were totally broken. I'm closed to end the job but as a result I will publish a 8.3 release without change unless the last bugs fixes to close this branch. Then I will push my upgrade of bootstrap, jquery, etc. and all the fixes into pgbadger to support those new snippets versions. This work will be published in a 9.0 pgbadger new release ,after your review, because there could be backward compatibility issues with incremental v8.x reports even if I do my best to minimize the impact of such a change.

I will look to apply the same change in pgCluu next week.

darold commented 8 years ago

Hi

I've pushed all my changes to include source of javascript libraries used in pgbadger into the resources/ directory. Have look at script _tools/updt_embeddedrsc.pl and resources/README to see how I proceed. Feel free to ask for any change and/or submit all necessary pull request.

I use yui-compressor to minified resources file but I don't know if this is the right tool. Minified files are already embedded into pgbadger so there's nothing to do at installation time, script tools/updt_embedded_rsc.pl is only used by me to update the minified embedded files from sources or by anyone that want to be sur that embedded file are the same.

There's still one issue on downloading chart and a little work for backward compatibility, but I hope everything will be closed this week.

Let me know.

df7cb commented 8 years ago

Hi,

thanks for working on this, it's exactly what I had in mind.

I've just submitted a pull request to fix some minor issues.

darold commented 8 years ago

Ok, PR applied, thanks. It still need some work on backward compatibility and some additional test and I will publish the v9.0 release. Let me know if there's anything more to do.

df7cb commented 8 years ago

Fwiw, from looking through the git history of https://github.com/FortAwesome/Font-Awesome/tree/master/fonts, it looks like the actual source file for font-awesome/font/fontawesome-webfont.ttf (in the .zip) is font-awesome/font/FontAwesome.otf. Could you include that as well? (I don't think you need to actually rebuild the .ttf.)

darold commented 8 years ago

I'll check that.

darold commented 8 years ago

Commit a0b68c5 replace fontawesome-webfont.ttf with FontAwesome.otf.

darold commented 8 years ago

All pending tasks are done, I think pgBadger is ready to grow to 9.0. I will still run some additional test tomorrow and probably publish the new release.

darold commented 8 years ago

Version 9.0 is out including all changes, thanks a lot for your help.