From fb90a4e54bacff5160be34ea06a2146a99214f1f Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sun, 26 Apr 2020 02:15:19 +0200 Subject: [PATCH] display sdr devices --- htdocs/css/admin.css | 4 ++++ htdocs/sdrsettings.html | 3 +++ owrx/controllers/settings.py | 19 +++++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/htdocs/css/admin.css b/htdocs/css/admin.css index 8836244..fa2b020 100644 --- a/htdocs/css/admin.css +++ b/htdocs/css/admin.css @@ -18,3 +18,7 @@ body { .row .map-input { margin: 15px 15px 0; } + +.device { + margin-top: 20px; +} diff --git a/htdocs/sdrsettings.html b/htdocs/sdrsettings.html index 0cb8ec4..51de0f0 100644 --- a/htdocs/sdrsettings.html +++ b/htdocs/sdrsettings.html @@ -16,5 +16,8 @@ ${header}

SDR device settings

+
+ ${devices} +
\ No newline at end of file diff --git a/owrx/controllers/settings.py b/owrx/controllers/settings.py index 6934bf7..7a219e3 100644 --- a/owrx/controllers/settings.py +++ b/owrx/controllers/settings.py @@ -49,6 +49,25 @@ class SettingsController(AdminController): class SdrSettingsController(AdminController): + def template_variables(self): + variables = super().template_variables() + variables["devices"] = self.render_devices() + return variables + + def render_devices(self): + def render_devicde(device_id, config): + return """ +
+
+ {device_name} +
+
+ device settings go here +
+
+ """.format(device_name=config["name"]) + return "".join(render_devicde(key, value) for key, value in Config.get()["sdrs"].items()) + def indexAction(self): self.serve_template("sdrsettings.html", **self.template_variables())