re-route settings urls
This commit is contained in:
parent
ae76470612
commit
cda43b5c5c
@ -1,7 +1,7 @@
|
|||||||
<div class="webrx-top-container">
|
<div class="webrx-top-container">
|
||||||
<div class="webrx-top-bar">
|
<div class="webrx-top-bar">
|
||||||
<a href="https://www.openwebrx.de/" target="_blank"><img src="static/gfx/openwebrx-top-logo.png" class="webrx-top-logo" alt="OpenWebRX Logo"/></a>
|
<a href="https://www.openwebrx.de/" target="_blank"><img src="${assets_prefix}static/gfx/openwebrx-top-logo.png" class="webrx-top-logo" alt="OpenWebRX Logo"/></a>
|
||||||
<img class="webrx-rx-avatar openwebrx-photo-trigger" src="static/gfx/openwebrx-avatar.png" alt="Receiver avatar"/>
|
<img class="webrx-rx-avatar openwebrx-photo-trigger" src="${assets_prefix}static/gfx/openwebrx-avatar.png" alt="Receiver avatar"/>
|
||||||
<div class="webrx-rx-texts openwebrx-photo-trigger">
|
<div class="webrx-rx-texts openwebrx-photo-trigger">
|
||||||
<div class="webrx-rx-title"></div>
|
<div class="webrx-rx-title"></div>
|
||||||
<div class="webrx-rx-desc"></div>
|
<div class="webrx-rx-desc"></div>
|
||||||
@ -10,8 +10,8 @@
|
|||||||
<div class="button" data-toggle-panel="openwebrx-panel-status"><span class="sprite sprite-panel-status"></span><br/>Status</div>
|
<div class="button" data-toggle-panel="openwebrx-panel-status"><span class="sprite sprite-panel-status"></span><br/>Status</div>
|
||||||
<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-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>
|
<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>
|
<a class="button" href="${assets_prefix}map" target="openwebrx-map"><span class="sprite sprite-panel-map"></span><br/>Map</a>
|
||||||
<a class="button" href="settings" target="openwebrx-settings"><span class="sprite sprite-panel-settings"></span><br/>Settings</a>
|
<a class="button" href="${assets_prefix}settings" target="openwebrx-settings"><span class="sprite sprite-panel-settings"></span><br/>Settings</a>
|
||||||
</section>
|
</section>
|
||||||
</div>
|
</div>
|
||||||
<div class="openwebrx-description-container">
|
<div class="openwebrx-description-container">
|
||||||
|
@ -58,7 +58,8 @@ Header.prototype.toggle_rx_photo = function(ev) {
|
|||||||
|
|
||||||
Header.prototype.download_details = function() {
|
Header.prototype.download_details = function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
$.ajax('api/receiverdetails').done(function(data){
|
// TODO: make this use a relative URL again
|
||||||
|
$.ajax('/api/receiverdetails').done(function(data){
|
||||||
self.setDetails(data);
|
self.setDetails(data);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1,21 +0,0 @@
|
|||||||
<!DOCTYPE HTML>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>OpenWebRX Settings</title>
|
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico" />
|
|
||||||
<link rel="stylesheet" href="static/css/bootstrap.min.css" />
|
|
||||||
<link rel="stylesheet" type="text/css" href="static/css/admin.css" />
|
|
||||||
<script src="compiled/settings.js"></script>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
${header}
|
|
||||||
<div class="container">
|
|
||||||
<div class="col-12">
|
|
||||||
<h1>SDR device settings</h1>
|
|
||||||
</div>
|
|
||||||
<div class="col-12">
|
|
||||||
${devices}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
@ -15,10 +15,10 @@ ${header}
|
|||||||
<h1>Settings</h1>
|
<h1>Settings</h1>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a href="generalsettings">General settings</a>
|
<a href="settings/general">General settings</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a href="sdrsettings">SDR device settings</a>
|
<a href="settings/sdr">SDR device settings</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<a href="features">Feature report</a>
|
<a href="features">Feature report</a>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>OpenWebRX Settings</title>
|
<title>OpenWebRX Settings</title>
|
||||||
<link rel="shortcut icon" type="image/x-icon" href="static/favicon.ico" />
|
<link rel="shortcut icon" type="image/x-icon" href="../static/favicon.ico" />
|
||||||
<link rel="stylesheet" href="static/css/bootstrap.min.css" />
|
<link rel="stylesheet" href="../static/css/bootstrap.min.css" />
|
||||||
<link rel="stylesheet" type="text/css" href="static/css/admin.css" />
|
<link rel="stylesheet" type="text/css" href="../static/css/admin.css" />
|
||||||
<script src="https://unpkg.com/location-picker/dist/location-picker.min.js"></script>
|
<script src="https://unpkg.com/location-picker/dist/location-picker.min.js"></script>
|
||||||
<script src="compiled/settings.js"></script>
|
<script src="../compiled/settings.js"></script>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
21
htdocs/settings/sdr.html
Normal file
21
htdocs/settings/sdr.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>OpenWebRX Settings</title>
|
||||||
|
<link rel="shortcut icon" type="image/x-icon" href="../static/favicon.ico" />
|
||||||
|
<link rel="stylesheet" href="../static/css/bootstrap.min.css" />
|
||||||
|
<link rel="stylesheet" type="text/css" href="../static/css/admin.css" />
|
||||||
|
<script src="../compiled/settings.js"></script>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
${header}
|
||||||
|
<div class="container">
|
||||||
|
<div class="col-12">
|
||||||
|
<h1>SDR device settings</h1>
|
||||||
|
</div>
|
||||||
|
<div class="col-12">
|
||||||
|
${devices}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
@ -64,6 +64,11 @@ class SettingsController(AuthorizationMixin, WebpageController):
|
|||||||
|
|
||||||
|
|
||||||
class SdrSettingsController(AuthorizationMixin, WebpageController):
|
class SdrSettingsController(AuthorizationMixin, WebpageController):
|
||||||
|
def header_variables(self):
|
||||||
|
variables = super().header_variables()
|
||||||
|
variables["assets_prefix"] = "../"
|
||||||
|
return variables
|
||||||
|
|
||||||
def template_variables(self):
|
def template_variables(self):
|
||||||
variables = super().template_variables()
|
variables = super().template_variables()
|
||||||
variables["devices"] = self.render_devices()
|
variables["devices"] = self.render_devices()
|
||||||
@ -94,7 +99,7 @@ class SdrSettingsController(AuthorizationMixin, WebpageController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def indexAction(self):
|
def indexAction(self):
|
||||||
self.serve_template("sdrsettings.html", **self.template_variables())
|
self.serve_template("settings/sdr.html", **self.template_variables())
|
||||||
|
|
||||||
|
|
||||||
class GeneralSettingsController(AuthorizationMixin, WebpageController):
|
class GeneralSettingsController(AuthorizationMixin, WebpageController):
|
||||||
@ -372,7 +377,12 @@ class GeneralSettingsController(AuthorizationMixin, WebpageController):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def indexAction(self):
|
def indexAction(self):
|
||||||
self.serve_template("generalsettings.html", **self.template_variables())
|
self.serve_template("settings/general.html", **self.template_variables())
|
||||||
|
|
||||||
|
def header_variables(self):
|
||||||
|
variables = super().header_variables()
|
||||||
|
variables["assets_prefix"] = "../"
|
||||||
|
return variables
|
||||||
|
|
||||||
def template_variables(self):
|
def template_variables(self):
|
||||||
variables = super().template_variables()
|
variables = super().template_variables()
|
||||||
@ -417,4 +427,4 @@ class GeneralSettingsController(AuthorizationMixin, WebpageController):
|
|||||||
else:
|
else:
|
||||||
config[k] = v
|
config[k] = v
|
||||||
config.store()
|
config.store()
|
||||||
self.send_redirect("/generalsettings")
|
self.send_redirect("/settings/general")
|
||||||
|
@ -18,8 +18,11 @@ class TemplateController(Controller):
|
|||||||
|
|
||||||
|
|
||||||
class WebpageController(TemplateController):
|
class WebpageController(TemplateController):
|
||||||
|
def header_variables(self):
|
||||||
|
return {"assets_prefix": ""}
|
||||||
|
|
||||||
def template_variables(self):
|
def template_variables(self):
|
||||||
header = self.render_template("include/header.include.html")
|
header = self.render_template("include/header.include.html", **self.header_variables())
|
||||||
return {"header": header}
|
return {"header": header}
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ class ImageInput(Input, metaclass=ABCMeta):
|
|||||||
|
|
||||||
class AvatarInput(ImageInput):
|
class AvatarInput(ImageInput):
|
||||||
def getUrl(self) -> str:
|
def getUrl(self) -> str:
|
||||||
return "static/gfx/openwebrx-avatar.png"
|
return "../static/gfx/openwebrx-avatar.png"
|
||||||
|
|
||||||
def getImgClasses(self) -> list:
|
def getImgClasses(self) -> list:
|
||||||
return ["webrx-rx-avatar"]
|
return ["webrx-rx-avatar"]
|
||||||
@ -44,7 +44,7 @@ class AvatarInput(ImageInput):
|
|||||||
|
|
||||||
class TopPhotoInput(ImageInput):
|
class TopPhotoInput(ImageInput):
|
||||||
def getUrl(self) -> str:
|
def getUrl(self) -> str:
|
||||||
return "static/gfx/openwebrx-top-photo.jpg"
|
return "../static/gfx/openwebrx-top-photo.jpg"
|
||||||
|
|
||||||
def getImgClasses(self) -> list:
|
def getImgClasses(self) -> list:
|
||||||
return ["webrx-top-photo"]
|
return ["webrx-top-photo"]
|
||||||
|
@ -103,11 +103,11 @@ class Router(object):
|
|||||||
StaticRoute("/metrics", MetricsController, options={"action": "prometheusAction"}),
|
StaticRoute("/metrics", MetricsController, options={"action": "prometheusAction"}),
|
||||||
StaticRoute("/metrics.json", MetricsController),
|
StaticRoute("/metrics.json", MetricsController),
|
||||||
StaticRoute("/settings", SettingsController),
|
StaticRoute("/settings", SettingsController),
|
||||||
StaticRoute("/generalsettings", GeneralSettingsController),
|
StaticRoute("/settings/general", GeneralSettingsController),
|
||||||
StaticRoute(
|
StaticRoute(
|
||||||
"/generalsettings", GeneralSettingsController, method="POST", options={"action": "processFormData"}
|
"/settings/general", GeneralSettingsController, method="POST", options={"action": "processFormData"}
|
||||||
),
|
),
|
||||||
StaticRoute("/sdrsettings", SdrSettingsController),
|
StaticRoute("/settings/sdr", SdrSettingsController),
|
||||||
StaticRoute("/login", SessionController, options={"action": "loginAction"}),
|
StaticRoute("/login", SessionController, options={"action": "loginAction"}),
|
||||||
StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}),
|
StaticRoute("/login", SessionController, method="POST", options={"action": "processLoginAction"}),
|
||||||
StaticRoute("/logout", SessionController, options={"action": "logoutAction"}),
|
StaticRoute("/logout", SessionController, options={"action": "logoutAction"}),
|
||||||
|
Loading…
Reference in New Issue
Block a user