trannamtrung1st / elFinder.Net.Core

An elFinder backend connector with less magic code and more compatibility. This enables .NET Standard 2.0 projects to easily integrate elFinder functionalities.
Apache License 2.0
12 stars 8 forks source link

Update usage #13

Closed benny-adiwijaya closed 3 years ago

benny-adiwijaya commented 3 years ago

Hi,

Is it possible to update usage in every action like copy, upload, delete etc instead only when open directory? I already tried to do so but sometimes the usage value is not correct and won't change except when open directory

trannamtrung1st commented 3 years ago

Hi @benny-adiwijaya, the backend updates the storage usage on each of those commands' execution. Can you provide an example of how you are working to retrieve the storage usage?

benny-adiwijaya commented 3 years ago

Hi @trannamtrung1st, this is example code

-And for javascript I added this elf.bind('upload', function (e, fm) { fm.getUI().data('_quota', e.data.quota); fm.getUI().data('_usage', e.data.usage); elfinderSetVolumeSize(); }); elf.bind('rm', function (e, fm) { fm.getUI().data('_quota', e.data.quota); fm.getUI().data('_usage', e.data.usage); elfinderSetVolumeSize(); });

When delete files, sometimes usage not updated

trannamtrung1st commented 3 years ago

It's on purpose since I think 'delete' is not too important to be necessary to update storage instantly. So I decided to let a background worker do the calculation after the deletion, and it may run after you retrieving the usage. The instant update can affect the performance. However, I think I will enable an option to decide whether to use it or not.

trannamtrung1st commented 3 years ago

Hi @benny-adiwijaya, I just updated the plugin to 1.2.5. Nothing changes, but it works as your expectation now.

benny-adiwijaya commented 3 years ago

yes, it works now.. thank you 👍