diff --git a/server/handlers/api/dxstats.py b/server/handlers/api/dxstats.py index 67519d8..b4d479f 100644 --- a/server/handlers/api/dxstats.py +++ b/server/handlers/api/dxstats.py @@ -9,6 +9,7 @@ import tornado from tornado import httputil from tornado.web import Application +from core.constants import BANDS from core.enums import Continent from core.prometheus_metrics_handler import api_requests_counter from core.utils import safe_json_dumps @@ -16,7 +17,7 @@ from core.utils import safe_json_dumps logger = logging.getLogger(__name__) CONTINENTS = [c.value for c in Continent] -BANDS = ["160m", "80m", "60m", "40m", "30m", "20m", "17m", "15m", "12m", "10m", "6m"] +HF_BANDS = [b.name for b in BANDS if b.is_ham_hf] class APIDxStatsHandler(tornado.web.RequestHandler): @@ -52,11 +53,11 @@ class APIDxStatsHandler(tornado.web.RequestHandler): continue if not spot.time or spot.time < one_hour_ago: continue - if spot.de_continent in CONTINENTS and spot.dx_continent in CONTINENTS and spot.band in BANDS: + if spot.de_continent in CONTINENTS and spot.dx_continent in CONTINENTS and spot.band in HF_BANDS: counts[spot.de_continent, spot.dx_continent, spot.band] += 1 result = { - de: {dx: {band: counts[de, dx, band] for band in BANDS} for dx in CONTINENTS} for de in CONTINENTS + de: {dx: {band: counts[de, dx, band] for band in HF_BANDS} for dx in CONTINENTS} for de in CONTINENTS } self.write(json.dumps(result)) diff --git a/templates/add_spot.html b/templates/add_spot.html index 0d5fd55..6f76b99 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -76,7 +76,7 @@ - + diff --git a/templates/alerts.html b/templates/alerts.html index 789b6ab..8def2e5 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -84,7 +84,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index aa63a5b..c5bfb6c 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -76,8 +76,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index 7c1edea..e22274e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -15,10 +15,10 @@ window.fetchEventSource = fetchEventSource; - - - - + + + + {% end %} {% block body %}