From 9942b3baf2a90a103f7330be59cd12a3e719100d Mon Sep 17 00:00:00 2001 From: Jakob Ketterl Date: Sat, 25 Apr 2020 21:55:52 +0200 Subject: [PATCH] separate page for sdr settings --- htdocs/generalsettings.html | 2 +- htdocs/sdrsettings.html | 20 ++++++++++++++++++++ owrx/controllers/settings.py | 5 +++++ owrx/http.py | 3 ++- 4 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 htdocs/sdrsettings.html diff --git a/htdocs/generalsettings.html b/htdocs/generalsettings.html index 54e8fe4..edd52e7 100644 --- a/htdocs/generalsettings.html +++ b/htdocs/generalsettings.html @@ -14,7 +14,7 @@ ${header}
-

Settings

+

General settings

${sections}
diff --git a/htdocs/sdrsettings.html b/htdocs/sdrsettings.html new file mode 100644 index 0000000..0cb8ec4 --- /dev/null +++ b/htdocs/sdrsettings.html @@ -0,0 +1,20 @@ + + + + OpenWebRX Settings + + + + + + + + + +${header} +
+
+

SDR device settings

+
+
+ \ No newline at end of file diff --git a/owrx/controllers/settings.py b/owrx/controllers/settings.py index 8f5e11e..6934bf7 100644 --- a/owrx/controllers/settings.py +++ b/owrx/controllers/settings.py @@ -48,6 +48,11 @@ class SettingsController(AdminController): self.serve_template("settings.html", **self.template_variables()) +class SdrSettingsController(AdminController): + def indexAction(self): + self.serve_template("sdrsettings.html", **self.template_variables()) + + class GeneralSettingsController(AdminController): sections = [ Section( diff --git a/owrx/http.py b/owrx/http.py index b8ec63c..f7203a5 100644 --- a/owrx/http.py +++ b/owrx/http.py @@ -11,7 +11,7 @@ from owrx.controllers.assets import ( from owrx.controllers.websocket import WebSocketController from owrx.controllers.api import ApiController from owrx.controllers.metrics import MetricsController -from owrx.controllers.settings import SettingsController, GeneralSettingsController +from owrx.controllers.settings import SettingsController, GeneralSettingsController, SdrSettingsController from owrx.controllers.session import SessionController from http.server import BaseHTTPRequestHandler from urllib.parse import urlparse, parse_qs @@ -103,6 +103,7 @@ class Router(object): StaticRoute("/settings", SettingsController), StaticRoute("/generalsettings", GeneralSettingsController), StaticRoute("/generalsettings", GeneralSettingsController, method="POST", options={"action": "processFormData"}), + StaticRoute("/sdrsettings", SdrSettingsController), StaticRoute("/login", SessionController, options={"action": "loginAction"}), StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}), StaticRoute("/logout", SessionController, options={"action": "logoutAction"}),