diff --git a/owrx/controllers/api.py b/owrx/controllers/api.py index 4e7a966..60bb74f 100644 --- a/owrx/controllers/api.py +++ b/owrx/controllers/api.py @@ -1,5 +1,6 @@ from . import Controller from owrx.feature import FeatureDetector +from owrx.config import Config import json @@ -7,3 +8,15 @@ class ApiController(Controller): def indexAction(self): data = json.dumps(FeatureDetector().feature_report()) self.send_response(data, content_type="application/json") + + def receiverDetails(self): + receiver_details = Config.get().filter( + "receiver_name", + "receiver_location", + "receiver_asl", + "receiver_gps", + "photo_title", + "photo_desc", + ) + data = json.dumps(receiver_details.__dict__()) + self.send_response(data, content_type="application/json") diff --git a/owrx/http.py b/owrx/http.py index 39e2bdf..8381646 100644 --- a/owrx/http.py +++ b/owrx/http.py @@ -101,6 +101,7 @@ class Router(object): StaticRoute("/map", MapController), StaticRoute("/features", FeatureController), StaticRoute("/api/features", ApiController), + StaticRoute("/api/receiverdetails", ApiController, options={"action": "receiverDetails"}), StaticRoute("/metrics", MetricsController), StaticRoute("/settings", SettingsController), StaticRoute("/generalsettings", GeneralSettingsController),