1
0
mirror of https://github.com/fHDHR/fHDHR_NextPVR.git synced 2025-12-06 04:26:57 -05:00

Web Enhancements

This commit is contained in:
deathbybadaid 2021-01-08 09:29:15 -05:00
parent e003d502c2
commit d9e0cc13dd
14 changed files with 428 additions and 432 deletions

View File

@ -1,5 +1,7 @@
from flask import request, redirect, session
import urllib.parse
import threading
import time
class Settings():
@ -10,6 +12,9 @@ class Settings():
def __init__(self, fhdhr):
self.fhdhr = fhdhr
self.restart_url = "/api/settings?method=restart_actual"
self.restart_sleep = 5
def __call__(self, *args):
return self.get(*args)
@ -35,11 +40,18 @@ class Settings():
self.fhdhr.config.write(config_section, config_name, config_value)
elif method == "restart":
instance_id = request.args.get('instance_id', default=None, type=str)
if instance_id == session["instance_id"]:
session["restart"] = True
restart_thread = threading.Thread(target=self.restart_thread)
restart_thread.start()
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:
return redirect(redirect_url + "?retmessage=" + urllib.parse.quote("%s Success" % method))
else:
return "%s Success" % method
def restart_thread(self):
time.sleep(self.restart_sleep)
self.fhdhr.api.get(self.restart_url)

View File

@ -1,28 +1,28 @@
<html>
<head>
<title>{{ fhdhr.config.dict["fhdhr"]["friendlyname"] }}</title>
<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">
</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>
<button class="pull-left" onclick="OpenLink('/origin')">{{ fhdhr.config.dict["main"]["servicename"] }}</button>
</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 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"] %}
{% 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 %}
{% endfor %}
@ -50,29 +50,26 @@
{% endif %}
</form>
</div>
<hr align="center" width="100%">
</div>
<hr align="center" width="100%">
{% if fhdhr.config.dict["web_ui"]["cluster_bar"] %}
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
{% if locations %}
<div>
{% if fhdhr.config.dict["web_ui"]["cluster_bar"] %}
{% set locations = fhdhr.device.cluster.get_cluster_dicts_web() %}
{% if locations %}
<div>
{% 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 %}
</div>
<hr align="center" width="100%">
{% endif %}
</div>
<hr align="center" width="100%">
{% endif %}
{% endif %}
{% set retmessage = request.args.get('retmessage', default=None) %}
{% if retmessage %}
<p>{{ retmessage }}</p>
{% endif %}
{% set retmessage = request.args.get('retmessage', default=None) %}
{% if retmessage %}
<p>{{ retmessage }}</p>
{% endif %}
{% block content %}{% endblock %}
</body>
{% block content %}{% endblock %}
</body>
</html>
<script>
function OpenLink(NewURL) {window.open(NewURL, "_self");}
</script>

View File

