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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[file-server] Add "from" parameter to browse complementary to "limit" #3542

Merged
merged 10 commits into from
Jul 9, 2020

Conversation

cceyda
Copy link
Contributor

@cceyda cceyda commented Jul 2, 2020

A simple update to the browse functionality within the file-server

  • Added an optional from URL parameter complementary to the existing limit parameter.

Use case -> To efficiently browse folders with many... many... files

Usage

caddy file-server --listen 8000 --browse

http://localhost:8000/browse
Shows all files

http://localhost:8000/browse?limit=10
Shows only files 10 files starting from 0

http://localhost:8000/browse?limit=10&from=5
Shows only files 10 files starting from 5

@CLAassistant
Copy link

CLAassistant commented Jul 2, 2020

CLA assistant check
All committers have signed the CLA.

@francislavoie
Copy link
Member

I think offset would be better than from.

@mholt
Copy link
Member

mholt commented Jul 6, 2020

Thanks for the PR! I'll try to give it a pass soon.

@cceyda
Copy link
Contributor Author

cceyda commented Jul 7, 2020

I think offset would be better than from.

that's reasonable too, should I change it?

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM! Except changing to offset sounds like a good idea. Although "from" isn't bad, "offset" makes a little more sense I think.

modules/caddyhttp/fileserver/browse.go Outdated Show resolved Hide resolved
modules/caddyhttp/fileserver/browselisting.go Outdated Show resolved Hide resolved
modules/caddyhttp/fileserver/browselisting.go Outdated Show resolved Hide resolved
snu-ceyda and others added 5 commits July 9, 2020 13:01
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
change from -> offset
Copy link
Contributor Author

@cceyda cceyda left a comment

Choose a reason for hiding this comment

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

looks good

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

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

Cool, thanks!

@mholt mholt added this to the v2.2.0 milestone Jul 9, 2020
@mholt mholt merged commit 735c866 into caddyserver:master Jul 9, 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.

4 participants