mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 14:27:42 +00:00
Bug fixes
This commit is contained in:
@@ -45,7 +45,7 @@ def get_sig_ref_info(sig, ref_id):
|
|||||||
sig_ref.name = sig_ref.id
|
sig_ref.name = sig_ref.id
|
||||||
if not sig_ref.grid:
|
if not sig_ref.grid:
|
||||||
sig_ref.grid = sig_ref.id
|
sig_ref.grid = sig_ref.id
|
||||||
if sig_ref.grid and not sig_ref.latitude:
|
if sig_ref.grid and (not sig_ref.latitude or not sig_ref.longitude):
|
||||||
ll = locator_to_latlong(str(sig_ref.grid))
|
ll = locator_to_latlong(str(sig_ref.grid))
|
||||||
sig_ref.latitude = ll[0]
|
sig_ref.latitude = ll[0]
|
||||||
sig_ref.longitude = ll[1]
|
sig_ref.longitude = ll[1]
|
||||||
|
|||||||
+6
-6
@@ -307,7 +307,7 @@ class Spot:
|
|||||||
# If the spot itself doesn't have location yet, but the SIG ref does, extract it
|
# If the spot itself doesn't have location yet, but the SIG ref does, extract it
|
||||||
if sig_ref.grid and not self.dx_grid:
|
if sig_ref.grid and not self.dx_grid:
|
||||||
self.dx_grid = sig_ref.grid
|
self.dx_grid = sig_ref.grid
|
||||||
if sig_ref.latitude and not self.dx_latitude:
|
if sig_ref.latitude and not self.dx_latitude and sig_ref.longitude and not self.dx_longitude:
|
||||||
self.dx_latitude = sig_ref.latitude
|
self.dx_latitude = sig_ref.latitude
|
||||||
self.dx_longitude = sig_ref.longitude
|
self.dx_longitude = sig_ref.longitude
|
||||||
if self.sig == "WAB" or self.sig == "WAI" or self.sig == "Tiles":
|
if self.sig == "WAB" or self.sig == "WAI" or self.sig == "Tiles":
|
||||||
@@ -360,7 +360,7 @@ class Spot:
|
|||||||
self.de_grid = grid_mode_grid_match.group(2).upper()
|
self.de_grid = grid_mode_grid_match.group(2).upper()
|
||||||
|
|
||||||
# DX Grid to lat/lon and vice versa in case one is missing
|
# DX Grid to lat/lon and vice versa in case one is missing
|
||||||
if self.dx_grid and not self.dx_latitude:
|
if self.dx_grid and (not self.dx_latitude or not self.dx_longitude):
|
||||||
try:
|
try:
|
||||||
ll = locator_to_latlong(self.dx_grid)
|
ll = locator_to_latlong(self.dx_grid)
|
||||||
self.dx_latitude = ll[0]
|
self.dx_latitude = ll[0]
|
||||||
@@ -393,7 +393,7 @@ class Spot:
|
|||||||
# instead of the one from the park reference they're at.
|
# instead of the one from the park reference they're at.
|
||||||
if self.dx_call and not self.dx_name:
|
if self.dx_call and not self.dx_name:
|
||||||
self.dx_name = dx_call_info.name
|
self.dx_name = dx_call_info.name
|
||||||
if self.dx_call and not self.dx_latitude:
|
if self.dx_call and (not self.dx_latitude or not self.dx_longitude):
|
||||||
self.dx_latitude = dx_call_info.latitude
|
self.dx_latitude = dx_call_info.latitude
|
||||||
self.dx_longitude = dx_call_info.longitude
|
self.dx_longitude = dx_call_info.longitude
|
||||||
self.dx_grid = dx_call_info.grid
|
self.dx_grid = dx_call_info.grid
|
||||||
@@ -411,12 +411,12 @@ class Spot:
|
|||||||
|
|
||||||
# CQ and ITU zone lookup, preferably from location but failing that, from callsign
|
# CQ and ITU zone lookup, preferably from location but failing that, from callsign
|
||||||
if not self.dx_cq_zone:
|
if not self.dx_cq_zone:
|
||||||
if self.dx_latitude:
|
if self.dx_latitude and self.dx_longitude:
|
||||||
self.dx_cq_zone = lat_lon_to_cq_zone(self.dx_latitude, self.dx_longitude)
|
self.dx_cq_zone = lat_lon_to_cq_zone(self.dx_latitude, self.dx_longitude)
|
||||||
elif self.dx_call:
|
elif self.dx_call:
|
||||||
self.dx_cq_zone = dx_call_info.cq_zone
|
self.dx_cq_zone = dx_call_info.cq_zone
|
||||||
if not self.dx_itu_zone:
|
if not self.dx_itu_zone:
|
||||||
if self.dx_latitude:
|
if self.dx_latitude and self.dx_longitude:
|
||||||
self.dx_itu_zone = lat_lon_to_itu_zone(self.dx_latitude, self.dx_longitude)
|
self.dx_itu_zone = lat_lon_to_itu_zone(self.dx_latitude, self.dx_longitude)
|
||||||
elif self.dx_call:
|
elif self.dx_call:
|
||||||
self.dx_itu_zone = dx_call_info.itu_zone
|
self.dx_itu_zone = dx_call_info.itu_zone
|
||||||
@@ -439,7 +439,7 @@ class Spot:
|
|||||||
self.de_call
|
self.de_call
|
||||||
and any(char.isdigit() for char in str(self.de_call))
|
and any(char.isdigit() for char in str(self.de_call))
|
||||||
and not (self.de_call.startswith("T2") and self.source == "APRS-IS")
|
and not (self.de_call.startswith("T2") and self.source == "APRS-IS")
|
||||||
and not self.de_latitude
|
and (not self.de_latitude or not self.de_longitude)
|
||||||
):
|
):
|
||||||
# DE operator location lookup
|
# DE operator location lookup
|
||||||
self.de_latitude = de_call_info.latitude
|
self.de_latitude = de_call_info.latitude
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import tornado
|
import tornado
|
||||||
from tornado.httpclient import AsyncHTTPClient
|
from tornado.httpclient import AsyncHTTPClient
|
||||||
from tornado.httputil import HTTPHeaders
|
from tornado.httputil import HTTPHeaders
|
||||||
|
from tornado.iostream import StreamClosedError
|
||||||
|
|
||||||
|
|
||||||
class V1RedirectHandler(tornado.web.RequestHandler):
|
class V1RedirectHandler(tornado.web.RequestHandler):
|
||||||
@@ -43,7 +44,6 @@ class V1RedirectHandler(tornado.web.RequestHandler):
|
|||||||
self.add_header(name, value)
|
self.add_header(name, value)
|
||||||
if response.body:
|
if response.body:
|
||||||
self.write(response.body)
|
self.write(response.body)
|
||||||
await self.finish()
|
|
||||||
|
|
||||||
async def get(self, path):
|
async def get(self, path):
|
||||||
await self._proxy(path)
|
await self._proxy(path)
|
||||||
|
|||||||
+9
-1
@@ -155,7 +155,15 @@ class WebServer:
|
|||||||
V1APISpotsStreamHandler,
|
V1APISpotsStreamHandler,
|
||||||
{"sse_spot_broadcaster": self._spot_broadcaster, **handler_opts},
|
{"sse_spot_broadcaster": self._spot_broadcaster, **handler_opts},
|
||||||
),
|
),
|
||||||
(r"/api/v1/spot", V1APISpotHandler),
|
(
|
||||||
|
r"/api/v1/spot",
|
||||||
|
V1APISpotHandler,
|
||||||
|
{
|
||||||
|
"spots": self._data_store.spots,
|
||||||
|
"spot_providers": self._data_providers,
|
||||||
|
**handler_opts,
|
||||||
|
},
|
||||||
|
),
|
||||||
(r"/api/v1/(.*)", V1RedirectHandler),
|
(r"/api/v1/(.*)", V1RedirectHandler),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/add-spot.js?v=1786868765"></script>
|
<script src="/static/js/add-spot.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-add-spot").addClass("active");
|
$("#nav-link-add-spot").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -84,7 +84,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/alerts.js?v=1786868765"></script>
|
<script src="/static/js/alerts.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-alerts").addClass("active");
|
$("#nav-link-alerts").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -76,8 +76,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786868765"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786885342"></script>
|
||||||
<script src="/static/js/bands.js?v=1786868765"></script>
|
<script src="/static/js/bands.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-bands").addClass("active");
|
$("#nav-link-bands").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{% extends "skeleton.html" %}
|
{% extends "skeleton.html" %}
|
||||||
{% block head_extra %}
|
{% block head_extra %}
|
||||||
<link rel="stylesheet" href="/static/css/style.css?v=1786868765" type="text/css">
|
<link rel="stylesheet" href="/static/css/style.css?v=1786885342" type="text/css">
|
||||||
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/bootstrap-5.3.8.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/fontawesome-6.7.2.min.css" rel="stylesheet">
|
||||||
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
<link href="/static/vendor/css/solid-6.7.2.min.css" rel="stylesheet">
|
||||||
@@ -15,10 +15,10 @@
|
|||||||
window.fetchEventSource = fetchEventSource;
|
window.fetchEventSource = fetchEventSource;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script src="/static/js/utils.js?v=1786868765"></script>
|
<script src="/static/js/utils.js?v=1786885342"></script>
|
||||||
<script src="/static/js/ui-ham.js?v=1786868765"></script>
|
<script src="/static/js/ui-ham.js?v=1786885342"></script>
|
||||||
<script src="/static/js/geo.js?v=1786868765"></script>
|
<script src="/static/js/geo.js?v=1786885342"></script>
|
||||||
<script src="/static/js/common.js?v=1786868765"></script>
|
<script src="/static/js/common.js?v=1786885342"></script>
|
||||||
{% end %}
|
{% end %}
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -284,7 +284,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
<script src="/static/vendor/js/chart-4.4.9.umd.min.js"></script>
|
||||||
<script src="/static/js/conditions.js?v=1786868765"></script>
|
<script src="/static/js/conditions.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-conditions").addClass("active");
|
$("#nav-link-conditions").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
+2
-2
@@ -109,8 +109,8 @@
|
|||||||
<script src="/static/vendor/js/leaflet-cqzones.js"></script>
|
<script src="/static/vendor/js/leaflet-cqzones.js"></script>
|
||||||
<script src="/static/vendor/js/leaflet-workedallbritainireland.js" type="module"></script>
|
<script src="/static/vendor/js/leaflet-workedallbritainireland.js" type="module"></script>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786868765"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786885342"></script>
|
||||||
<script src="/static/js/map.js?v=1786868765"></script>
|
<script src="/static/js/map.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-map").addClass("active");
|
$("#nav-link-map").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -113,8 +113,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/spotsbandsandmap.js?v=1786868765"></script>
|
<script src="/static/js/spotsbandsandmap.js?v=1786885342"></script>
|
||||||
<script src="/static/js/spots.js?v=1786868765"></script>
|
<script src="/static/js/spots.js?v=1786885342"></script>
|
||||||
<script>$(document).ready(function () {
|
<script>$(document).ready(function () {
|
||||||
$("#nav-link-spots").addClass("active");
|
$("#nav-link-spots").addClass("active");
|
||||||
}); <!-- highlight active page in nav --></script>
|
}); <!-- highlight active page in nav --></script>
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="/static/js/status.js?v=1786868765"></script>
|
<script src="/static/js/status.js?v=1786885342"></script>
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$("#nav-link-status").addClass("active");
|
$("#nav-link-status").addClass("active");
|
||||||
|
|||||||
Reference in New Issue
Block a user