diff --git a/data/www/templates/base.html b/data/www/templates/base.html new file mode 100644 index 0000000..ec3dab1 --- /dev/null +++ b/data/www/templates/base.html @@ -0,0 +1,54 @@ + +
+{{ retmessage }}
+ {% endif %} + + {% block content %}{% endblock %} + + + diff --git a/data/www/templates/cluster.html b/data/www/templates/cluster.html new file mode 100644 index 0000000..caa41ac --- /dev/null +++ b/data/www/templates/cluster.html @@ -0,0 +1,50 @@ +{% extends "base.html" %} + +{% block content %} + +Discovery Address must be set for SSDP/Cluster
+ {% else %} + +| Name | +Location | +Joined | +Options | +||||||
|---|---|---|---|---|---|---|---|---|---|
| {{ location["name"] }} | +{{ location["location"] }} | +{{ location["joined"] }} | + +
+
+
+ {% if location["joined"] in ["True", "False"] %}
+
+ {% endif %}
+
+ {% if location["joined"] == "True" %}
+
+ {% elif location["joined"] == "False" %}
+
+ {% endif %}
+
+
+ |
+
| Play | +Channel Name | +Channel Number | +Channel Thumbnail | +Content Title | +Content Thumbnail | +Content Description | +Content Remaining Time | +||
|---|---|---|---|---|---|---|---|---|---|
| Play + | {{ chan_dict["name"] }} | +{{ chan_dict["number"] }} | +{{ chan_dict["listing_title"] }} | +{{ chan_dict["listing_description"] }} | +{{ chan_dict["remaining_time"] }} | +
| + | + | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| {{ key }} | +{{ fhdhr_status_dict[key] }} | +
| + | + | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| {{ key }} | +{{ origin_status_dict[key] }} | +
| Tuner | +Status | +Channel | +Method | +Time Active | +Options | +||||
|---|---|---|---|---|---|---|---|---|---|
| {{ tuner_dict["number"] }} | +{{ tuner_dict["status"] }} | + {% if tuner_dict["status"] == "Active" %} +{{ tuner_dict["channel_number"] }} | +{{ tuner_dict["method"] }} | +{{ tuner_dict["play_duration"] }} | + {% else %} +N/A | +N/A | +N/A | + {% endif %} +
+
+ {% if tuner_dict["status"] in ["Active", "Acquired"] %}
+
+ {% endif %}
+
+ |
+
| + | + | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| {{ key }} | +{{ version_dict[key] }} | +
| Version | +XMLTV Link | +EPG Link | +Options | +||||||
|---|---|---|---|---|---|---|---|---|---|
| {{ epg_method_name }} | +{{ epg_method_name }} | +{{ epg_method_name }} | +
+
+
+
+
+ |
+
| Name | \n") - fakefile.write("Location | \n") - fakefile.write("Joined | \n") - fakefile.write("Options | \n") - fakefile.write("||||||
|---|---|---|---|---|---|---|---|---|---|
| %s | \n" % (str(location_name))) + location_dict = { + "name": location_name, + "location": location, + "joined": str(fhdhr_list[location]["Joined"]), + "url_query": urllib.parse.quote(location) + } + locations_list.append(location_dict) - fakefile.write("%s | \n" % (str(location))) - - fakefile.write("%s | \n" % (str(fhdhr_list[location]["Joined"]))) - - fakefile.write("\n")
- fakefile.write(" \n")
- location_url_query = urllib.parse.quote(location)
- fakefile.write(
- " \n" %
- (location, "Visit"))
- if not fhdhr_list[location]["Joined"]:
- fakefile.write(
- " \n" %
- ("/api/cluster?method=add&location=" + location_url_query + "&redirect=%2Fcluster", "Add"))
- else:
- fakefile.write(
- " \n" %
- ("/api/cluster?method=del&location=" + location_url_query + "&redirect=%2Fcluster", "Remove"))
- fakefile.write(" \n")
- fakefile.write(" | \n")
-
- fakefile.write("
| Play | \n") - fakefile.write("Channel Name | \n") - fakefile.write("Channel Number | \n") - fakefile.write("Channel Thumbnail | \n") - fakefile.write("Content Title | \n") - fakefile.write("Content Thumbnail | \n") - fakefile.write("Content Description | \n") - fakefile.write("Content Remaining Time | \n") - fakefile.write("||
|---|---|---|---|---|---|---|---|---|---|
| %s\n" % (play_url, "Play")) - fakefile.write(" | %s | \n" % (channel["name"])) - fakefile.write("%s | \n" % (channel["number"])) - fakefile.write("%s | \n" % (channel["listing"][0]["title"])) - fakefile.write("%s | \n" % (channel["listing"][0]["description"])) - fakefile.write("%s | \n" % (str(remaining_time))) - fakefile.write("
| \n") - fakefile.write(" | \n") - fakefile.write(" | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| %s | \n" % (guts[0])) - fakefile.write("%s | \n" % (guts[1])) - fakefile.write("
| \n") - fakefile.write(" | \n") - fakefile.write(" | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| %s | \n" % (str(key))) - fakefile.write("%s | \n" % (str(origin_status_dict[key]))) - fakefile.write("||||||||
| %s | \n" % ("Total Channels")) - fakefile.write("%s | \n" % (str(total_channels))) - fakefile.write("
| Tuner | \n") - fakefile.write("Status | \n") - fakefile.write("Channel | \n") - fakefile.write("Method | \n") - fakefile.write("Time Active | \n") - fakefile.write("Options | \n") - fakefile.write("||||
|---|---|---|---|---|---|---|---|---|---|
| %s | \n" % (str(tuner))) - fakefile.write("%s | \n" % (str(tuner_status[tuner]["status"]))) + tuner_dict = { + "number": str(tuner), + "status": str(tuner_status[tuner]["status"]), + } if tuner_status[tuner]["status"] == "Active": - try: - channel_name = tuner_status[tuner]["epg"]["name"] - channel_number = tuner_status[tuner]["epg"]["number"] - channel_thumbnail = tuner_status[tuner]["epg"]["thumbnail"] - fakefile.write("%s | \n" % (
- channel_name, channel_thumbnail, channel_name, str(channel_number)))
- except TypeError:
- fakefile.write(" %s | \n" % (str(tuner_status[tuner]["channel"]))) - fakefile.write("%s | \n" % (str(tuner_status[tuner]["method"]))) - fakefile.write("%s | \n" % (str(tuner_status[tuner]["Play Time"]))) - else: - fakefile.write("%s | \n" % "N/A") - fakefile.write("%s | \n" % "N/A") - fakefile.write("%s | \n" % "N/A") + tuner_dict["channel_number"] = tuner_status[tuner]["channel"] + tuner_dict["method"] = tuner_status[tuner]["method"] + tuner_dict["play_duration"] = str(tuner_status[tuner]["Play Time"]) - fakefile.write("\n")
- fakefile.write(" \n")
+ tuner_list.append(tuner_dict)
- if tuner_status[tuner]["status"] in ["Active", "Acquired"]:
- fakefile.write(
- " \n" %
- ("/api/watch?method=close&tuner=" + str(tuner) + "&redirect=%2Fstreams", "Close"))
- fakefile.write(" \n")
- fakefile.write(" | \n")
-
- fakefile.write("
| \n") - fakefile.write(" | \n") - fakefile.write(" | ||
|---|---|---|---|
| %s | \n" % (str(item[0]))) - fakefile.write("%s | \n" % (str(item[1]))) - fakefile.write("
| Version | \n") - fakefile.write("XMLTV Link | \n") - fakefile.write("EPG Link | \n") - fakefile.write("Options | \n") - fakefile.write("
|---|---|---|---|
| %s | \n" % (epg_method_name)) - fakefile.write("%s\n" % ("/api/xmltv?method=get&source=" + epg_method, epg_method_name)) - fakefile.write(" | %s\n" % ("/api/epg?method=get&source=" + epg_method, epg_method_name)) - - fakefile.write(" | \n")
- fakefile.write(" \n")
- fakefile.write(
- " \n" %
- ("/api/xmltv?method=update&source=" + epg_method + "&redirect=%2Fxmltv", "Update"))
- fakefile.write(
- " \n" %
- ("/api/xmltv?method=clearcache&source=" + epg_method + "&redirect=%2Fxmltv", "Clear Cache"))
- fakefile.write(" \n")
- fakefile.write(" | \n")
-
- fakefile.write("