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 & directory deletion feature #1093

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cyqsimon
Copy link
Contributor

@cyqsimon cyqsimon commented Apr 3, 2023

Closes #397.

Todo

  • CLI options
  • Backend API
  • Frontend controls
  • Tests

@cyqsimon
Copy link
Contributor Author

cyqsimon commented Apr 3, 2023

miniserve/src/main.rs

Lines 329 to 330 in 82dd826

// Allow file upload
app.service(web::resource("/upload").route(web::post().to(file_upload::upload_file)));

I am curious why the upload feature is implemented like so. I guess it's good for unforeseen future extensibility, but there is semantic duplication between the /upload endpoint and the POST method.

The real question I want to ask, is should I implement the deletion feature in a similar manner? I.e. something like this:

app.service(web::resource("/delete").route(web::delete().to(file_rm::rm_file)));

@svenstaro
Copy link
Owner

Are you suggesting it might have been better to just have POST always try to upload stuff? It would be simpler for sure but as you are saying, it's not great if we ever want a second POST for something. I think this is currently an ok compromise.

I see how this is a bit of a conundrum with delete. I also want to add WebDAV at some point and that will introduce even more semantics. Perhaps it's the best to go with what you suggested just now and eat the semantic duplication for the time being. It's not like it can't be changed later.

@bgusach
Copy link

bgusach commented Aug 25, 2023

Hi,

unfortunately I can't directly help... just wanted to say that I appreciate the effort and if it gets done at some point, my life would be somehow better :)

@cyqsimon
Copy link
Contributor Author

Hi,

unfortunately I can't directly help... just wanted to say that I appreciate the effort and if it gets done at some point, my life would be somehow better :)

Thanks for reminding me. I have too many things on hand and honestly just forgot about this whole matter. I will find some time to work on it this week, hopefully.

Comment on lines +287 to +290
td.actions-cell .rm_form button {
background: var(--rm_button_background);
color: var(--rm_button_text_color);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I suck at visual design. So any styling improvement suggestion is welcomed.

@cyqsimon
Copy link
Contributor Author

cyqsimon commented Jan 29, 2024

Rebased on #1331.

@cyqsimon
Copy link
Contributor Author

Rebased on master.

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.

How about add "delete file" feature?
3 participants