added export gpx
This commit is contained in:
parent
fff8a8382b
commit
9962a6932d
3 changed files with 14 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -1590,7 +1590,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rs_maps"
|
name = "rs_maps"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"argon2",
|
"argon2",
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# Cargo.toml
|
# Cargo.toml
|
||||||
[package]
|
[package]
|
||||||
name = "rs_maps"
|
name = "rs_maps"
|
||||||
version = "0.3.3"
|
version = "0.3.4"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -1110,6 +1110,18 @@ async function loadGpxList() {
|
||||||
edit.addEventListener('click', () => editRoute(f.name));
|
edit.addEventListener('click', () => editRoute(f.name));
|
||||||
li.appendChild(edit);
|
li.appendChild(edit);
|
||||||
|
|
||||||
|
// A plain anchor rather than a fetch-and-blob: same-origin navigation
|
||||||
|
// carries the session cookie, and the browser handles the save dialog,
|
||||||
|
// resumability and large files without any of it passing through JS.
|
||||||
|
const download = document.createElement('a');
|
||||||
|
download.className = 'link';
|
||||||
|
download.textContent = 'Download';
|
||||||
|
download.href = 'api/gpx/file/' + encodeURIComponent(f.name);
|
||||||
|
// Without an explicit filename the browser would name it after the URL's
|
||||||
|
// last segment, which is percent-encoded.
|
||||||
|
download.download = f.name;
|
||||||
|
li.appendChild(download);
|
||||||
|
|
||||||
list.appendChild(li);
|
list.appendChild(li);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue