-
-
Notifications
You must be signed in to change notification settings - Fork 562
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
Restore Teleporter functionality #2738
Conversation
…aniuse.com/url tells us it can be used iny any sufficiently recent browser except IE and Opera Mini Signed-off-by: DL6ER <[email protected]>
… response header Signed-off-by: DL6ER <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. However, while my header is attachment; filename="pi-hole_nanopi_teleporter_2023-10-12_22-19-38.zip"
, my suggested file name is _pi-hole_nanopi_teleporter_2023-10-12_22-19-38.zip_
.
See the leading and trainling _
This is happening because the quotes are part of the string and they are replaced by |
When the button is clicked, the API sends a payload containing the zip file. To download the file, code creates a "fake" link, triggers a Click event and removes the link after the download. This is how the link looks like: <a href="blob:http://192.168.0.20…-a302fce919ff" download='"pi-hole_pidev_teleporter_2023-10-16_23-54-13.zip"'> (The value of Each browser deals with these quotes in slightly different ways:
I didn't test other browsers. These are the Response Headers received:
Do we need to send the filename with quotes and remove them on the javascript? Or can we send it without quotes? Can we use this? snprintf(pi_hole_extra_headers, sizeof(pi_hole_extra_headers),
"Content-Disposition: attachment; filename=%s",
filename); |
Signed-off-by: DL6ER <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The final messages says
Import successful
Processed files:
/etc/pihole/pihole.toml
/etc/pihole/dhcp.leases
/etc/pihole/gravity.db
However, it's not gravity.db that have been restored by only the lists, clients, groups,.... We may need to add a hint that users should run pihole -g
.
What does this implement/fix?
Restore Teleporter functionality. Concerning compatibility, https://caniuse.com/url tells us it can be used in any sufficiently recent browser except IE and Opera Mini. If you have a better approach, I'd love to see it.
Related issue or feature (if applicable): N/A
Pull request in docs with documentation (if applicable): N/A
By submitting this pull request, I confirm the following:
git rebase
)Checklist:
developmental
branch.