added export gpx

This commit is contained in:
TheFozid 2026-08-03 20:14:22 +01:00
parent fff8a8382b
commit 9962a6932d
3 changed files with 14 additions and 2 deletions

2
Cargo.lock generated
View file

@ -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",

View file

@ -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]

View file

@ -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);
}); });
} }