mirror of
https://github.com/fHDHR/fHDHR_NextPVR.git
synced 2025-12-06 06:56:57 -05:00
Compare commits
8 Commits
c444d3123c
...
8f9208c2cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8f9208c2cb | ||
|
|
93e07fd771 | ||
|
|
f5967e718a | ||
|
|
32252e34c9 | ||
|
|
7e2accd2d2 | ||
|
|
244472792e | ||
|
|
418b23e96b | ||
|
|
d9e0cc13dd |
@ -153,7 +153,7 @@ class Channel():
|
|||||||
'GuideNumber': self.number,
|
'GuideNumber': self.number,
|
||||||
'GuideName': self.dict['name'],
|
'GuideName': self.dict['name'],
|
||||||
'Tags': ",".join(self.dict['tags']),
|
'Tags': ",".join(self.dict['tags']),
|
||||||
'URL': self.stream_url,
|
'URL': self.hdhr_stream_url,
|
||||||
'HD': self.dict["HD"],
|
'HD': self.dict["HD"],
|
||||||
"Favorite": self.dict["favorite"],
|
"Favorite": self.dict["favorite"],
|
||||||
}
|
}
|
||||||
@ -163,11 +163,27 @@ class Channel():
|
|||||||
return "/api/images?method=generate&type=channel&message=%s" % self.number
|
return "/api/images?method=generate&type=channel&message=%s" % self.number
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def stream_url(self):
|
def hdhr_stream_url(self):
|
||||||
return '/auto/v%s' % self.number
|
return '/auto/%s' % self.hdhr_stream_ident
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def play_url(self):
|
def hdhr_stream_ident(self):
|
||||||
|
return 'v%s' % self.number
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rmg_stream_url(self):
|
||||||
|
return "/devices/%s/media/%s" % (self.fhdhr.config.dict["main"]["uuid"], self.rmg_stream_ident)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def rmg_stream_ident(self):
|
||||||
|
return "id://%s" % self.number
|
||||||
|
|
||||||
|
@property
|
||||||
|
def api_stream_url(self):
|
||||||
|
return '/api/tuners?method=%s&channel=%s' % (self.fhdhr.config.dict["fhdhr"]["stream_type"], self.number)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def m3u_url(self):
|
||||||
return '/api/m3u?method=get&channel=%s' % self.number
|
return '/api/m3u?method=get&channel=%s' % self.number
|
||||||
|
|
||||||
def set_favorite(self, enablement):
|
def set_favorite(self, enablement):
|
||||||
|
|||||||
@ -9,6 +9,9 @@ class Channels():
|
|||||||
endpoints = ["/api/channels"]
|
endpoints = ["/api/channels"]
|
||||||
endpoint_name = "api_channels"
|
endpoint_name = "api_channels"
|
||||||
endpoint_methods = ["GET", "POST"]
|
endpoint_methods = ["GET", "POST"]
|
||||||
|
endpoint_default_parameters = {
|
||||||
|
"method": "get"
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
@ -26,8 +29,8 @@ class Channels():
|
|||||||
for fhdhr_id in [x["id"] for x in self.fhdhr.device.channels.get_channels()]:
|
for fhdhr_id in [x["id"] for x in self.fhdhr.device.channels.get_channels()]:
|
||||||
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
channel_obj = self.fhdhr.device.channels.list[fhdhr_id]
|
||||||
channel_dict = channel_obj.dict.copy()
|
channel_dict = channel_obj.dict.copy()
|
||||||
channel_dict["play_url"] = channel_obj.play_url
|
channel_dict["m3u_url"] = channel_obj.m3u_url
|
||||||
channel_dict["stream_url"] = channel_obj.stream_url
|
channel_dict["stream_url"] = channel_obj.api_stream_url
|
||||||
channels_info[channel_obj.number] = channel_dict
|
channels_info[channel_obj.number] = channel_dict
|
||||||
|
|
||||||
# Sort the channels
|
# Sort the channels
|
||||||
|
|||||||
@ -7,6 +7,9 @@ class Cluster():
|
|||||||
endpoints = ["/api/cluster"]
|
endpoints = ["/api/cluster"]
|
||||||
endpoint_name = "api_cluster"
|
endpoint_name = "api_cluster"
|
||||||
endpoint_methods = ["GET", "POST"]
|
endpoint_methods = ["GET", "POST"]
|
||||||
|
endpoint_default_parameters = {
|
||||||
|
"method": "get"
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
|
|||||||
@ -5,6 +5,11 @@ class Images():
|
|||||||
endpoints = ["/api/images"]
|
endpoints = ["/api/images"]
|
||||||
endpoint_name = "api_images"
|
endpoint_name = "api_images"
|
||||||
endpoint_methods = ["GET", "POST"]
|
endpoint_methods = ["GET", "POST"]
|
||||||
|
endpoint_default_parameters = {
|
||||||
|
"method": "generate",
|
||||||
|
"type": "content",
|
||||||
|
"message": "Internal Image Handling"
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
|
|||||||
@ -75,7 +75,7 @@ class M3U():
|
|||||||
"tvg-logo": logourl,
|
"tvg-logo": logourl,
|
||||||
"group-title": self.fhdhr.config.dict["fhdhr"]["friendlyname"],
|
"group-title": self.fhdhr.config.dict["fhdhr"]["friendlyname"],
|
||||||
"group-titleb": str(channel_obj.dict['name']),
|
"group-titleb": str(channel_obj.dict['name']),
|
||||||
"stream_url": "%s%s" % (base_url, channel_obj.stream_url)
|
"stream_url": "%s%s" % (base_url, channel_obj.api_stream_url)
|
||||||
}
|
}
|
||||||
|
|
||||||
# Sort the channels
|
# Sort the channels
|
||||||
|
|||||||
@ -1,5 +1,8 @@
|
|||||||
from flask import request, redirect, session
|
from flask import request, redirect, Response, session
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
import threading
|
||||||
|
import time
|
||||||
|
import json
|
||||||
|
|
||||||
|
|
||||||
class Settings():
|
class Settings():
|
||||||
@ -10,6 +13,9 @@ class Settings():
|
|||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
|
|
||||||
|
self.restart_url = "/api/settings?method=restart_actual"
|
||||||
|
self.restart_sleep = 5
|
||||||
|
|
||||||
def __call__(self, *args):
|
def __call__(self, *args):
|
||||||
return self.get(*args)
|
return self.get(*args)
|
||||||
|
|
||||||
@ -18,7 +24,28 @@ class Settings():
|
|||||||
method = request.args.get('method', default="get", type=str)
|
method = request.args.get('method', default="get", type=str)
|
||||||
redirect_url = request.args.get('redirect', default=None, type=str)
|
redirect_url = request.args.get('redirect', default=None, type=str)
|
||||||
|
|
||||||
if method == "update":
|
if method == "get":
|
||||||
|
web_settings_dict = {}
|
||||||
|
for config_section in list(self.fhdhr.config.conf_default.keys()):
|
||||||
|
web_settings_dict[config_section] = {}
|
||||||
|
|
||||||
|
for config_item in list(self.fhdhr.config.conf_default[config_section].keys()):
|
||||||
|
real_config_section = config_section
|
||||||
|
if config_section == self.fhdhr.config.dict["main"]["dictpopname"]:
|
||||||
|
real_config_section = "origin"
|
||||||
|
web_settings_dict[config_section][config_item] = {
|
||||||
|
"value": self.fhdhr.config.dict[real_config_section][config_item],
|
||||||
|
}
|
||||||
|
if self.fhdhr.config.conf_default[config_section][config_item]["config_web_hidden"]:
|
||||||
|
web_settings_dict[config_section][config_item]["value"] = "***********"
|
||||||
|
|
||||||
|
return_json = json.dumps(web_settings_dict, indent=4)
|
||||||
|
|
||||||
|
return Response(status=200,
|
||||||
|
response=return_json,
|
||||||
|
mimetype='application/json')
|
||||||
|
|
||||||
|
elif method == "update":
|
||||||
config_section = request.form.get('config_section', None)
|
config_section = request.form.get('config_section', None)
|
||||||
config_name = request.form.get('config_name', None)
|
config_name = request.form.get('config_name', None)
|
||||||
config_value = request.form.get('config_value', None)
|
config_value = request.form.get('config_value', None)
|
||||||
@ -35,11 +62,18 @@ class Settings():
|
|||||||
self.fhdhr.config.write(config_section, config_name, config_value)
|
self.fhdhr.config.write(config_section, config_name, config_value)
|
||||||
|
|
||||||
elif method == "restart":
|
elif method == "restart":
|
||||||
instance_id = request.args.get('instance_id', default=None, type=str)
|
restart_thread = threading.Thread(target=self.restart_thread)
|
||||||
if instance_id == session["instance_id"]:
|
restart_thread.start()
|
||||||
session["restart"] = True
|
return redirect(redirect_url + "?retmessage=" + urllib.parse.quote("Restarting in %s seconds" % self.restart_sleep))
|
||||||
|
|
||||||
|
elif method == "restart_actual":
|
||||||
|
session["restart"] = True
|
||||||
|
|
||||||
if redirect_url:
|
if redirect_url:
|
||||||
return redirect(redirect_url + "?retmessage=" + urllib.parse.quote("%s Success" % method))
|
return redirect(redirect_url + "?retmessage=" + urllib.parse.quote("%s Success" % method))
|
||||||
else:
|
else:
|
||||||
return "%s Success" % method
|
return "%s Success" % method
|
||||||
|
|
||||||
|
def restart_thread(self):
|
||||||
|
time.sleep(self.restart_sleep)
|
||||||
|
self.fhdhr.api.get(self.restart_url)
|
||||||
|
|||||||
@ -7,6 +7,9 @@ class API_Tools():
|
|||||||
endpoints = ["/api/tools"]
|
endpoints = ["/api/tools"]
|
||||||
endpoint_name = "api_tools"
|
endpoint_name = "api_tools"
|
||||||
endpoint_methods = ["GET", "POST"]
|
endpoint_methods = ["GET", "POST"]
|
||||||
|
endpoint_default_parameters = {
|
||||||
|
"method": "get"
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
@ -20,7 +23,15 @@ class API_Tools():
|
|||||||
|
|
||||||
redirect_url = request.args.get('redirect', default=None, type=str)
|
redirect_url = request.args.get('redirect', default=None, type=str)
|
||||||
|
|
||||||
if method == "prettyjson":
|
if method == "get":
|
||||||
|
|
||||||
|
return_json = json.dumps({"tools": "api for tools page"}, indent=4)
|
||||||
|
|
||||||
|
return Response(status=200,
|
||||||
|
response=return_json,
|
||||||
|
mimetype='application/json')
|
||||||
|
|
||||||
|
elif method == "prettyjson":
|
||||||
|
|
||||||
dirty_json_url = request.form.get('url', None)
|
dirty_json_url = request.form.get('url', None)
|
||||||
|
|
||||||
|
|||||||
@ -10,6 +10,9 @@ class Tuners():
|
|||||||
endpoints = ["/api/tuners"]
|
endpoints = ["/api/tuners"]
|
||||||
endpoint_name = "api_tuners"
|
endpoint_name = "api_tuners"
|
||||||
endpoint_methods = ["GET", "POST"]
|
endpoint_methods = ["GET", "POST"]
|
||||||
|
endpoint_default_parameters = {
|
||||||
|
"method": "status"
|
||||||
|
}
|
||||||
|
|
||||||
def __init__(self, fhdhr):
|
def __init__(self, fhdhr):
|
||||||
self.fhdhr = fhdhr
|
self.fhdhr = fhdhr
|
||||||
@ -29,7 +32,7 @@ class Tuners():
|
|||||||
|
|
||||||
method = request.args.get('method', default=self.fhdhr.config.dict["fhdhr"]["stream_type"], type=str)
|
method = request.args.get('method', default=self.fhdhr.config.dict["fhdhr"]["stream_type"], type=str)
|
||||||
|
|
||||||
tuner_number = request.args.get('tuner', None, type=str)
|
tuner_number = request.args.get('tuner', default=None, type=str)
|
||||||
|
|
||||||
redirect_url = request.args.get('redirect', default=None, type=str)
|
redirect_url = request.args.get('redirect', default=None, type=str)
|
||||||
|
|
||||||
|
|||||||
@ -9,8 +9,8 @@ from .xmltv_html import xmlTV_HTML
|
|||||||
from .version_html import Version_HTML
|
from .version_html import Version_HTML
|
||||||
from .diagnostics_html import Diagnostics_HTML
|
from .diagnostics_html import Diagnostics_HTML
|
||||||
from .settings_html import Settings_HTML
|
from .settings_html import Settings_HTML
|
||||||
from .channels_editor import Channels_Editor_HTML
|
from .channels_editor_html import Channels_Editor_HTML
|
||||||
from .tools import Tools_HTML
|
from .tools_html import Tools_HTML
|
||||||
|
|
||||||
|
|
||||||
class fHDHR_Pages():
|
class fHDHR_Pages():
|
||||||
@ -20,7 +20,7 @@ class fHDHR_Pages():
|
|||||||
|
|
||||||
self.index_html = Index_HTML(fhdhr)
|
self.index_html = Index_HTML(fhdhr)
|
||||||
self.channels_html = Channels_HTML(fhdhr)
|
self.channels_html = Channels_HTML(fhdhr)
|
||||||
self.channels_editor = Channels_Editor_HTML(fhdhr)
|
self.channels_editor_html = Channels_Editor_HTML(fhdhr)
|
||||||
self.guide_html = Guide_HTML(fhdhr)
|
self.guide_html = Guide_HTML(fhdhr)
|
||||||
self.cluster_html = Cluster_HTML(fhdhr)
|
self.cluster_html = Cluster_HTML(fhdhr)
|
||||||
self.tuners_html = Tuners_HTML(fhdhr)
|
self.tuners_html = Tuners_HTML(fhdhr)
|
||||||
@ -28,4 +28,4 @@ class fHDHR_Pages():
|
|||||||
self.version_html = Version_HTML(fhdhr)
|
self.version_html = Version_HTML(fhdhr)
|
||||||
self.diagnostics_html = Diagnostics_HTML(fhdhr)
|
self.diagnostics_html = Diagnostics_HTML(fhdhr)
|
||||||
self.settings_html = Settings_HTML(fhdhr)
|
self.settings_html = Settings_HTML(fhdhr)
|
||||||
self.tools = Tools_HTML(fhdhr)
|
self.tools_html = Tools_HTML(fhdhr)
|
||||||
|
|||||||
@ -24,7 +24,7 @@ class Channels_Editor_HTML():
|
|||||||
|
|
||||||
channel_dict["number"] = channel_obj.number
|
channel_dict["number"] = channel_obj.number
|
||||||
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
||||||
channel_dict["play_url"] = channel_obj.play_url
|
channel_dict["m3u_url"] = channel_obj.m3u_url
|
||||||
|
|
||||||
channelslist[channel_dict["number"]] = channel_dict
|
channelslist[channel_dict["number"]] = channel_dict
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ class Channels_HTML():
|
|||||||
|
|
||||||
channel_dict["number"] = channel_obj.number
|
channel_dict["number"] = channel_obj.number
|
||||||
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
channel_dict["chan_thumbnail"] = channel_obj.thumbnail
|
||||||
channel_dict["play_url"] = channel_obj.play_url
|
channel_dict["m3u_url"] = channel_obj.m3u_url
|
||||||
|
|
||||||
channelslist[channel_dict["number"]] = channel_dict
|
channelslist[channel_dict["number"]] = channel_dict
|
||||||
if channel_dict["enabled"]:
|
if channel_dict["enabled"]:
|
||||||
|
|||||||
@ -35,9 +35,15 @@ class Diagnostics_HTML():
|
|||||||
button_link += "%s=%s" % (parameter, parameter_val)
|
button_link += "%s=%s" % (parameter, parameter_val)
|
||||||
button_link = button_link.replace("<devicekey>", self.fhdhr.config.dict["main"]["uuid"])
|
button_link = button_link.replace("<devicekey>", self.fhdhr.config.dict["main"]["uuid"])
|
||||||
button_link = button_link.replace("<base_url>", base_url)
|
button_link = button_link.replace("<base_url>", base_url)
|
||||||
button_dict[route_group].append({
|
curr_button_dict = {
|
||||||
"label": session["route_list"][route_group][route_item]["pretty_name"],
|
"label": session["route_list"][route_group][route_item]["pretty_name"],
|
||||||
"link": button_link,
|
"link": button_link,
|
||||||
})
|
"methods": ",".join(session["route_list"][route_group][route_item]["endpoint_methods"]),
|
||||||
|
"button": True
|
||||||
|
}
|
||||||
|
if ("GET" not in session["route_list"][route_group][route_item]["endpoint_methods"]
|
||||||
|
or "<tuner_number>" in button_link or "<channel>" in button_link):
|
||||||
|
curr_button_dict["button"] = False
|
||||||
|
button_dict[route_group].append(curr_button_dict)
|
||||||
|
|
||||||
return render_template('diagnostics.html', session=session, request=request, fhdhr=self.fhdhr, button_dict=button_dict, list=list)
|
return render_template('diagnostics.html', session=session, request=request, fhdhr=self.fhdhr, button_dict=button_dict, list=list)
|
||||||
|
|||||||
@ -67,7 +67,7 @@ class Guide_HTML():
|
|||||||
chan_dict["number"] = chan_obj.number
|
chan_dict["number"] = chan_obj.number
|
||||||
chan_dict["chan_thumbnail"] = chan_obj.thumbnail
|
chan_dict["chan_thumbnail"] = chan_obj.thumbnail
|
||||||
chan_dict["enabled"] = chan_obj.dict["enabled"]
|
chan_dict["enabled"] = chan_obj.dict["enabled"]
|
||||||
chan_dict["play_url"] = chan_obj.play_url
|
chan_dict["m3u_url"] = chan_obj.m3u_url
|
||||||
|
|
||||||
chan_dict["listing_thumbnail"] = chan_dict["listing_thumbnail"] or chan_obj.thumbnail
|
chan_dict["listing_thumbnail"] = chan_dict["listing_thumbnail"] or chan_obj.thumbnail
|
||||||
else:
|
else:
|
||||||
|
|||||||
@ -27,7 +27,7 @@ class RMG_Devices_DeviceKey_Channels():
|
|||||||
if channel_obj.enabled:
|
if channel_obj.enabled:
|
||||||
sub_el(out, 'Channel',
|
sub_el(out, 'Channel',
|
||||||
drm="0",
|
drm="0",
|
||||||
channelIdentifier="id://%s" % channel_obj.number,
|
channelIdentifier=channel_obj.rmg_stream_ident,
|
||||||
name=channel_obj.dict["name"],
|
name=channel_obj.dict["name"],
|
||||||
origin=channel_obj.dict["callsign"],
|
origin=channel_obj.dict["callsign"],
|
||||||
number=str(channel_obj.number),
|
number=str(channel_obj.number),
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
<html>
|
<html>
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<title>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</title>
|
<title>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</title>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<style>
|
|
||||||
table, th, td {border: 1px solid black;}
|
|
||||||
</style>
|
|
||||||
<link href="style.css" rel="stylesheet">
|
<link href="style.css" rel="stylesheet">
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1 style="text-align: center;">
|
|
||||||
<span style="text-decoration: underline;"><strong><em>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</em></strong>
|
|
||||||
</span>
|
|
||||||
<img class="pull-left" src="/favicon.ico" alt="fHDHR Logo" width="100" height="100">
|
|
||||||
</h1>
|
|
||||||
<br><br>
|
|
||||||
<p></p>
|
|
||||||
<div>
|
|
||||||
|
|
||||||
<button class="pull-left" onclick="OpenLink('/index')">fHDHR</button>
|
</head>
|
||||||
<button class="pull-left" onclick="OpenLink('/origin')">{{ fhdhr.config.dict["main"]["servicename"] }}</button>
|
|
||||||
|
<body>
|
||||||
|
<h1 style="text-align: center;">
|
||||||
|
<span style="text-decoration: underline;"><strong><em>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</em></strong>
|
||||||
|
</span>
|
||||||
|
<img class="pull-left" src="/favicon.ico" alt="fHDHR Logo" width="100" height="100">
|
||||||
|
</h1>
|
||||||
|
<br><br>
|
||||||
|
<p></p>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<button onclick="location.href='/index'" type="button">fHDHR</button>
|
||||||
|
<button onclick="location.href='/origin'" type="button">{{ fhdhr.config.dict["main"]["servicename"] }}</button>
|
||||||
|
|
||||||
{% for page_dict in session["route_list"]["pages"] %}
|
{% for page_dict in session["route_list"]["pages"] %}
|
||||||
{% if session["route_list"]["pages"][page_dict]["name"] != "page_index_html" and fhdhr.config.dict["web_ui"]["access_level"] >= session["route_list"]["pages"][page_dict]["endpoint_access_level"] %}
|
{% if session["route_list"]["pages"][page_dict]["name"] != "page_index_html" and fhdhr.config.dict["web_ui"]["access_level"] >= session["route_list"]["pages"][page_dict]["endpoint_access_level"] %}
|
||||||
<button class="pull-left" onclick="OpenLink('{{ session["route_list"]["pages"][page_dict]["endpoints"][0] }}')">{{ session["route_list"]["pages"][page_dict]["pretty_name"] }}</button>
|
<button onclick="location.href='{{ session["route_list"]["pages"][page_dict]["endpoints"][0] }}'" type="button">{{ session["route_list"]["pages"][page_dict]["pretty_name"] }}</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
@ -50,29 +50,26 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<hr align="center" width="100%">
|
<hr align="center" width="100%">
|
||||||
|
|
||||||
{% if fhdhr.config.dict["web_ui"]["cluster_bar"] %}
|
{% if fhdhr.config.dict["web_ui"]["cluster_bar"] %}
|
||||||
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
|
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
|
||||||
{% if locations %}
|
{% if locations %}
|
||||||
<div>
|
<div>
|
||||||
{% for location in locations %}
|
{% for location in locations %}
|
||||||
<button class="pull-left" onclick="OpenLink('{{ location["base_url"] }}')">{{ location["name"] }}</a></button>
|
<button onclick="location.href='{{ location["base_url"] }}'" type="button">{{ location["name"] }}</button>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<hr align="center" width="100%">
|
<hr align="center" width="100%">
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% set retmessage = request.args.get('retmessage', default=None) %}
|
{% set retmessage = request.args.get('retmessage', default=None) %}
|
||||||
{% if retmessage %}
|
{% if retmessage %}
|
||||||
<p>{{ retmessage }}</p>
|
<p>{{ retmessage }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
<script>
|
|
||||||
function OpenLink(NewURL) {window.open(NewURL, "_self");}
|
|
||||||
</script>
|
|
||||||
|
|||||||
@ -2,82 +2,82 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels</h4>
|
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels</h4>
|
||||||
|
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<button onclick="OpenLink('/api/tuners?method=scan&redirect=%2Fchannels')">Force Channel Update</a></button><p> Note: This may take some time.</p>
|
<button onclick="location.href='/api/tuners?method=scan&redirect=/channels'" type="button">Force Channel Update</button>
|
||||||
</div>
|
<p> Note: This may take some time.</p>
|
||||||
<br>
|
</div>
|
||||||
|
<br>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-small center">
|
<table class="table-small center">
|
||||||
<tbody>
|
<tbody>
|
||||||
{% for key in list(channels_dict.keys()) %}
|
{% for key in list(channels_dict.keys()) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ key }}</td>
|
<td>{{ key }}</td>
|
||||||
<td>{{ channels_dict[key] }}</td>
|
<td>{{ channels_dict[key] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<button onclick="OpenLink('/channels_editor')">Edit Channels</a></button>
|
<button onclick="location.href='/channels_editor'" type="button">Edit Channels</button>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-scroll center small-first-col">
|
<table class="table-scroll center small-first-col">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Play</th>
|
<th>Play</th>
|
||||||
<th>Channel Name</th>
|
<th>Channel Name</th>
|
||||||
<th>Channel CallSign</th>
|
<th>Channel CallSign</th>
|
||||||
<th>Channel Number</th>
|
<th>Channel Number</th>
|
||||||
<th>Channel Thumbnail</th>
|
<th>Channel Thumbnail</th>
|
||||||
<th>Enabled</th>
|
<th>Enabled</th>
|
||||||
<th>Favorite</th>
|
<th>Favorite</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="body-half-screen">
|
<tbody class="body-half-screen">
|
||||||
{% for chan_dict in channelslist %}
|
{% for chan_dict in channelslist %}
|
||||||
<tr>
|
<tr>
|
||||||
|
<td>
|
||||||
|
{% if chan_dict["enabled"] %}
|
||||||
|
<a href="{{ chan_dict["m3u_url"] }}">Play</a>
|
||||||
|
{% else %}
|
||||||
|
<a href="{{ chan_dict["m3u_url"] }}" style="visibility:hidden">Play</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>{{ chan_dict["name"] }}</td>
|
||||||
{% if chan_dict["enabled"] %}
|
<td>{{ chan_dict["callsign"] }}</td>
|
||||||
<a href="{{ chan_dict["play_url"] }}">Play</a>
|
<td>{{ chan_dict["number"] }}</td>
|
||||||
{% else %}
|
|
||||||
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
|
|
||||||
{% endif %}
|
|
||||||
</td>
|
|
||||||
|
|
||||||
<td>{{ chan_dict["name"] }}</td>
|
{% if chan_dict["thumbnail"] %}
|
||||||
<td>{{ chan_dict["callsign"] }}</td>
|
<td><img src="{{ chan_dict["thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
|
||||||
<td>{{ chan_dict["number"] }}</td>
|
{% else %}
|
||||||
|
<td>No Image Available</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if chan_dict["thumbnail"] %}
|
{% if chan_dict["enabled"] %}
|
||||||
<td><img src="{{ chan_dict["thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
|
<td>Enabled</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>No Image Available</td>
|
<td>Disabled</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if chan_dict["enabled"] %}
|
{% if chan_dict["favorite"] %}
|
||||||
<td>Enabled</td>
|
<td>Yes</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>Disabled</td>
|
<td>No</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</tr>
|
||||||
{% if chan_dict["favorite"] %}
|
{% endfor %}
|
||||||
<td>Yes</td>
|
</tbody>
|
||||||
{% else %}
|
|
||||||
<td>No</td>
|
|
||||||
{% endif %}
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -1,129 +1,128 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<body onload="brython({debug: 1, indexedDB: false})">
|
<body onload="brython({debug: 1, indexedDB: false})">
|
||||||
<script type="text/javascript" src="/brython.js"></script>
|
<script type="text/javascript" src="/brython.js"></script>
|
||||||
<script type="text/javascript" src="/brython_stdlib.js"></script>
|
<script type="text/javascript" src="/brython_stdlib.js"></script>
|
||||||
<script type="text/python" id="enable0">
|
<script type="text/python" id="enable0">
|
||||||
from browser import document, alert, window, bind
|
from browser import document, alert, window, bind
|
||||||
|
|
||||||
@bind("#enable_button", "click")
|
@bind("#enable_button", "click")
|
||||||
def enable_all(event):
|
def enable_all(event):
|
||||||
for element in document.get(selector='input[type="checkbox"]'):
|
for element in document.get(selector='input[type="checkbox"]'):
|
||||||
if element.name.endswith("enabled"):
|
if element.name.endswith("enabled"):
|
||||||
if document["enable_button"].value == "0":
|
if document["enable_button"].value == "0":
|
||||||
element.checked = False
|
element.checked = False
|
||||||
element.value = False
|
element.value = False
|
||||||
else:
|
else:
|
||||||
element.checked = True
|
element.checked = True
|
||||||
element.value = True
|
element.value = True
|
||||||
|
|
||||||
if document["enable_button"].value == "0":
|
if document["enable_button"].value == "0":
|
||||||
document["enable_button"].value = "1"
|
document["enable_button"].value = "1"
|
||||||
document["enable_button"].text = "Enable All"
|
document["enable_button"].text = "Enable All"
|
||||||
else:
|
else:
|
||||||
document["enable_button"].value = "0"
|
document["enable_button"].value = "0"
|
||||||
document["enable_button"].text = "Disable All"
|
document["enable_button"].text = "Disable All"
|
||||||
|
|
||||||
|
@bind("#chanSubmit", "submit")
|
||||||
|
def submit_fixup(evt):
|
||||||
|
for element in document.get(selector='input[type="checkbox"]'):
|
||||||
|
if element.name.endswith("enabled"):
|
||||||
|
if element.checked == False:
|
||||||
|
element.checked = True
|
||||||
|
element.value = False
|
||||||
|
if element.name.endswith("favorite"):
|
||||||
|
if element.checked == False:
|
||||||
|
element.checked = True
|
||||||
|
element.value = 0
|
||||||
|
|
||||||
|
items = document.select(".channels")
|
||||||
|
chanlist = []
|
||||||
|
chandict = {}
|
||||||
|
|
||||||
|
for element in items:
|
||||||
|
if element.name == "id":
|
||||||
|
if len(chandict.keys()):
|
||||||
|
chanlist.append(chandict)
|
||||||
|
chandict = {}
|
||||||
|
chandict[element.name] = element.value
|
||||||
|
element.clear()
|
||||||
|
|
||||||
|
postForm = document.createElement('form')
|
||||||
|
postData = document.createElement('input')
|
||||||
|
postForm.method = "POST"
|
||||||
|
postForm.action = "/api/channels?method=modify&redirect=/channels_editor"
|
||||||
|
postForm.setRequestHeader = "('Content-Type', 'application/json')"
|
||||||
|
postData.name = "channels"
|
||||||
|
postData.value = chanlist
|
||||||
|
postForm.appendChild(postData)
|
||||||
|
|
||||||
|
document.body.appendChild(postForm)
|
||||||
|
|
||||||
|
postForm.submit()
|
||||||
|
|
||||||
|
evt.preventDefault()
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels Editor</h4>
|
||||||
|
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<form id="chanSubmit" method="post">
|
||||||
|
<button type="Submit" id="modify_button" value="0">Modify All</button>
|
||||||
|
<button type="button" id="enable_button" value="0">Disable All</button>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
@bind("#chanSubmit", "submit")
|
<div class="container">
|
||||||
def submit_fixup(evt):
|
<table class="table-scroll center text-edit-cols">
|
||||||
for element in document.get(selector='input[type="checkbox"]'):
|
|
||||||
if element.name.endswith("enabled"):
|
|
||||||
if element.checked == False:
|
|
||||||
element.checked = True
|
|
||||||
element.value = False
|
|
||||||
if element.name.endswith("favorite"):
|
|
||||||
if element.checked == False:
|
|
||||||
element.checked = True
|
|
||||||
element.value = 0
|
|
||||||
|
|
||||||
items = document.select(".channels")
|
|
||||||
chanlist = []
|
|
||||||
chandict = {}
|
|
||||||
|
|
||||||
for element in items:
|
|
||||||
if element.name == "id":
|
|
||||||
if len(chandict.keys()):
|
|
||||||
chanlist.append(chandict)
|
|
||||||
chandict = {}
|
|
||||||
chandict[element.name] = element.value
|
|
||||||
element.clear()
|
|
||||||
|
|
||||||
postForm = document.createElement('form')
|
|
||||||
postData = document.createElement('input')
|
|
||||||
postForm.method = "POST"
|
|
||||||
postForm.action = "/api/channels?method=modify&redirect=%2Fchannels_editor"
|
|
||||||
postForm.setRequestHeader = "('Content-Type', 'application/json')"
|
|
||||||
postData.name = "channels"
|
|
||||||
postData.value = chanlist
|
|
||||||
postForm.appendChild(postData)
|
|
||||||
|
|
||||||
document.body.appendChild(postForm)
|
|
||||||
|
|
||||||
postForm.submit()
|
|
||||||
|
|
||||||
evt.preventDefault()
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Channels Editor</h4>
|
|
||||||
|
|
||||||
<div style="text-align: center;">
|
|
||||||
<form id="chanSubmit" method="post">
|
|
||||||
<button type="Submit" id="modify_button" value="0">Modify All</button>
|
|
||||||
<button type="button" id="enable_button" value="0">Disable All</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
|
||||||
<table class="table-scroll center text-edit-cols">
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Channel Name</th>
|
<th>Channel Name</th>
|
||||||
<th>Channel CallSign</th>
|
<th>Channel CallSign</th>
|
||||||
<th>Channel Number</th>
|
<th>Channel Number</th>
|
||||||
<th>Channel Thumbnail</th>
|
<th>Channel Thumbnail</th>
|
||||||
<th>Enabled</th>
|
<th>Enabled</th>
|
||||||
<th>Favorite</th>
|
<th>Favorite</th>
|
||||||
<th>Actions</th>
|
<th>Actions</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="body-half-screen">
|
<tbody class="body-half-screen">
|
||||||
{% for chan_dict in channelslist %}
|
{% for chan_dict in channelslist %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><input type="hidden" name="id" class="channels" value={{ chan_dict["id"] }}>
|
<td><input type="hidden" name="id" class="channels" value={{ chan_dict["id"] }}>
|
||||||
<input type="text" class="channels" name="name" value="{{ chan_dict["name"] }}"></td>
|
<input type="text" class="channels" name="name" value="{{ chan_dict["name"] }}">
|
||||||
<td><input type="text" class="channels" name="callsign" value="{{ chan_dict["callsign"] }}"></td>
|
</td>
|
||||||
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
|
<td><input type="text" class="channels" name="callsign" value="{{ chan_dict["callsign"] }}"></td>
|
||||||
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
|
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
|
||||||
{% if chan_dict["enabled"] %}
|
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
|
||||||
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
|
{% if chan_dict["enabled"] %}
|
||||||
{% else %}
|
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
|
||||||
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
|
{% else %}
|
||||||
{% endif %}
|
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
|
||||||
{% if chan_dict["favorite"] %}
|
{% endif %}
|
||||||
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
|
{% if chan_dict["favorite"] %}
|
||||||
{% else %}
|
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
|
||||||
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
|
{% else %}
|
||||||
{% endif %}
|
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
|
||||||
<td>
|
{% endif %}
|
||||||
<form method="post" action="/api/channels?method=update&redirect=%2Fchannels_editor">
|
<td>
|
||||||
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
|
<form method="post" action="/api/channels?method=update&redirect=/channels_editor">
|
||||||
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
|
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
|
||||||
<input type="hidden" class="reset" name="callsign" value="{{ chan_dict["origin_callsign"] }}">
|
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
|
||||||
<input type="hidden" class="reset" name="number" value="{{ chan_dict["origin_number"] }}">
|
<input type="hidden" class="reset" name="callsign" value="{{ chan_dict["origin_callsign"] }}">
|
||||||
<input type="hidden" class="reset" name="thumbnail" value="{{ chan_dict["origin_thumbnail"] }}">
|
<input type="hidden" class="reset" name="number" value="{{ chan_dict["origin_number"] }}">
|
||||||
<input type="hidden" class="reset" name="enabled" value=True>
|
<input type="hidden" class="reset" name="thumbnail" value="{{ chan_dict["origin_thumbnail"] }}">
|
||||||
<input type="submit" value="Reset">
|
<input type="hidden" class="reset" name="enabled" value=True>
|
||||||
</form>
|
<input type="submit" value="Reset">
|
||||||
</td>
|
</form>
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -2,51 +2,48 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">Cluster/SSDP</h4>
|
<h4 style="text-align: center;">Cluster/SSDP</h4>
|
||||||
{% if not fhdhr.config.dict["fhdhr"]["discovery_address"] %}
|
{% if not fhdhr.config.dict["fhdhr"]["discovery_address"] %}
|
||||||
<p style="text-align: center;">Discovery Address must be set for Cluster/SSDP</p>
|
<p style="text-align: center;">Discovery Address must be set for Cluster/SSDP</p>
|
||||||
{% else %}
|
{% else %}
|
||||||
|
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<button onclick="OpenLink('/api/cluster?method=scan&redirect=%2Fcluster')">Force Scan</a></button>
|
<button onclick="location.href='/api/cluster?method=scan&redirect=/cluster'" type="button">Force Scan</button>
|
||||||
<button onclick="OpenLink('/api/cluster?method=alive&redirect=%2Fcluster')">Send Alive</a></button>
|
<button onclick="location.href='/api/cluster?method=alive&redirect=/cluster'" type="button">Send Alive</button>
|
||||||
<button onclick="OpenLink('/api/cluster?method=disconnect&redirect=%2Fcluster')">Disconnect</a></button>
|
<button onclick="location.href='/api/cluster?method=disconnect&redirect=/cluster'" type="button">Disconnect</button>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-medium center action-col">
|
<table class="table-medium center action-col">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
<tr>
|
<th>Name</th>
|
||||||
<th>Name</th>
|
<th>Location</th>
|
||||||
<th>Location</th>
|
<th>Joined</th>
|
||||||
<th>Joined</th>
|
<th>Options</th>
|
||||||
<th>Options</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{% for location in locations_list %}
|
|
||||||
<tr>
|
|
||||||
<td>{{ location["name"] }}</td>
|
|
||||||
<td>{{ location["location"] }}</td>
|
|
||||||
<td>{{ location["joined"] }}</td>
|
|
||||||
<td>
|
|
||||||
{% if location["joined"] in ["True", "False"] %}
|
|
||||||
<button onclick="OpenLink('{{ location["location"] }}')">Visit</a></button>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if location["joined"] == "True" %}
|
|
||||||
<button onclick="OpenLink('/api/cluster?method=del&location={{ location["url_query"] }}&redirect=%2Fcluster')">Remove</a></button>
|
|
||||||
{% elif location["joined"] == "False" %}
|
|
||||||
<button onclick="OpenLink('/api/cluster?method=add&location={{ location["url_query"] }}&redirect=%2Fcluster')">Add</a></button>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
{% for location in locations_list %}
|
||||||
</table>
|
<tr>
|
||||||
|
<td>{{ location["name"] }}</td>
|
||||||
|
<td>{{ location["location"] }}</td>
|
||||||
|
<td>{{ location["joined"] }}</td>
|
||||||
|
<td>
|
||||||
|
{% if location["joined"] in ["True", "False"] %}
|
||||||
|
<button onclick="location.href='{{ location["location"] }}'" type="button">Visit</button>
|
||||||
|
{% endif %}
|
||||||
|
{% if location["joined"] == "True" %}
|
||||||
|
<button onclick="location.href='/api/cluster?method=del&location={{ location["url_query"] }}&redirect=/cluster'" type="button">Remove</button>
|
||||||
|
{% elif location["joined"] == "False" %}
|
||||||
|
<button onclick="location.href='/api/cluster?method=add&location={{ location["url_query"] }}&redirect=/cluster'" type="button">Add</button>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -13,16 +13,21 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Link</th>
|
<th>Link</th>
|
||||||
|
<th>Methods</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{% for button_item in button_dict[route_group] %}
|
{% for button_item in button_dict[route_group] %}
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><button onclick="OpenLink('{{ button_item["link"] }}')">{{ button_item["label"] }}</a></button></td>
|
<td>
|
||||||
|
{% if button_item["button"] %}
|
||||||
|
<button onclick="location.href='{{ button_item["link"] }}'" type="button">{{ button_item["label"] }}</button>
|
||||||
|
{% else %}
|
||||||
|
<a>{{ button_item["link"] }}</a>
|
||||||
|
{% endif %}
|
||||||
|
</td>
|
||||||
|
<td><a>{{ button_item["methods"] }}</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -2,18 +2,18 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">What's On {{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</h4>
|
<h4 style="text-align: center;">What's On {{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</h4>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{% for epg_method in epg_methods %}
|
{% for epg_method in epg_methods %}
|
||||||
<button onclick="OpenLink('/guide?source={{ epg_method }}')">{{ epg_method }}</a></button>
|
<button onclick="location.href='/guide?source={{ epg_method }}'" type="button">{{ epg_method }}</button>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-scroll">
|
<table class="table-scroll">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
|
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
|
||||||
<th>Play</th>
|
<th>Play</th>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -26,34 +26,34 @@
|
|||||||
<th>Start Time (UTC)</th>
|
<th>Start Time (UTC)</th>
|
||||||
<th>End Time (UTC)</th>
|
<th>End Time (UTC)</th>
|
||||||
<th>Content Remaining Time</th>
|
<th>Content Remaining Time</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody class="body-half-screen">
|
<tbody class="body-half-screen">
|
||||||
{% for chan_dict in chan_guide_list %}
|
{% for chan_dict in chan_guide_list %}
|
||||||
<tr>
|
<tr>
|
||||||
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
|
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
|
||||||
<td>
|
<td>
|
||||||
{% if chan_dict["enabled"] %}
|
{% if chan_dict["enabled"] %}
|
||||||
<a href="{{ chan_dict["play_url"] }}">Play</a>
|
<a href="{{ chan_dict["m3u_url"] }}">Play</a>
|
||||||
{% else %}
|
{% else %}
|
||||||
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
|
<a href="{{ chan_dict["m3u_url"] }}" style="visibility:hidden">Play</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>{{ chan_dict["name"] }}</td>
|
<td>{{ chan_dict["name"] }}</td>
|
||||||
<td>{{ chan_dict["number"] }}</td>
|
<td>{{ chan_dict["number"] }}</td>
|
||||||
<td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
|
<td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
|
||||||
<td>{{ chan_dict["listing_title"] }}</td>
|
<td>{{ chan_dict["listing_title"] }}</td>
|
||||||
<td><img src="{{ chan_dict["listing_thumbnail"] }}" alt="{{ chan_dict["listing_title"] }}" width="100" height="100"></td>
|
<td><img src="{{ chan_dict["listing_thumbnail"] }}" alt="{{ chan_dict["listing_title"] }}" width="100" height="100"></td>
|
||||||
<td>{{ chan_dict["listing_description"] }}</td>
|
<td>{{ chan_dict["listing_description"] }}</td>
|
||||||
<td>{{ chan_dict["listing_time_start"] }}</td>
|
<td>{{ chan_dict["listing_time_start"] }}</td>
|
||||||
<td>{{ chan_dict["listing_time_end"] }}</td>
|
<td>{{ chan_dict["listing_time_end"] }}</td>
|
||||||
<td>{{ chan_dict["listing_remaining_time"] }}</td>
|
<td>{{ chan_dict["listing_remaining_time"] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -2,21 +2,21 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">fHDHR Status</h4>
|
<h4 style="text-align: center;">fHDHR Status</h4>
|
||||||
|
|
||||||
|
|
||||||
<td class="container">
|
<div class="container">
|
||||||
<table class="table-medium center">
|
<table class="table-medium center">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{% for key in list(fhdhr_status_dict.keys()) %}
|
{% for key in list(fhdhr_status_dict.keys()) %}
|
||||||
<tr>
|
<tr>
|
||||||
<td class="rTableCell">{{ key }}</td>
|
<td class="rTableCell">{{ key }}</td>
|
||||||
<td class="rTableCell">{{ fhdhr_status_dict[key] }}</td>
|
<td class="rTableCell">{{ fhdhr_status_dict[key] }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -7,7 +7,8 @@
|
|||||||
<h4 style="text-align: center;">Some Settings will require a manual restart.</h4>
|
<h4 style="text-align: center;">Some Settings will require a manual restart.</h4>
|
||||||
|
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
<button onclick="OpenLink('/api/settings?method=restart&instance_id={{ session["instance_id"] }}&redirect=%2Fsettings')">Restart fHDHR</a></button><p> Note: This may take some time, and you will have to refresh your page.</p>
|
<button onclick="location.href='/api/settings?method=restart&redirect=/settings'" type="button">Restart fHDHR</button>
|
||||||
|
<p> Note: This may take some time, and you will have to refresh your page.</p>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
@ -29,45 +30,40 @@
|
|||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
{% for config_item in list(web_settings_dict[config_section].keys()) %}
|
{% for config_item in list(web_settings_dict[config_section].keys()) %}
|
||||||
|
<tr>
|
||||||
<tr>
|
<td>{{ config_item }}</td>
|
||||||
<td>{{ config_item }}</td>
|
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
|
||||||
|
<td>
|
||||||
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
|
<form method="post" action="/api/settings?method=update&redirect=/settings">
|
||||||
|
<input type="hidden" name="config_section" value="{{ config_section }}">
|
||||||
<td>
|
<input type="hidden" name="config_name" value="{{ config_item }}">
|
||||||
<form method="post" action="/api/settings?method=update&redirect=%2Fsettings">
|
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
||||||
<input type="hidden" name="config_section" value="{{ config_section }}">
|
{% if web_settings_dict[config_section][config_item]["hide"] %}
|
||||||
<input type="hidden" name="config_name" value="{{ config_item }}">
|
<input type="text" size="25" name="config_value" value="**************">
|
||||||
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
{% else %}
|
||||||
{% if web_settings_dict[config_section][config_item]["hide"] %}
|
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
|
||||||
<input type="text" size="25" name="config_value" value="**************">
|
{% endif %}
|
||||||
{% else %}
|
</td>
|
||||||
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
|
<td style="display:flex;">
|
||||||
{% endif %}
|
<span style="margin:auto">
|
||||||
</td>
|
<input type="submit" value="Update">
|
||||||
<td style="display:flex;">
|
</form>
|
||||||
<span style="margin:auto">
|
</span>
|
||||||
<input type="submit" value="Update">
|
<form style="margin:auto">
|
||||||
</form>
|
<input type="hidden" name="config_section" value="{{ config_section }}">
|
||||||
</span>
|
<input type="hidden" name="config_name" value="{{ config_item }}">
|
||||||
<form style="margin:auto">
|
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
||||||
<input type="hidden" name="config_section" value="{{ config_section }}">
|
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
||||||
<input type="hidden" name="config_name" value="{{ config_item }}">
|
<input type="submit" value="Reset">
|
||||||
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
</form>
|
||||||
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
|
</td>
|
||||||
<input type="submit" value="Reset">
|
</tr>
|
||||||
</form>
|
{% endfor %}
|
||||||
</td>
|
</tbody>
|
||||||
|
</table>
|
||||||
</tr>
|
|
||||||
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Tools</h4>
|
<h4 style="text-align: center;">{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }} Tools</h4>
|
||||||
|
|
||||||
<form method="post" action="/api/tools?method=prettyjson&redirect=%2Ftools">
|
<form method="post" action="/api/tools?method=prettyjson&redirect=/tools">
|
||||||
<a data-th="URL"><input type="text" name="url" value=""></a>
|
<a data-th="URL"><input type="text" name="url" value=""></a>
|
||||||
<a data-th="Convert Json url to tabbbed"><input type="submit" value="Convert Json url to tabbbed"></a>
|
<a data-th="Convert Json url to tabbbed"><input type="submit" value="Convert Json url to tabbbed"></a>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">fHDHR Streams</h4>
|
<h4 style="text-align: center;">fHDHR Streams</h4>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-medium center action-col">
|
<table class="table-medium center action-col">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Channel</th>
|
<th>Channel</th>
|
||||||
<th>Method</th>
|
<th>Method</th>
|
||||||
@ -17,36 +17,36 @@
|
|||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% for tuner_dict in tuner_list %}
|
{% for tuner_dict in tuner_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ tuner_dict["number"] }}</td>
|
<td>{{ tuner_dict["number"] }}</td>
|
||||||
<td>{{ tuner_dict["status"] }}</td>
|
<td>{{ tuner_dict["status"] }}</td>
|
||||||
{% if tuner_dict["status"] in ["Active", "Acquired"] %}
|
{% if tuner_dict["status"] in ["Active", "Acquired"] %}
|
||||||
<td>{{ tuner_dict["channel_number"] }}</td>
|
<td>{{ tuner_dict["channel_number"] }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>N/A</td>
|
<td>N/A</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if tuner_dict["status"] == "Active" %}
|
{% if tuner_dict["status"] == "Active" %}
|
||||||
<td>{{ tuner_dict["method"] }}</td>
|
<td>{{ tuner_dict["method"] }}</td>
|
||||||
<td>{{ tuner_dict["play_duration"] }}</td>
|
<td>{{ tuner_dict["play_duration"] }}</td>
|
||||||
<td>{{ tuner_dict["downloaded"] }}</td>
|
<td>{{ tuner_dict["downloaded"] }}</td>
|
||||||
{% else %}
|
{% else %}
|
||||||
<td>N/A</td>
|
<td>N/A</td>
|
||||||
<td>N/A</td>
|
<td>N/A</td>
|
||||||
<td>N/A</td>
|
<td>N/A</td>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<td>
|
<td>
|
||||||
{% if tuner_dict["status"] != "Inactive" %}
|
{% if tuner_dict["status"] != "Inactive" %}
|
||||||
<button onclick="OpenLink('/api/tuners?method=close&tuner={{ tuner_dict["number"] }}&redirect=%2Ftuners')">Close</a></button>
|
<button onclick="location.href='/api/tuners?method=close&tuner={{ tuner_dict["number"] }}&redirect=/tuners'" type="button">Close</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if not tuner_scanning and tuner_dict["status"] == "Inactive" %}
|
{% if not tuner_scanning and tuner_dict["status"] == "Inactive" %}
|
||||||
<button onclick="OpenLink('/api/tuners?method=scan&tuner={{ tuner_dict["number"] }}&redirect=%2Ftuners')">Channel Scan</a></button>
|
<button onclick="location.href='/api/tuners?method=scan&tuner={{ tuner_dict["number"] }}&redirect=/tuners'" type="button">Channel Scan</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -2,21 +2,20 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">fHDHR Version Information</h4>
|
<h4 style="text-align: center;">fHDHR Version Information</h4>
|
||||||
|
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-medium center">
|
<table class="table-medium center">
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{% for key in list(version_dict.keys()) %}
|
||||||
{% for key in list(version_dict.keys()) %}
|
<tr>
|
||||||
<tr>
|
<td>{{ key }}</td>
|
||||||
<td>{{ key }}</td>
|
<td>{{ version_dict[key] }}</td>
|
||||||
<td>{{ version_dict[key] }}</td>
|
</tr>
|
||||||
</tr>
|
{% endfor %}
|
||||||
{% endfor %}
|
</tbody>
|
||||||
</tbody>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -2,41 +2,36 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">xmltv</h4>
|
<h4 style="text-align: center;">xmltv</h4>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<table class="table-medium center action-col">
|
<table class="table-medium center action-col">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
|
||||||
<th>Version</th>
|
|
||||||
<th>XMLTV Link</th>
|
|
||||||
<th>EPG Link</th>
|
|
||||||
<th>Actions</th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{% for epg_method in fhdhr.config.dict["epg"]["valid_epg_methods"] %}
|
|
||||||
{% if epg_method not in [None, "None"] %}
|
|
||||||
{% set epg_method_name = epg_method %}
|
|
||||||
{% if epg_method == "origin" %}
|
|
||||||
{% set epg_method_name = fhdhr.config.dict["main"]["dictpopname"] %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td> {{ epg_method_name }}</td>
|
<th>Version</th>
|
||||||
<td><a href="/api/xmltv?method=get&source={{ epg_method }}">{{ epg_method_name }}</a></td>
|
<th>XMLTV Link</th>
|
||||||
<td><a href="/api/epg?method=get&source={{ epg_method }}">{{ epg_method_name }}</a></td>
|
<th>EPG Link</th>
|
||||||
|
<th>Actions</th>
|
||||||
<td>
|
|
||||||
<button onclick="OpenLink('/api/xmltv?method=update&source={{ epg_method }}&redirect=%2Fxmltv')">Update</a></button>
|
|
||||||
<button onclick="OpenLink('/api/xmltv?method=clearcache&source={{ epg_method }}&redirect=%2Fxmltv')">Clear Cache</a></button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
{% for epg_method in fhdhr.config.dict["epg"]["valid_epg_methods"] %}
|
||||||
{% endif %}
|
{% if epg_method not in [None, "None"] %}
|
||||||
|
{% set epg_method_name = epg_method %}
|
||||||
{% endfor %}
|
{% if epg_method == "origin" %}
|
||||||
</body>
|
{% set epg_method_name = fhdhr.config.dict["main"]["dictpopname"] %}
|
||||||
|
{% endif %}
|
||||||
|
<tr>
|
||||||
|
<td> {{ epg_method_name }}</td>
|
||||||
|
<td><a href="/api/xmltv?method=get&source={{ epg_method }}">{{ epg_method_name }}</a></td>
|
||||||
|
<td><a href="/api/epg?method=get&source={{ epg_method }}">{{ epg_method_name }}</a></td>
|
||||||
|
<td>
|
||||||
|
<button onclick="location.href='/api/xmltv?method=update&source={{ epg_method }}&redirect=/xmltv'" type="button">Update</button>
|
||||||
|
<button onclick="location.href='/api/xmltv?method=clearcache&source={{ epg_method }}&redirect=/xmltv'" type="button">Clear Cache</button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
table {border: 1px solid black;}
|
||||||
|
th {border: 1px solid black;}
|
||||||
|
td {border: 1px solid black;}
|
||||||
|
|
||||||
.pull-right { float: right; }
|
.pull-right { float: right; }
|
||||||
|
|
||||||
.pull-left { float: left; }
|
.pull-left { float: left; }
|
||||||
|
|||||||
@ -2,19 +2,20 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
<h4 style="text-align: center;">{{ fhdhr.config.dict["main"]["servicename"] }} Status</h4>
|
<h4 style="text-align: center;">{{ fhdhr.config.dict["main"]["servicename"] }} Status</h4>
|
||||||
|
|
||||||
<table class="center" style="width:50%">
|
|
||||||
<tr>
|
|
||||||
<th></th>
|
|
||||||
<th></th>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
{% for key in list(origin_status_dict.keys()) %}
|
<div class="container">
|
||||||
<tr>
|
<table class="table-medium center">
|
||||||
<td>{{ key }}</td>
|
<tbody>
|
||||||
<td>{{ origin_status_dict[key] }}</td>
|
{% for key in list(origin_status_dict.keys()) %}
|
||||||
</tr>
|
<tr>
|
||||||
{% endfor %}
|
<td>{{ key }}</td>
|
||||||
|
<td>{{ origin_status_dict[key] }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user