fix player external url
This commit is contained in:
parent
6417f4ab0b
commit
c792f7ebd1
@ -23,7 +23,7 @@ class SysinfoController(ObController):
|
|||||||
self._app.add_url_rule('/logs', 'logs', self._auth(self.logs), methods=['GET'])
|
self._app.add_url_rule('/logs', 'logs', self._auth(self.logs), methods=['GET'])
|
||||||
self._app.add_url_rule('/sysinfo/restart', 'sysinfo_restart', self.sysinfo_restart, methods=['GET', 'POST'])
|
self._app.add_url_rule('/sysinfo/restart', 'sysinfo_restart', self.sysinfo_restart, methods=['GET', 'POST'])
|
||||||
self._app.add_url_rule('/sysinfo/restart/needed', 'sysinfo_restart_needed', self._auth(self.sysinfo_restart_needed), methods=['GET'])
|
self._app.add_url_rule('/sysinfo/restart/needed', 'sysinfo_restart_needed', self._auth(self.sysinfo_restart_needed), methods=['GET'])
|
||||||
self._app.add_url_rule('/sysinfo/get/ipaddr', 'sysinfo_get_ipaddr', self._auth(self.sysinfo_get_ipaddr), methods=['GET'])
|
self._app.add_url_rule('/sysinfo/get/ipaddr', 'sysinfo_get_ipaddr', self.sysinfo_get_ipaddr, methods=['GET'])
|
||||||
|
|
||||||
def logs(self):
|
def logs(self):
|
||||||
self._model_store.variable().update_by_name('last_pillmenu_configuration', 'logs')
|
self._model_store.variable().update_by_name('last_pillmenu_configuration', 'logs')
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
const time_with_seconds = {{ 'true' if time_with_seconds.as_bool() else 'false' }};
|
const time_with_seconds = {{ 'true' if time_with_seconds.as_bool() else 'false' }};
|
||||||
let external_url = '{{ external_url }}';
|
let external_url = '{{ external_url.strip() }}';
|
||||||
|
|
||||||
function updateTime() {
|
function updateTime() {
|
||||||
const date = new Date();
|
const date = new Date();
|
||||||
@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
document.getElementById('time').innerHTML = timeLabel;
|
document.getElementById('time').innerHTML = timeLabel;
|
||||||
document.getElementById('date').innerHTML = dateLabel;
|
document.getElementById('date').innerHTML = dateLabel;
|
||||||
setTimeout(updateTime, 1000);
|
setTimeout(updateTime, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
window.addEventListener("load", updateTime);
|
window.addEventListener("load", updateTime);
|
||||||
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
xhr.send();
|
xhr.send();
|
||||||
}, 1000);
|
}, 5000);
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
* { font-family: 'Tahoma', 'Arial', 'sans-serif'; }
|
* { font-family: 'Tahoma', 'Arial', 'sans-serif'; }
|
||||||
@ -53,8 +53,6 @@
|
|||||||
.ipaddr a { text-decoration: none; font-weight: normal; font-size: 1.2em; color: #666; transition: .1s ease-in all; display:block; flex-direction:row; align-self: stretch; flex: 1; text-align: center; margin: 0 20px; border-radius: 6px; padding: 10px 0; }
|
.ipaddr a { text-decoration: none; font-weight: normal; font-size: 1.2em; color: #666; transition: .1s ease-in all; display:block; flex-direction:row; align-self: stretch; flex: 1; text-align: center; margin: 0 20px; border-radius: 6px; padding: 10px 0; }
|
||||||
.ipaddr a span { color: white; font-size: 1.2em; }
|
.ipaddr a span { color: white; font-size: 1.2em; }
|
||||||
.ipaddr a:hover { color: #fff; background: #017BFF; }
|
.ipaddr a:hover { color: #fff; background: #017BFF; }
|
||||||
.ipaddr a.external { color: #017BFF; }
|
|
||||||
.ipaddr a.external:hover { background: #FFFFFF; }
|
|
||||||
#hidden-container { display: none; }
|
#hidden-container { display: none; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
@ -87,7 +85,12 @@
|
|||||||
$container.appendChild($ipaddrs);
|
$container.appendChild($ipaddrs);
|
||||||
|
|
||||||
if (external_url.length) {
|
if (external_url.length) {
|
||||||
addLink($ipaddrs, external_url, external_url, 'external');
|
const isHttps = external_url.indexOf('https://') === 0;
|
||||||
|
let href = external_url.replace('http://', '').replace('https://', '').replace(/\/$/, '');
|
||||||
|
const path = '{{ url_for('manage') }}';
|
||||||
|
const scheme = (isHttps ? 'https://' : 'http://');
|
||||||
|
const href_label = scheme + '<span>' + href + '</span>' + path;
|
||||||
|
addLink($ipaddrs, href_label, scheme + href + path, 'external');
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < ips.length; i++) {
|
for (let i = 0; i < ips.length; i++) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user