webmin / authentic-theme

Official theme for the best server management panel of the 21st Century
https://authentic-theme.com
MIT License
947 stars 163 forks source link

Filebrowser in Chrome v42+ #164

Closed Goeny closed 9 years ago

Goeny commented 9 years ago

As of Chrome v42 java is disabled and will be removed from future use in Google Chrome Browser. At this point it is possible to walkaround this problem using the NPAPI. However,.. This option will be removed by Google Chrome aswell around september 2015 (maybe sooner) which will result in a non-functioning file-browser in Google Chrome.

Will there be a solution created in this theme? Or should this be adressed to the Webmin/Virtualmin developers?

iliajie commented 9 years ago

I was thinking of this already as I don't use that Java File-browser...Urff..

I will see. Maybe, I will integrate it sometime later. I just release version 12 of the theme and need to do some other things.

If people get more involved and the theme becomes default, I will surely try me best to implement it, along with other things.

Real-Gecko commented 9 years ago

Ive developed file manager for Webmin/Virtualmin, its written purely in perl. https://github.com/Real-Gecko/filemin

iliajie commented 9 years ago

Can you please post screenshots in your repo?

Goeny commented 9 years ago

And perhaps instructions how to install them in webmin? Would love to try this out and do some testing.

iliajie commented 9 years ago

That's right!

iliajie commented 9 years ago

..but I think you just have to copy it to /usr/libexec/webmin.. I'll try..

iliajie commented 9 years ago

I tried it. Not bad, really!! But it requires a lot of work to be done. For myself, I find faster to use console. Besides for console, there is mc (Midnight Commander), - and that guy is TOTAL kick ass for anything, I have ever used.

Nevertheless, I believe that your work will be appreciated by many people, including me, as running file manager without Java would be a good idea, even just with basic functions!

Few things, 1. images should no contain css and js files. Rename folder for images, let's say pictures to avoid problems with Authentic Theme. Nice work, keep improving it!

iliajie commented 9 years ago

Besides, I can add sorting for table headers and it will make sorting work!

Other things you should do, from my point of view:

  1. NO DEPENDENCIES! Every time you call use make sure to make locally available those modules. Make sure that your script will check if user already have them installed and in that case use those that user system already have. In case there is no need module, load one from local folder.
  2. As Authentic Theme supports icons now, you could make your top icons print using icons_table and generate_icon. You can see of how it's done in different modules. Then a user will be able to choose which style of icons user wants and I will be able to make those icons look very beautiful.
  3. Make plain checkbox click act as normal, not as right now.
  4. Make those alerts a Bootstrap confirmation like. Authentic has all of this. When all of this done and working, I will talk with *min team and as them what to do next.

Upload at the moment results in Perl execution error.

iliajie commented 9 years ago

It's a very cool thing!! I'm starting to like you file-manager more and more!

Try running in the console to following (not for the top frame but for page(index.cgi)): :D

$.fn.dataTableExt.sErrMode = 'throw';
$('#list_form > table').dataTable({
    "order": [],
    "aaSorting": [],
    "bDestroy": true,
    "bPaginate": false,
    "bInfo": false,
    "destroy": true,
    "oLanguage": {
        "sSearch": " "
    }
});

The above will initialize dataTables for you. (filesize will not work correctly at the moment but can be fixed later.)

Besides, I could make all of those file listing you got, being searchable with left search (autocomplete) field.

Real-Gecko commented 9 years ago

Well I prefer mc myself, but the basic idea behind filemin module was to provide users quick access to their home folders, so for example they can quickly download archived public_html for backup purposes or quickly add new images for their theme etc.

Images folder contains js and css cause I had an interesting issue under CentOS 7 - when you install module from wbm.gz Webmin says that "module css" and "module js" have no "module.info" file and so filemin is not installed. That was really wierd for me, so I moved theese two folders under images. However testing under Ubuntu does not give such an error. So Id be happy if people help me to test. So now I think Ill move my "images" folder to "icons" folder, this will make filemin compatible with your theme :)

Real-Gecko commented 9 years ago

About dependencies: each system (CentOS, Ubuntu, Debian) has it`s own modules installed by default. Is it possible to check for required perl modules during installation?

iliajie commented 9 years ago
  1. Try putting css and js under unauthenticated folder.
  2. Yes, it's possible. Edit module.info and put there the following (something line that):

depends=File::MimeInfo File::Basename 1.730

3 . Icons folder should be fine!

iliajie commented 9 years ago

This is how your top icons should look/be controlled like, using mentioned functions. See the screen shots here:

https://github.com/webmin/webmin/issues/183#issuecomment-98528136

iliajie commented 9 years ago

Few more:

  1. Make files/dirs be renamed inline, without pop-up.
  2. Put ~ / in a button like and make it editable and submimttalbe, so people could write the path they want by hand. Autosugestions on the path, while typing, would also be nice but it's a bit harder.
Goeny commented 9 years ago

Well, this made me very curious. But cloning the filemanager in the webmin folder (On Debian it is: /usr/share/webmin) does not give me a new filemanager and/or a link to the filemanager.

Am is supposed to copy it to the "file" directory? What is the way to implement it?

iliajie commented 9 years ago

@Goeny You have to activate it by going to Webmin Users (or clicking on the icon next to logout) and enabling it in Available Webmin modules

Goeny commented 9 years ago

Ah.. found it!. It does load now, but for some reason none of the images will load correctly.

When i click the upper "./" the filemanager reloads and i see the images appear. But in a split second all images will be gone.

1 sec after Filemin reloads: filemin2

1 second later: filemin1

According to Chrome inspector i get a 404 error on the images.

iliajie commented 9 years ago

@Goeny no worries, it's what Authentic Theme does. Author knows it. When he moves icons under icons folder or make icons work using generate_icon - it will be fine.

Real-Gecko commented 9 years ago

What error do you get when try to upload a file?

iliajie commented 9 years ago

500 Error - Perl execution failed Can't open /root/ for writing - Is a directory at /usr/libexec/webmin/filemin/upload.cgi line 26.

iliajie commented 9 years ago

+1 One more when doing cut:

500 Error - Perl execution failed unable to create tmpdir No such file or directory at /usr/libexec/webmin/filemin/cut.cgi line 11.

..and same on copy.

Real-Gecko commented 9 years ago

Ah yes I think I understand. File uploading is not really intuitive - first you need to select files for upload by clicking "Browse for Upload", and then click "Upload files" to actually upload them. I think I will add javascript alert if nothing selected for upload.

iliajie commented 9 years ago

No, it's not the cause! I selected some files, clicked Upload and same error here.

Please don't use alerts. Use Bootstrap modals - http://bootboxjs.com/ - scrolldown to see Prompt example.

iliajie commented 9 years ago

... and why I can't go higher than my root directory?

Real-Gecko commented 9 years ago

Hmmm, well, I tried to avoid using extra libraries as jQuery or Bootstrap as mentioned here: http://doxfer.webmin.com/Webmin/Module_Development ' Keep use of Javascript and DHTML to a minimum where possible. This ensures that your module will work on a wide variety of browsers, even those on mobile devices that only support plain old HTML.' That`s why javascript in my module is so dumb :) Maybe putting data inside notifications area near quickbuttons is a decision?

Real-Gecko commented 9 years ago

Locking user inside his "home" was a security measure, to prevent one from poking around whole filesystem. I was thinking about it and planning to add module configuration to make "root" path configurable as it is done in original File module.

iliajie commented 9 years ago

Well, this tutorial is a bit outdated. My theme has both jQuery and Bootstrap. It will work anyway. There are no browsers that support plain old HTML - that is ridiculous try to support it (old and nasty browsers like IE6).

I would strongly recommend using it. Otherwise it will not be user friendly. And the lest popups (alert) - the better. Try using AJAX calls to update page's content.

..and about security mesures, just before switching to another directory, check if it (directory or file) can be read. User can always use Command Shell to issue cat or ls on any directory/file.

Real-Gecko commented 9 years ago

Agreed, supporting crap like IE6 is stupid. So if jQuery will become standart in Webmin ui it will be really cool.

Real-Gecko commented 9 years ago

I close acces to command shell for my users, so filemin is a good option for them :D

iliajie commented 9 years ago

If/When my theme becomes default (it's already in webmin package), it will be there anyway. Besides no one says you can't use jQuery yourself right now.

.. I see but root user shouldn't have difficulties going anywhere he/she wants.

Real-Gecko commented 9 years ago

Well, thanks for all your support! I am glad to see my project interested someone :) What about we continue discussion in filemin issue queue? Can you, please, create issues with your ideas and critics there?

iliajie commented 9 years ago

Alrglight, I will. Please update to the next version and I will do a bit after that point.

Real-Gecko commented 9 years ago

generate_icon() gives "image not found". I tried everything /filemin/unauthenticated/icons/quick/select-all.png filemin/unauthenticated/icons/quick/select-all.png /unauthenticated/icons/quick/select-all.png unauthenticated/icons/quick/select-all.png generate_icon('unauthenticated/icons/quick/select-all.png') works fine under for example "MSC.Linux theme" and simple print of <img src="unauthenticated/icons/quick/select-all.png"> works fine too.

iliajie commented 9 years ago

The page Webmin->Webmin Configuration, here is the example of how the icons are printed using &icons_table


my (@wlinks, @wtitles, @wicons);
@wlinks = ( "edit_access.cgi", "edit_bind.cgi", "edit_log.cgi",
        "edit_proxy.cgi", "edit_ui.cgi", "edit_mods.cgi",
        "edit_os.cgi", "edit_lang.cgi", "edit_startpage.cgi",
        "edit_upgrade.cgi", "edit_session.cgi", "edit_twofactor.cgi",
        "edit_assignment.cgi",
        "edit_categories.cgi", "edit_descs.cgi", "edit_themes.cgi",
        "edit_referers.cgi", "edit_anon.cgi", "edit_lock.cgi",
        "edit_mobile.cgi", "edit_blocked.cgi", "edit_status.cgi",
        "edit_advanced.cgi", "edit_debug.cgi", "edit_web.cgi",
        "edit_webmincron.cgi", );
@wtitles = ( $text{'access_title'}, $text{'bind_title'},
         $text{'log_title'}, $text{'proxy_title'},
         $text{'ui_title'}, $text{'mods_title'},
         $text{'os_title'}, $text{'lang_title'},
         $text{'startpage_title'}, $text{'upgrade_title'},
         $text{'session_title'}, $text{'twofactor_title'},
         $text{'assignment_title'},
         $text{'categories_title'}, $text{'descs_title'},
         $text{'themes_title'}, $text{'referers_title'},
         $text{'anon_title'}, $text{'lock_title'},
         $text{'mobile_title'}, $text{'blocked_title'},
         $text{'status_title'}, $text{'advanced_title'},
         $text{'debug_title'}, $text{'web_title'},
         $text{'webmincron_title'}, );
@wicons = ( "images/access.gif", "images/bind.gif", "images/log.gif",
        "images/proxy.gif", "images/ui.gif", "images/mods.gif",
        "images/os.gif", "images/lang.gif", "images/startpage.gif",
        "images/upgrade.gif", "images/session.gif", "images/twofactor.gif",
        "images/assignment.gif", "images/categories.gif",
        "images/descs.gif", "images/themes.gif", "images/referers.gif",
        "images/anon.gif", "images/lock.gif", "images/mobile.gif",
        "images/blocked.gif", "images/status.gif",
        "images/advanced.gif", "images/debug.gif", "images/web.gif",
        "images/webmincron.gif", );

push(@wlinks, "edit_ssl.cgi", "edit_ca.cgi");
push(@wtitles, $text{'ssl_title'}, $text{'ca_title'});
push(@wicons, "images/ssl.gif", "images/ca.gif");

&icons_table(\@wlinks, \@wtitles, \@wicons);
Real-Gecko commented 9 years ago

No images any way. They all are replaced with /images/not_found.svg

iliajie commented 9 years ago

Ahh. ok! Then you're doing everything right! Put icons please to authentic-theme/images/modules/filemin or don't use images for your folder name, try icons.

Real-Gecko commented 9 years ago

Icons are now in my modules unauthenticated/icons and unauthenticated/icons/quick neither do work :(

iliajie commented 9 years ago

Remove unauthenticated and leave just icons, with or without slash.

iliajie commented 9 years ago

Any luck!?

Real-Gecko commented 9 years ago

Sorry I'm on another computer and cannot check things right now, I think I will continue tomorrow. By the way, I've noticed that when some long operations like modules update or new virtual server creation occurs, there is no output within your theme. Actually output is there but it is overlayed with throbbler.

iliajie commented 9 years ago

With output? Could you explain!

Real-Gecko commented 9 years ago

Here, we create the new virtual server 123 - process started 124 - and as it goes new messages appear Now let's try deleting 125 - process started 126 - new messages appear as stages of deletion complete and when the whole process finished there is a "Go back" link at the bottom.

iliajie commented 9 years ago

You mean that you don't see it printing but only final result?

Real-Gecko commented 9 years ago

yes

iliajie commented 9 years ago

Will try fixing it

Real-Gecko commented 9 years ago

I have an interesting issue: Almost all links in my module's interface have "javascript:void(0)" in "href", so clickin them triggers javascript functions. Clicking links in top-right toolbar(№1 on screenshot 1) works fine, while clicking any link inside file list table(№2 on screenshot 1) triggers bound javascript function and also initiates throbbler that never ends(screenshot 2) 1 2 Is there any way to avoid this?

iliajie commented 9 years ago

You can disable spinner using settings. Or just double click it when it appears. I will fix it when you have more or the less stable version.

Real-Gecko commented 9 years ago

OK, here it is https://github.com/Real-Gecko/filemin/blob/master/install/filemin.wbm.gz?raw=true Version 0.8.2 is ready to rumble :D Icons are still generated by simply printing html, rename does not work under Authentic cause of spinner, however there's a button in top-bar that can rename "openlayers" file or folder to anything you want as a proof of concept. Fixed issues with "copy/cut/paste". Inline editing not implemented yet, I think bugfixes for now are more important. BEWARE: there is no overwrite confirmations during pack/unpack/paste, exsiting files may be overwritten during theese procedures, proceed with caution.

Real-Gecko commented 9 years ago

By the way, about icons: in Authentic almos all icons are greyed, can it be switched off? Color of the icons is good for quick orientation on the page, with all of them greyed I feel lost.

iliajie commented 9 years ago

Yes. You can turn it off in settings using settings_right_grayscaled_table_icons. I'm working on settings now so users could use Webmin interface to do it.

Looking at your filemanager in a bit.