Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

download shared subdirectory #1184

Merged
merged 20 commits into from
Dec 28, 2020
Merged

Conversation

WeidiDeng
Copy link
Contributor

Description
Currently shared folder can't be navigated like a real folder, only direct subdirectory and files can be viewed, but not downloadable separately.

This pr fixes issue. Folders can be navigated and select files can be downloaded.

馃毃 Before submitting your PR, please read community, and indicate which issues (in any of the repos) are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.

  • DO make sure you are requesting to pull a topic/feature/bugfix branch (right side). Don't request your master!
  • DO make sure you are making a pull request against the master branch (left side). Also you should start your branch off our master.
  • DO make sure that File Browser can be successfully built. See builds and development.
  • DO make sure that related issues are opened in other repositories. I.e., the frontend, caddy plugins or the web page need to be updated accordingly.
  • AVOID breaking the continuous integration build.

Further comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution you did, what alternatives you considered, etc.

鉂わ笍 Thank you!

Copy link
Member

@o1egl o1egl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a bug that when you double click on a file which has # in its name the blank page is displayed.

@ramiresviana
Copy link
Contributor

  • The information panel has some inconsistency when selecting a list item, only part of its information is being updated, that can cause user confusion about which item will actually be downloaded.
  • The "Select multiple" feels out of place, lets move it to the header bar.
  • The current routing allows to insert an arbitrary string to the path, like /share/I2cD5Vvw/*anything*. Also i think we should omit the root directory from the url.

@WeidiDeng
Copy link
Contributor Author

  • The information panel has some inconsistency when selecting a list item, only part of its information is being updated, that can cause user confusion about which item will actually be downloaded.

Which parts should be updated?

  • The "Select multiple" feels out of place, lets move it to the header bar.

I plan to make it more like the multiple style in the file listing page when I have time

  • The current routing allows to insert an arbitrary string to the path, like /share/I2cD5Vvw/anything. Also i think we should omit the root directory from the url.

Abitratry path can be detected in the backend, I don't think that's an issue, normal user won't bother changing url by hand.

The root directory potion is automatically filled. It's actually essential. According to this comment. Say we share a directory a, there are dir a, b, c below it. When a request for /api/public/dl/hash/a came, which a is it, the root a or a below it, removing the trailing filename would fix it, but that leads to ugly download url a/a, 1.mp4/mp4. I did it in the previous commit. Also this means err check can't distinguish between two file with same name.

If root directory is only not shown in the address bar, there is quite a lot to do when someone use the subdirectory url to access the subdirectory, thanks to this comment. Not appending filename when downloading can fix them pretty easily.

I think if root directory name is a thing, it can be checked. And normally user won't bother tickering with urls.

@ramiresviana
Copy link
Contributor

I see 2 ways to resolve the info panel issue:

  1. Update the icon, displayName, lastModified, size, downloadButton and qrcode when selecting an item. Also the panel should have a different state for multiple selections, showing only number of selected items and total size.
  2. The panel will show only the information of the current directory/file. Downloading selected items is done by clicking on a button on the header bar, similar to the normal Filebrowser listing.

@@ -49,6 +49,17 @@
</button>
</div>
</template>
<template v-if="isSharing">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of creating a whole new dropdown, lets use the v-show directive on the wanted elements.

<div class="dropdown" :class="{ active: showMore }">
<download-button v-if="sharedSelectedCount > 0"></download-button>

<button @click="toggleSharedMultipleSelection" :aria-label="$t('buttons.selectMultiple')" :title="$t('buttons.selectMultiple')" class="action" >
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we reuse the existing selection toggle and download buttons?

@@ -26,6 +26,9 @@ const state = {
showConfirm: null,
previewMode: false,
shared: {
req: {},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can reuse the current existing state properties. Also you can make the hash work as a getter using only the req state.

@o1egl o1egl mentioned this pull request Dec 24, 2020
@o1egl o1egl merged commit fb5b28d into filebrowser:master Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

some suggestions
3 participants