@ -2,82 +2,82 @@
{% 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;">
<button onclick="OpenLink('/api/tuners?method=scan&redirect=%2Fchannels')">Force Channel Update</a></button><p> Note: This may take some time.</p>
</div>
<br>
<div style="text-align: center;">
<button onclick="location.href='/api/tuners?method=scan&redirect=/channels'" type="button">Force Channel Update</button>
<p> Note: This may take some time.</p>
</div>
<br>
<div class="container">
<table class="table-small center">
<tbody>
{% for key in list(channels_dict.keys()) %}
<tr>
<td>{{ key }}</td>
<td>{{ channels_dict[key] }}</td>
</tr>
{% endfor %}
</tbody>
<div class="container">
<table class="table-small center">
<tbody>
{% for key in list(channels_dict.keys()) %}
<tr>
<td>{{ key }}</td>
<td>{{ channels_dict[key] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<br>
<div style="text-align: center;">
<button onclick="OpenLink('/channels_editor')">Edit Channels</a></button>
</div>
<br>
<br>
<div style="text-align: center;">
<button onclick="location.href='/channels_editor'" type="button">Edit Channels</button>
</div>
<br>
<div class="container">
<div class="container">
<table class="table-scroll center small-first-col">
<thead>
<tr>
<th>Play</th>
<th>Channel Name</th>
<th>Channel CallSign</th>
<th>Channel Number</th>
<th>Channel Thumbnail</th>
<th>Enabled</th>
<th>Favorite</th>
</tr>
<tr>
<th>Play</th>
<th>Channel Name</th>
<th>Channel CallSign</th>
<th>Channel Number</th>
<th>Channel Thumbnail</th>
<th>Enabled</th>
<th>Favorite</th>
</tr>
</thead>
<tbody class="body-half-screen">
{% for chan_dict in channelslist %}
<tr>
<tbody class="body-half-screen">
{% for chan_dict in channelslist %}
<tr>
<td>
{% if chan_dict["enabled"] %}
<a href="{{ chan_dict["play_url"] }}">Play</a>
{% else %}
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
{% endif %}
</td>
<td>
{% if chan_dict["enabled"] %}
<a href="{{ chan_dict["play_url"] }}">Play</a>
{% else %}
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
{% endif %}
</td>
<td>{{ chan_dict["name"] }}</td>
<td>{{ chan_dict["callsign"] }}</td>
<td>{{ chan_dict["number"] }}</td>
<td>{{ chan_dict["name"] }}</td>
<td>{{ chan_dict["callsign"] }}</td>
<td>{{ chan_dict["number"] }}</td>
{% if chan_dict["thumbnail"] %}
<td><img src="{{ chan_dict["thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
{% else %}
<td>No Image Available</td>
{% endif %}
{% if chan_dict["thumbnail"] %}
<td><img src="{{ chan_dict["thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></td>
{% else %}
<td>No Image Available</td>
{% endif %}
{% if chan_dict["enabled"] %}
<td>Enabled</td>
{% else %}
<td>Disabled</td>
{% endif %}
{% if chan_dict["enabled"] %}
<td>Enabled</td>
{% else %}
<td>Disabled</td>
{% endif %}
{% if chan_dict["favorite"] %}
<td>Yes</td>
{% else %}
<td>No</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
{% if chan_dict["favorite"] %}
<td>Yes</td>
{% else %}
<td>No</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -1,129 +1,128 @@
{% extends "base.html" %}
{% block content %}
<body onload="brython({debug: 1, indexedDB: false})">
<script type="text/javascript" src="/brython.js"></script>
<script type="text/javascript" src="/brython_stdlib.js"></script>
<script type="text/python" id="enable0">
from browser import document, alert, window, bind
<body onload="brython({debug: 1, indexedDB: false})">
<script type="text/javascript" src="/brython.js"></script>
<script type="text/javascript" src="/brython_stdlib.js"></script>
<script type="text/python" id="enable0">
from browser import document, alert, window, bind
@bind("#enable_button", "click")
def enable_all(event):
for element in document.get(selector='input[type="checkbox"]'):
if element.name.endswith("enabled"):
if document["enable_button"].value == "0":
element.checked = False
element.value = False
else:
element.checked = True
element.value = True
@bind("#enable_button", "click")
def enable_all(event):
for element in document.get(selector='input[type="checkbox"]'):
if element.name.endswith("enabled"):
if document["enable_button"].value == "0":
element.checked = False
element.value = False
else:
element.checked = True
element.value = True
if document["enable_button"].value == "0":
document["enable_button"].value = "1"
document["enable_button"].text = "Enable All"
else:
document["enable_button"].value = "0"
document["enable_button"].text = "Disable All"
if document["enable_button"].value == "0":
document["enable_button"].value = "1"
document["enable_button"].text = "Enable All"
else:
document["enable_button"].value = "0"
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")
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=%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">
<div class="container">
<table class="table-scroll center text-edit-cols">
<thead>
<tr>
<th>Channel Name</th>
<th>Channel CallSign</th>
<th>Channel Number</th>
<th>Channel Thumbnail</th>
<th>Enabled</th>
<th>Favorite</th>
<th>Actions</th>
</tr>
<tr>
<th>Channel Name</th>
<th>Channel CallSign</th>
<th>Channel Number</th>
<th>Channel Thumbnail</th>
<th>Enabled</th>
<th>Favorite</th>
<th>Actions</th>
</tr>
</thead>
<tbody class="body-half-screen">
{% for chan_dict in channelslist %}
<tr>
<td><input type="hidden" name="id" class="channels" value={{ chan_dict["id"] }}>
<input type="text" class="channels" name="name" value="{{ chan_dict["name"] }}"></td>
<td><input type="text" class="channels" name="callsign" value="{{ chan_dict["callsign"] }}"></td>
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
{% if chan_dict["enabled"] %}
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
{% else %}
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
{% endif %}
{% if chan_dict["favorite"] %}
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
{% else %}
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
{% endif %}
<td>
<form method="post" action="/api/channels?method=update&redirect=%2Fchannels_editor">
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
<input type="hidden" class="reset" name="callsign" value="{{ chan_dict["origin_callsign"] }}">
<input type="hidden" class="reset" name="number" value="{{ chan_dict["origin_number"] }}">
<input type="hidden" class="reset" name="thumbnail" value="{{ chan_dict["origin_thumbnail"] }}">
<input type="hidden" class="reset" name="enabled" value=True>
<input type="submit" value="Reset">
</form>
</td>
</tr>
{% endfor %}
</tbody>
<tbody class="body-half-screen">
{% for chan_dict in channelslist %}
<tr>
<td><input type="hidden" name="id" class="channels" value={{ chan_dict["id"] }}>
<input type="text" class="channels" name="name" value="{{ chan_dict["name"] }}">
</td>
<td><input type="text" class="channels" name="callsign" value="{{ chan_dict["callsign"] }}"></td>
<td><input type="text" class="channels" name="number" value="{{ chan_dict["number"] }}"></td>
<td><input type="text" class="channels" name="thumbnail" value="{{ chan_dict["thumbnail"] }}"></td>
{% if chan_dict["enabled"] %}
<td><input type="checkbox" class="channels" name="enabled" value=True checked></td>
{% else %}
<td><input type="checkbox" class="channels" name="enabled" value=True ></td>
{% endif %}
{% if chan_dict["favorite"] %}
<td><input type="checkbox" class="channels" name="favorite" value=1 checked></td>
{% else %}
<td><input type="checkbox" class="channels" name="favorite" value=1 ></td>
{% endif %}
<td>
<form method="post" action="/api/channels?method=update&redirect=/channels_editor">
<input type="hidden" class="reset" name="id" value="{{ chan_dict["id"] }}">
<input type="hidden" class="reset" name="name" value="{{ chan_dict["origin_name"] }}">
<input type="hidden" class="reset" name="callsign" value="{{ chan_dict["origin_callsign"] }}">
<input type="hidden" class="reset" name="number" value="{{ chan_dict["origin_number"] }}">
<input type="hidden" class="reset" name="thumbnail" value="{{ chan_dict["origin_thumbnail"] }}">
<input type="hidden" class="reset" name="enabled" value=True>
<input type="submit" value="Reset">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -2,51 +2,48 @@
{% block content %}
<h4 style="text-align: center;">Cluster/SSDP</h4>
{% if not fhdhr.config.dict["fhdhr"]["discovery_address"] %}
<p style="text-align: center;">Discovery Address must be set for Cluster/SSDP</p>
{% else %}
<h4 style="text-align: center;">Cluster/SSDP</h4>
{% if not fhdhr.config.dict["fhdhr"]["discovery_address"] %}
<p style="text-align: center;">Discovery Address must be set for Cluster/SSDP</p>
{% else %}
<div style="text-align: center;">
<button onclick="OpenLink('/api/cluster?method=scan&redirect=%2Fcluster')">Force Scan</a></button>
<button onclick="OpenLink('/api/cluster?method=alive&redirect=%2Fcluster')">Send Alive</a></button>
<button onclick="OpenLink('/api/cluster?method=disconnect&redirect=%2Fcluster')">Disconnect</a></button>
</div>
<br>
<div style="text-align: center;">
<button onclick="location.href='/api/cluster?method=scan&redirect=/cluster'" type="button">Force Scan</button>
<button onclick="location.href='/api/cluster?method=alive&redirect=/cluster'" type="button">Send Alive</button>
<button onclick="location.href='/api/cluster?method=disconnect&redirect=/cluster'" type="button">Disconnect</button>
</div>
<br>
<div class="container">
<table class="table-medium center action-col">
<tbody>
<tr>
<th>Name</th>
<th>Location</th>
<th>Joined</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>
<table class="table-medium center action-col">
<tbody>
<tr>
<th>Name</th>
<th>Location</th>
<th>Joined</th>
<th>Options</th>
</tr>
{% endfor %}
</tbody>
</table>
{% 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="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>
{% endif %}
{% endif %}
{% endblock %}

View File

@ -16,13 +16,10 @@
</tr>
</thead>
<tbody>
{% for button_item in button_dict[route_group] %}
<tr>
<td><button onclick="OpenLink('{{ button_item["link"] }}')">{{ button_item["label"] }}</a></button></td>
<td><button onclick="location.href='{{ button_item["link"] }}'" type="button">{{ button_item["label"] }}</button></td>
</tr>
{% endfor %}
</tbody>
</table>

View File

@ -2,18 +2,18 @@
{% 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>
{% for epg_method in epg_methods %}
<button onclick="OpenLink('/guide?source={{ epg_method }}')">{{ epg_method }}</a></button>
{% endfor %}
</p>
<p>
{% for epg_method in epg_methods %}
<button onclick="location.href='/guide?source={{ epg_method }}'" type="button">{{ epg_method }}</button>
{% endfor %}
</p>
<div class="container">
<div class="container">
<table class="table-scroll">
<thead>
<tr>
<thead>
<tr>
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
<th>Play</th>
{% endif %}
@ -26,34 +26,34 @@
<th>Start Time (UTC)</th>
<th>End Time (UTC)</th>
<th>Content Remaining Time</th>
</tr>
</thead>
</tr>
</thead>
<tbody class="body-half-screen">
{% for chan_dict in chan_guide_list %}
<tr>
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
<td>
{% if chan_dict["enabled"] %}
<a href="{{ chan_dict["play_url"] }}">Play</a>
{% else %}
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
{% endif %}
</td>
{% endif %}
<td>{{ chan_dict["name"] }}</td>
<td>{{ chan_dict["number"] }}</td>
<td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></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>{{ chan_dict["listing_description"] }}</td>
<td>{{ chan_dict["listing_time_start"] }}</td>
<td>{{ chan_dict["listing_time_end"] }}</td>
<td>{{ chan_dict["listing_remaining_time"] }}</td>
</tr>
{% endfor %}
</tbody>
<tbody class="body-half-screen">
{% for chan_dict in chan_guide_list %}
<tr>
{% if source in ["blocks", "origin", fhdhr.config.dict["main"]["dictpopname"]] %}
<td>
{% if chan_dict["enabled"] %}
<a href="{{ chan_dict["play_url"] }}">Play</a>
{% else %}
<a href="{{ chan_dict["play_url"] }}" style="visibility:hidden">Play</a>
{% endif %}
</td>
{% endif %}
<td>{{ chan_dict["name"] }}</td>
<td>{{ chan_dict["number"] }}</td>
<td><img src="{{ chan_dict["chan_thumbnail"] }}" alt="{{ chan_dict["name"] }}" width="100" height="100"></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>{{ chan_dict["listing_description"] }}</td>
<td>{{ chan_dict["listing_time_start"] }}</td>
<td>{{ chan_dict["listing_time_end"] }}</td>
<td>{{ chan_dict["listing_remaining_time"] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -2,21 +2,21 @@
{% 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">
<tbody>
<tbody>
{% for key in list(fhdhr_status_dict.keys()) %}
<tr>
<td class="rTableCell">{{ key }}</td>
<td class="rTableCell">{{ fhdhr_status_dict[key] }}</td>
</tr>
{% endfor %}
{% for key in list(fhdhr_status_dict.keys()) %}
<tr>
<td class="rTableCell">{{ key }}</td>
<td class="rTableCell">{{ fhdhr_status_dict[key] }}</td>
</tr>
{% endfor %}
</tbody>
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -7,7 +7,8 @@
<h4 style="text-align: center;">Some Settings will require a manual restart.</h4>
<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>
<br>
@ -29,45 +30,40 @@
<th>Action</th>
</tr>
</thead>
<tbody>
<tbody>
{% for config_item in list(web_settings_dict[config_section].keys()) %}
<tr>
<td>{{ config_item }}</td>
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
<td>
<form method="post" action="/api/settings?method=update&redirect=%2Fsettings">
<input type="hidden" name="config_section" value="{{ config_section }}">
<input type="hidden" name="config_name" value="{{ config_item }}">
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
{% if web_settings_dict[config_section][config_item]["hide"] %}
<input type="text" size="25" name="config_value" value="**************">
{% else %}
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
{% endif %}
</td>
<td style="display:flex;">
<span style="margin:auto">
<input type="submit" value="Update">
</form>
</span>
<form style="margin:auto">
<input type="hidden" name="config_section" value="{{ config_section }}">
<input type="hidden" name="config_name" value="{{ config_item }}">
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
<input type="submit" value="Reset">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% for config_item in list(web_settings_dict[config_section].keys()) %}
<tr>
<td>{{ config_item }}</td>
<td>{{ web_settings_dict[config_section][config_item]["value_default"] }}</td>
<td>
<form method="post" action="/api/settings?method=update&redirect=/settings">
<input type="hidden" name="config_section" value="{{ config_section }}">
<input type="hidden" name="config_name" value="{{ config_item }}">
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
{% if web_settings_dict[config_section][config_item]["hide"] %}
<input type="text" size="25" name="config_value" value="**************">
{% else %}
<input type="text" size="25" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value"] }}">
{% endif %}
</td>
<td style="display:flex;">
<span style="margin:auto">
<input type="submit" value="Update">
</form>
</span>
<form style="margin:auto">
<input type="hidden" name="config_section" value="{{ config_section }}">
<input type="hidden" name="config_name" value="{{ config_item }}">
<input type="hidden" name="config_value" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
<input type="hidden" name="config_default" value="{{ web_settings_dict[config_section][config_item]["value_default"] }}">
<input type="submit" value="Reset">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endfor %}

View File

@ -2,11 +2,11 @@
{% 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">
<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>
</form>
<form method="post" action="/api/tools?method=prettyjson&redirect=/tools">
<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>
</form>
{% endblock %}

View File

@ -2,12 +2,12 @@
{% 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">
<tbody>
<tr>
<tbody>
<tr>
<th>Status</th>
<th>Channel</th>
<th>Method</th>
@ -17,36 +17,36 @@
<th>Action</th>
</tr>
{% for tuner_dict in tuner_list %}
<tr>
<td>{{ tuner_dict["number"] }}</td>
<td>{{ tuner_dict["status"] }}</td>
{% if tuner_dict["status"] in ["Active", "Acquired"] %}
<td>{{ tuner_dict["channel_number"] }}</td>
{% else %}
<td>N/A</td>
{% endif %}
{% if tuner_dict["status"] == "Active" %}
<td>{{ tuner_dict["method"] }}</td>
<td>{{ tuner_dict["play_duration"] }}</td>
<td>{{ tuner_dict["downloaded"] }}</td>
{% else %}
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
{% endif %}
<td>
{% for tuner_dict in tuner_list %}
<tr>
<td>{{ tuner_dict["number"] }}</td>
<td>{{ tuner_dict["status"] }}</td>
{% if tuner_dict["status"] in ["Active", "Acquired"] %}
<td>{{ tuner_dict["channel_number"] }}</td>
{% else %}
<td>N/A</td>
{% endif %}
{% if tuner_dict["status"] == "Active" %}
<td>{{ tuner_dict["method"] }}</td>
<td>{{ tuner_dict["play_duration"] }}</td>
<td>{{ tuner_dict["downloaded"] }}</td>
{% else %}
<td>N/A</td>
<td>N/A</td>
<td>N/A</td>
{% endif %}
<td>
{% 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 %}
{% 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 %}
</td>
</tr>
{% endfor %}
</tbody>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -2,21 +2,20 @@
{% 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">
<tbody>
{% for key in list(version_dict.keys()) %}
<tr>
<td>{{ key }}</td>
<td>{{ version_dict[key] }}</td>
</tr>
{% endfor %}
</tbody>
<tbody>
{% for key in list(version_dict.keys()) %}
<tr>
<td>{{ key }}</td>
<td>{{ version_dict[key] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}

View File

@ -2,41 +2,36 @@
{% 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">
<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 %}
<tbody>
<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="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>
<th>Version</th>
<th>XMLTV Link</th>
<th>EPG Link</th>
<th>Actions</th>
</tr>
{% endif %}
{% endfor %}
</body>
{% 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>
<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>
</div>
</div>
{% endblock %}

View File

@ -1,3 +1,7 @@
table {border: 1px solid black;}
th {border: 1px solid black;}
td {border: 1px solid black;}
.pull-right { float: right; }
.pull-left { float: left; }
@ -47,7 +51,7 @@
/*width:100%; */
display: block;
empty-cells: show;
/* Decoration */
border-spacing: 0;
border: 1px solid;
@ -78,7 +82,7 @@
}
.table-settings thead{
background-color: #f1f1f1;
background-color: #f1f1f1;
position:relative;
display: block;
width:100%;
@ -103,11 +107,11 @@
padding: .25rem;
}
.table-scroll thead{
background-color: #f1f1f1;
background-color: #f1f1f1;
position:relative;
display: block;
width:100%;
overflow-y: scroll;
overflow-y: scroll;
}
.table-scroll tbody{
@ -149,7 +153,7 @@
}
.action-col td:last-child{
flex:1;
flex:1;
}
.table-small tbody tr:nth-child(2n){