-
Notifications
You must be signed in to change notification settings - Fork 35
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
Better directorylisting with h5ai #5
Comments
Oh yes, please implement this! LibraryBox would look so much better with something like h5ai! |
Yeah this looks really good. Ive been thinking on how this could be achieved! Great find, well done! |
Ive installed h5ai on a MR3040 but modified the 'options.json' file so none of the fancy features are on. Doing testing now. It seems to be running really well so far without making it a slow user experience. |
Thanks for your feedback! (Something like that was my intuition. Can you provide any details about:
Did you figure out, how it is possible to integrate the download-counter display and the counting itself? |
Ok will do. |
Heres a list of instructions on installing h5ai, but NOTE that after doing this the Download-counter function doesnt work. Download the http://biblebox.org/BB/installing_h5ai.zip file which includes the _h5ai 0.24.1 folder, and 2 files - "mime.types" and "lighttpd.conf". This download of _h5ai from BibleBox.org contains an "options.json" file with options already set for use on the TP MR3040 router. NOTE: testing various options in the options.json file of _h5ai lead to the modified settings in this file. If you want to modify it yourself go ahead, but know that showing file previews, enabling selected downloads as packages, displaying folder trees, all makes browsing files on the BibleBox S......L....O.....W) Unzip the "installing_h5ai.zip" file and copy the contents to the root folder on your USB Plug the USB into your MR3040 and power it on You can then put the USB back into your computer and delete the _h5ai folder, mime.types file and lighttpd.conf file from the root folder on the USB as they have all been copied to the MR3040 itself. I had forgotten about File Download count though...... h5ai looks good, but I really need the counter to be working also. Am on it. |
Succeed with latest h5ai 0.26.1, but had to install php5-mod-session IPK packages. Blog post I've wrote in french on BiblioBox.net : http://bibliobox.net/blog/post/2014/11/20/installer-h5ai-v0261-sur-une-librarybox |
Appreciate the work on h5ai gang. It's weird timing, as we already have Jason On Thu Nov 27 2014 at 4:46:02 PM Sylvain Naudin [email protected]
|
I've added _h5ai support to the image build in my fork, and I love the way it's working. I'll hold off on a polished PR unless/until @griffey expresses interest, but I'm happy with it so far. 😄 |
@mbklein thank you. I like h5ai, too. I used it for two other webpage-project until now. These questions about h5ai is important:
|
I didn't do anything with the download counters, but it doesn't look difficult. I'll try to find some time to work on it next week. |
We have fixed the download counters. It is based on a change as follows, update "client/js/scripts.js" at the section w=function(e,f){e.attr(:href:,t.absHref)... which in un-obfuscated code is: w=function(e,t){e.attr("href","/dl_statistics_counter.php?DL_URL="+t.absHref) This updates the download counter when clicking on the files. We've made the change inside the h5ai_installer.tar so that you don't have to edit it on the device post-install. We have made this available on GitHub at: Unfortunately, it also calls 'dl_statistics_counter.php' when clicking on directories and or directories with index.html files in them. However, thankfully , this doesn't seem to actually be reflected in the statistics displayed except that for directories with index.html files it will enter a 'null' file name and count it. We have updated the java script files-top.js and downloads.js to skip null entry file names: files-top.js var $j = jQuery.noConflict(); $j.getJSON("/dl_statistics_display.php?sortBy=counter&sortOrder=DESC&list_type=top&top-max=10&output_type=json" , function(data) {
$j.each(data, function() { if (decodeURIComponent( this.filename_encoded ) != '') { var tbl_row = ""; tbl_row += '' + decodeURIComponent( this.filename_encoded ) + ' ' + this.counter + ' download(s)'; tbl_body += " } }) tbl_body += " files_top.html(tbl_body);
}); and download.js: // $.get( // ); var $j_d = jQuery.noConflict(); $j_d.getJSON("/dl_statistics_display.php?sortBy=counter&sortOrder=DESC&list_type=all&top-max=10&output_type=json" , function(data) {
$j_d.each(data, function() { if (decodeURIComponent( this.filename_encoded ) != '') { var tbl_row = ""; tbl_row += '' + decodeURIComponent ( this.filename_encoded ) + ' ' + this.counter + ' download(s)'; tbl_body += " } }) tbl_body += " files_top.html(tbl_body);
}); |
Did some testing with that today... to avoid the counting of directories, the correct way would be: function h(e, t) {
var url = t.absHref
if ( ! t.isFolder() ) {
url = "/dl_statistics_counter.php?DL_URL=" + t.absHref
}
e.attr("href", url , v ) && t.isFolder() && t.isManaged && e.on("click", function() {
return f(t.absHref), !1
}), g.unmanagedInNewWindow && !t.isManaged && e.attr("target", "_blank")
} This avoids the URL change for folders. The next way would be to make that optional vial configuration. And the Download counts aren't displayed in the listing, but I do not think this is easy to be implemented |
- Basic h5ai support based on work from @kirkdwilson https://github.com/kirkdwilson/LibraryBox-h5ai-Interface - Does not display download counts - Can count downloads using the LibraryBox features - Counter can be disabled in /opt/piratebox/www/_h5ai/conf/options.json - To be enabled in /opt/piratebox/conf/lighttpd/lighttpd.conf (exchange # before index includes) Closes #5
Check, test and if it works integrate the download-counter display.
http://larsjung.de/h5ai/
The text was updated successfully, but these errors were encountered: