webgui: Revised filetree.js 6.10+ added data-picktop default=/mnt


SimonF

Recommended Posts

Hi @bonienlAre changes required to use the new vers of filedrop?

 

I am looking to see why this is not working in the NUT Plugin but not sure what needs to be changed.

    <input id="editfile" type="text" name="editfile" value="" readonly="" data-pickcloseonfile="true" data-pickfilter="conf,users" data-pickroot="/etc/nut" data-pickfolders="false" required="required" >



    $('#editfile').fileTreeAttach(null, null, function(file) {
        $('#editfile').val(file);
    });

    $('#editfile').on('change', function () {
        var Editfile = $('#editfile').val();
        $.getJSON('/plugins/nut/include/nut_edit.php', {editfile: Editfile}, function (data) {
                editor.setValue(data);
            }
        );
    });

 

Link to comment

I reverted filedrop.js to the older version, which was a modified version to work with Unraid.

The older version I had to update to make it work with jQuery 3.6.

Unfortunately jQuery 3.6 removed the possibility to extend events, this is something foreseen for jQuery 4, hence at the moment the “drop” functionality doesn’t work. I have file uploads attached to the click event.

 

See the display settings page, which uses filedrop.js to upload header images.

 

  • Like 1
Link to comment
10 hours ago, bonienl said:

I reverted filedrop.js to the older version, which was a modified version to work with Unraid.

The older version I had to update to make it work with jQuery 3.6.

Unfortunately jQuery 3.6 removed the possibility to extend events, this is something foreseen for jQuery 4, hence at the moment the “drop” functionality doesn’t work. I have file uploads attached to the click event.

 

See the display settings page, which uses filedrop.js to upload header images.

 

Sorry misread the change is filetree i am having an issue with no filedrop.

Link to comment

There is an additional setting added in filetree which defines the top level folder. A user can not go beyond this level, by default this setting is /mnt, but since you are working in a different folder altogether you need to specify this top level setting. Add the following variable to the input element

 

data-picktop="/etc/nut"

 

  • Thanks 1
Link to comment
  • SimonF changed the title to webgui: Revised filetree.js 6.10+ added data-picktop default=/mnt

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.