enable web config

This commit is contained in:
Jakob Ketterl 2021-02-11 19:37:45 +01:00
parent f23fa59ac3
commit a8c93fd8d1
4 changed files with 2 additions and 17 deletions

View File

@ -375,8 +375,3 @@ pskreporter_callsign = "N0CALL"
# in addition to these settings also make sure that receiver_gps contains your correct location
wsprnet_enabled = False
wsprnet_callsign = "N0CALL"
# === Web admin settings ===
# this feature is experimental at the moment. it should not be enabled on shared receivers since it allows remote
# changes to the receiver settings. enable for testing in controlled environment only.
# webadmin_enabled = False

View File

@ -11,7 +11,7 @@
<div class="button" data-toggle-panel="openwebrx-panel-log"><span class="sprite sprite-panel-log"></span><br/>Log</div>
<div class="button" data-toggle-panel="openwebrx-panel-receiver"><span class="sprite sprite-panel-receiver"></span><br/>Receiver</div>
<a class="button" href="map" target="openwebrx-map"><span class="sprite sprite-panel-map"></span><br/>Map</a>
${settingslink}
<a class="button" href="settings" target="openwebrx-settings"><span class="sprite sprite-panel-settings"></span><br/>Settings</a>
</section>
</div>
<div class="openwebrx-description-container">

View File

@ -1,5 +1,4 @@
from .session import SessionStorage
from owrx.config import Config
from owrx.users import UserList
from urllib import parse
@ -34,10 +33,6 @@ class AuthorizationMixin(object):
return self.user is not None and self.user.is_enabled() and not self.user.must_change_password
def handle_request(self):
config = Config.get()
if "webadmin_enabled" not in config or not config["webadmin_enabled"]:
self.send_response("Web Admin is disabled", code=403)
return
if self.isAuthorized():
super().handle_request()
else:

View File

@ -1,7 +1,6 @@
from . import Controller
import pkg_resources
from string import Template
from owrx.config import Config
class TemplateController(Controller):
@ -20,11 +19,7 @@ class TemplateController(Controller):
class WebpageController(TemplateController):
def template_variables(self):
settingslink = ""
pm = Config.get()
if "webadmin_enabled" in pm and pm["webadmin_enabled"]:
settingslink = """<a class="button" href="settings" target="openwebrx-settings"><span class="sprite sprite-panel-settings"></span><br/>Settings</a>"""
header = self.render_template("include/header.include.html", settingslink=settingslink)
header = self.render_template("include/header.include.html")
return {"header": header}