1
0
mirror of https://github.com/craigerl/aprsd.git synced 2024-12-18 23:55:58 -05:00

Webchat Send Beacon uses Path selected in UI

This patch changes the Send Beacon button capability in
webchat to use the path selected in the UI for the
actual beacon being sent out.
This commit is contained in:
Hemna 2024-04-17 12:34:01 -04:00
parent 88d26241f5
commit 4c7e27c88b
2 changed files with 12 additions and 1 deletions

View File

@ -543,6 +543,14 @@ class SendMessageNamespace(Namespace):
long = data["longitude"]
LOG.debug(f"Lat {lat}")
LOG.debug(f"Long {long}")
path = data.get("path", None)
if not path:
path = []
elif "," in path:
path_opts = path.split(",")
path = [x.strip() for x in path_opts]
else:
path = [path]
tx.send(
packets.BeaconPacket(
@ -551,6 +559,7 @@ class SendMessageNamespace(Namespace):
latitude=lat,
longitude=long,
comment="APRSD WebChat Beacon",
path=path,
),
direct=True,
)

View File

@ -64,9 +64,11 @@ function showError(error) {
function showPosition(position) {
console.log("showPosition Called");
path = $('#pkt_path option:selected').val();
msg = {
'latitude': position.coords.latitude,
'longitude': position.coords.longitude
'longitude': position.coords.longitude,
'path': path,
}
console.log(msg);
$.toast({