-
Notifications
You must be signed in to change notification settings - Fork 8
/
timers.html
108 lines (104 loc) · 2.8 KB
/
timers.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="application-name" content="TVHadmin">
<link rel="manifest" href="manifest.webmanifest" crossorigin="use-credentials">
<title>TVHadmin - Timers</title>
<script src="include.js"></script>
<script>
async function get_autorecs() {
const response = await fetch("/api/dvr/autorec/grid?limit=9999");
const recs = await response.json();
let ret = {};
recs.entries.forEach(function(r) {
ret[r.uuid] = r.serieslink;
});
return ret;
}
function delete_timer(r, uuid, running) {
event.preventDefault();
if (running) {
var url = `/api/dvr/entry/stop?uuid=${uuid}`;
}
else {
var url = `/api/dvr/entry/cancel?uuid=${uuid}`;
}
fetch(url).then(response => {
if (response.ok) {
if (cookies.CLASHDET) location.reload();
else {
var i = r.parentNode.parentNode.rowIndex;
document.getElementById("list").deleteRow(i);
}
}
});
return;
}
function toggle(event, uuid, enabled) {
let mode = !enabled;
let data = encodeURIComponent(`[{"enabled": ${mode}, "uuid": "${uuid}"}]`);
fetch(`/api/idnode/save?node=${data}`).then(response => {
if (response.ok) {
if (cookies.CLASHDET) location.reload();
}
});
return;
}
async function get_ms_stop(t){
const epg = await get_epg(t.channelname, t.stop, t.stop + 10800);
var ret = t.stop;
epg.forEach(function(e) {
if (e.episodeUri == t.uri) ret = e.stop;
});
return ret;
}
</script>
</head>
<body>
<div id="container">
<div id="navigation">
<div class="logo">
<img src="images/logo.png" alt="TVHeadend Logo" width="150">
</div>
<div class="nav_bar">
</div>
</div>
<div id='layout'>
<div id='banner'>
<table>
<tr>
<td class='col_title'><div id='mobmenu'>☰</div> <h1>Timers</h1></td>
</tr>
</table>
</div>
<div id='wrapper'>
<div id='content'>
<table class='list' id='list'>
<tr class='heading'>
<td class='col_info'></td>
<td class='col_channel'><h2>Channel</h2></td>
<td class='col_date'><h2>Date</h2></td>
<td class='wideonly col_start'><h2>Start</h2></td>
<td class='wideonly col_stop'><h2>Stop</h2></td>
<td class='col_name'><h2>Name</h2></td>
<td class='col_channel'><h2>Mode</h2></td>
<td class='col_delete'><h2>En</h2></td>
<td class='col_delete'></td>
</tr>
</table>
<div id='clash'>
</div>
</div>
</div>
</div>
</div>
<script>
const scriptTag = document.createElement("script");
if (cookies.CLASHDET == 1) scriptTag.src = "timers1.js";
else scriptTag.src = "timers2.js";
document.body.appendChild(scriptTag);
</script>
</body>
</html>