diff --git a/server/handlers/api/options.py b/server/handlers/api/options.py index 7b194ca..ee481d4 100644 --- a/server/handlers/api/options.py +++ b/server/handlers/api/options.py @@ -8,7 +8,7 @@ from tornado import httputil from tornado.web import Application from core.config import MAX_SPOT_AGE, ALLOW_SPOTTING -from core.constants import BANDS, ALL_MODES, MODE_TYPES, SIGS, CONTINENTS +from core.constants import BANDS, ALL_MODES, MODE_TYPES, SIGS, CONTINENTS, PROPAGATION_MODES from core.prometheus_metrics_handler import api_requests_counter from core.utils import serialize_everything @@ -61,6 +61,7 @@ class APIOptionsHandler(tornado.web.RequestHandler): "spot_sources": spot_sources, "alert_sources": alert_sources, "continents": CONTINENTS, + "propagation_modes": PROPAGATION_MODES.values(), "max_spot_age": MAX_SPOT_AGE, "spot_allowed": ALLOW_SPOTTING, "spot_submit_providers": spot_submit_providers} diff --git a/spotproviders/gma.py b/spotproviders/gma.py index 488ca22..1ef225a 100644 --- a/spotproviders/gma.py +++ b/spotproviders/gma.py @@ -19,13 +19,15 @@ class GMA(HTTPSpotProvider): REF_INFO_URL_ROOT = "https://www.cqgma.org/api/ref/?" def __init__(self, provider_config): - # Ensure there is an API key in our config, and set up the query URL using it + # Ensure there is an API key in our config, and set up the query URL using it. If no key is provided, + # disable this spot provider. self.api_key = provider_config.get("api-key", "") - if self.api_key != "": - super().__init__(provider_config, self.SPOTS_URL + "?key=" + self.api_key, self.POLL_INTERVAL_SEC) - else: + if self.api_key == "": + provider_config["enabled"] = False logging.warning("GMA spot provider configured but no api key was provided, this API will not be queried.") + super().__init__(provider_config, self.SPOTS_URL + "?key=" + self.api_key, self.POLL_INTERVAL_SEC) + def _http_response_to_spots(self, http_response): new_spots = [] # Iterate through source data diff --git a/templates/add_spot.html b/templates/add_spot.html index 249f140..9090336 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 3d40888..1b0cfa5 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -75,7 +75,7 @@ - + diff --git a/templates/bands.html b/templates/bands.html index 2b5582a..21577d0 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -77,8 +77,8 @@ - - + + diff --git a/templates/base.html b/templates/base.html index b03764a..4537825 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,6 +1,6 @@ {% extends "skeleton.html" %} {% block head_extra %} - + @@ -10,10 +10,10 @@ - - - - + + + + {% end %} {% block body %}