1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
\r
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
\r
5 <title>pyTivo Web Configuration</title>
\r
6 <script language="javascript" type="text/javascript">
\r
7 function fillBlank(){
\r
8 var texts=document.getElementsByTagName('input');
\r
9 for (var i_tem = 0; i_tem < texts.length; i_tem++){
\r
10 if (texts[i_tem].value==''){
\r
11 texts[i_tem].value=' ';
\r
15 function switchDiv(pass, type){
\r
19 function hideallids(type){
\r
20 //loop through the array and hide each element by id
\r
21 var divs = document.getElementsByTagName('div');
\r
22 for (var i=0;i<divs.length;i++){
\r
23 if(divs[i].id.match(type)){
\r
24 hideDiv(divs[i].id);
\r
28 function hideDiv(pass) {
\r
29 var divs = document.getElementsByTagName('div');
\r
30 for(i=0;i<divs.length;i++){
\r
31 if(divs[i].id.match(pass)){//if they are 'see' divs
\r
32 if (document.getElementById){// DOM3 = IE5, NS6
\r
33 divs[i].style.visibility="hidden";// show/hide
\r
36 if (document.layers){ // Netscape 4
\r
37 document.layers[divs[i]].display = 'hidden';
\r
40 document.all.hideshow.divs[i].visibility = 'hidden';
\r
46 function showDiv(pass) {
\r
47 var divs = document.getElementsByTagName('div');
\r
48 for(i=0;i<divs.length;i++){
\r
49 if(divs[i].id == pass){
\r
50 if (document.getElementById){
\r
51 divs[i].style.visibility="";
\r
54 if (document.layers){ // Netscape 4
\r
55 document.layers[divs[i]].display = '';
\r
58 document.all.hideshow.divs[i].visibility = '';
\r
64 function deleteSection(id){
\r
65 if (select_section.section.options[id].text == 'Global Server Settings'){
\r
66 alert('Delete Error:\n\nSorry the Global Server Settings Section is required for pyTivo to run and cannot be deleted');
\r
69 var name = select_section.section.options[id].text;
\r
70 var answer = confirm("Are you sure you wish to delete the '" + name + "' Section?")
\r
72 switchDiv('set-delete', 'set-');
\r
73 select_section.section.options[id] = null;
\r
74 var field = document.getElementById(name).value;
\r
75 document.getElementById(field).value = 'Delete_Me';
\r
80 function resetpyTivo(){
\r
81 var answer = confirm("Are you sure you wish to reset the pyTivo Server? Any unsaved changes will be lost!")
\r
83 window.location="/TiVoConnect?Command=Reset&Container=$quote($container)"
\r
86 function showData(form) {
\r
90 inputs = form.getElementsByTagName("input");
\r
91 for (i = 0; i < inputs.length; i++){
\r
92 if (inputs[i].type == 'text' && re.exec(inputs[i].value)){
\r
93 setting = inputs[i].name;
\r
98 var map = document.getElementById('Section_Map').value.split(']');
\r
100 splitSetting = setting.split('.');
\r
101 for(i=0;i<map.length;i++){
\r
102 key = map[i].split('|');
\r
103 //buffer += key[0] + "---" + key[1] + "===" + splitSetting[0] + "\n";
\r
104 if (splitSetting[0] == 'Server'){
\r
105 section = 'server';
\r
108 if (key[0] == splitSetting[0]){
\r
113 alert("Invalid Entry:\nSorry these are not allowed \n[]<>|");
\r
114 switchDiv('set-' + section, 'set-');
\r
115 document.getElementById(setting).select();
\r
119 document.config.submit();
\r
121 function saveNotify(){
\r
122 document.getElementById('B1').style.fontWeight= 'bold';
\r
123 document.getElementById('B2').disabled = true;
\r
127 <body style="background-color: rgb(250, 250, 250);">
\r
129 <p align="center"><font size="6">pyTivo Web
\r
130 Configuration</font> <a href="javascript:switchDiv('help-instructions', 'help-');">help</a></p>
\r
132 <table style="border: 1px solid rgb(220, 220, 220);background-color: rgb(255, 255, 255);text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="4">
\r
138 <td style="border-right: 1px dotted rgb(153, 153, 153); vertical-align: top;">
\r
139 <div id="leftframe" style="position: relative; text-align: center; width: 200px;">
\r
140 <form name="select_section">Sections
\r
141 <select name="section" size="7">
\r
142 <option value="set-server">Global Server Settings</option>
\r
143 #for $name, $data in $shares_data
\r
144 <option value="set-$name">$name</option>
\r
146 #for $name, $data in $tivos_data
\r
147 <option value="set-$name">$name</option>
\r
151 <input name="B3" value="Edit Section" type="button" onclick="switchDiv(select_section.section.options[select_section.section.selectedIndex].value, 'set-');return true;">
\r
152 <input name="B4" value="Delete Section" type="button" onclick="deleteSection(select_section.section.selectedIndex)">
\r
153 <input name="B5" value="Add Section" type="button" onclick="switchDiv('set-add', 'set-');return true;"></form>
\r
156 <form method="post">
\r
157 <p align="center"><input name="B1" id="B1" value="Save Changes" type="button" onclick="showData(document.config);return true;">
\r
158 <input id="B2" name="B2" value="Soft Reset pyTivo" type="button" onclick="resetpyTivo();"></p>
\r
162 <a href="javascript:alert('This feature is not available yet');">View Raw File</a> </div>
\r
166 <td style="vertical-align: top;">
\r
167 <div id="settings" style="width: 300px; overflow: scroll; height: 450px; position: relative;">
\r
168 <form name="config" method="GET" action="TiVoConnect" onsubmit="fillBlank();showData(this);">
\r
169 <input type="hidden" name="Command" value="UpdateSettings">
\r
170 <input type="hidden" name="Container" value="$container">
\r
171 <div id="set-server" style="width: 280px; text-align: center;position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
172 <b>Global Server Settings</b><br>
\r
173 <hr style="width: 100%; height: 2px;">
\r
174 <table align="center">
\r
176 #for $key in $server_known
\r
179 <tr style="background-color: rgb(250, 250, 250);">
\r
184 #if $key in $server_data
\r
185 $key :</td><td><input size="20" id="Server.$key" name="Server.$key" value="$server_data[$key]" onChange="saveNotify();" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
188 $key :</td><td><input size="20" id="Server.$key" name="Server.$key" value="" onChange="saveNotify();" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
193 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">User Defined Settings:</td></tr>
\r
195 #for $key in $server_data
\r
196 #if not $key in $server_known
\r
199 <tr style="background-color: rgb(250, 250, 250);">
\r
203 <td> $key :</td><td>
\r
204 <input size="20" id="Server.$key" name="Server.$key" value="$server_data[$key]" onChange="saveNotify();" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
209 <div style="width: 280px; position: relative;">
\r
210 <div id="add-server-button" style="width: 280px; position: absolute; position: absolute; left: 0px; top: 0px;">
\r
213 <input type="button" value="Add Setting" onclick="switchDiv('add-server-field', 'add-server-');return true;">
\r
216 <div id="add-server-field" style="position: absolute; position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
217 <table style="width: 265px;">
\r
218 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">Add a Setting</td></tr>
\r
219 <tr><td>Setting Name:</td><td>Setting Value:</td></tr>
\r
220 <tr><td><input size="16" id="Server.new_settting" name="Server.new__setting" onChange="saveNotify();" type="text" value=""></td><td><input size="16" type="text" onChange="saveNotify();" id="Server.new_value" name="Server.new__value" value=""></td></tr>
\r
225 #set $section_count = 0
\r
226 #set $section_map = ''
\r
227 #for $name, $data in $shares_data
\r
228 #set $section_count += 1
\r
229 #set $section_number = 'section-' + str($section_count)
\r
230 <input type="hidden" name="$name" id="$name" value="$section_number">
\r
231 #set $section_map += $section_number + '|' + $name + ']'
\r
232 <div id="set-$name" style="text-align: center;position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
233 [<input size="20" onChange="saveNotify();" id="$section_number" name="$section_number" value="$name">]<br>
\r
234 <hr style="width: 100%; height: 2px;"><table align="center">
\r
236 #for $key in $shares_known
\r
239 <tr style="background-color: rgb(250, 250, 250);">
\r
244 <td>$key :</td><td><input onChange="saveNotify();" size="20" id="$section_number.$key" name="$section_number.$key" value="$data[$key]" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
247 <td>$key : </td><td><input onChange="saveNotify();" size="20" id="$section_number.$key" name="$section_number.$key" value="" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
253 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">User Defined Settings:</td></tr>
\r
255 #for $key in $data
\r
256 #if not $key in $shares_known
\r
259 <tr style="background-color: rgb(250, 250, 250);">
\r
263 <td> $key : </td><td>
\r
264 <input size="20" onChange="saveNotify();" id="$section_number.$key" name="$section_number.$key" value="$data[$key]" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
269 <div style="position: relative;">
\r
270 <div id="add-$name-button" style="width: 280px; position: absolute; position: absolute; left: 0px; top: 0px;">
\r
273 <input type="button" value="Add Setting" onclick="switchDiv('add-$name-field', 'add-$name-');return true;">
\r
276 <div id="add-$name-field" style="position: absolute; position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
277 <table style="width: 265px;">
\r
278 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">Add a Setting</td></tr>
\r
279 <tr><td>Setting Name:</td><td>Setting Value:</td></tr>
\r
280 <tr><td><input onChange="saveNotify();" size="16" id="$(section_number).new__setting" name="$(section_number).new__setting" type="text" value=""></td><td><input onChange="saveNotify();" size="16" type="text" id="$(section_number).new__value" name="$(section_number).new__value" value=""></td></tr>
\r
287 #for $name, $data in $tivos_data
\r
288 #set $section_count += 1
\r
289 #set $section_number = 'section-' + str($section_count)
\r
290 <input type="hidden" name="$name" id="$name" value="$section_number">
\r
291 #set $section_map += $section_number + '|' + $name + ']'
\r
292 <div id="set-$name" style="text-align: center;position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
293 [<input size="20" onChange="saveNotify();" id="$section_number" name="$section_number" value="$name">]<br>
\r
294 <hr style="width: 100%; height: 2px;"><table align="center">
\r
296 #for $key in $tivos_known
\r
299 <tr style="background-color: rgb(250, 250, 250);">
\r
304 <td>$key :</td><td><input onChange="saveNotify();" size="20" id="$section_number.$key" name="$section_number.$key" value="$data[$key]" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
307 <td>$key :</td><td><input onChange="saveNotify();" size="20" id="$section_number.$key" name="$section_number.$key" value="" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
313 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">User Defined Settings:</td></tr>
\r
315 #for $key in $data
\r
316 #if not $key in $tivos_known
\r
319 <tr style="background-color: rgb(250, 250, 250);">
\r
323 <td> $key :</td><td>
\r
324 <input size="20" onChange="saveNotify();" id="$section_number.$key" name="$section_number.$key" value="$data[$key]" onfocus="switchDiv('help-$key', 'help-');return true;" type="text">
\r
329 <div style="position: relative;">
\r
330 <div id="add-$name-button" style="width: 280px; position: absolute; position: absolute; left: 0px; top: 0px;">
\r
333 <input type="button" value="Add Setting" onclick="switchDiv('add-$name-field', 'add-$name-');return true;">
\r
336 <div id="add-$name-field" style="position: absolute; position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
337 <table style="width: 265px;">
\r
338 <tr><td colspan="2" align="center" style="border-bottom: 1px solid rgb(153, 153, 153);">Add a Setting</td></tr>
\r
339 <tr><td>Setting Name:</td><td>Setting Value:</td></tr>
\r
340 <tr><td><input onChange="saveNotify();" size="16" id="$(section_number).new__setting" name="$(section_number).new__setting" type="text" value=""></td><td><input onChange="saveNotify();" size="16" type="text" id="$(section_number).new__value" name="$(section_number).new__value" value=""></td></tr>
\r
346 <div id="set-add" style="text-align: center;position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
351 <td> Section Name :</td><td>
\r
352 <input onChange="saveNotify();" type="text" size="20" name="new_Section" value="" onfocus="switchDiv('help-add', 'help-');return true;">
\r
354 The new section name will be added to the pyTivo.conf file when you click <b>Save Changes</b>.
\r
356 <div id="set-delete" style="text-align: center;position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
360 The Section has been marked for deletion. However it will not be actually deleted until you click the <b>Save Changes</b> button.
\r
362 <input type="hidden" id="Section_Map" name="Section_Map" value="$section_map">
\r
369 <td style="border-left: 1px dotted rgb(153, 153, 153); vertical-align: top;">
\r
370 <div id="sidesections" style="width: 400px; position: relative;"><!-- HELP SECTIONS -->
\r
371 <div id="help-instructions" style="visibility: visible; width: 400px; overflow: scroll; height: 450px; position: absolute; left: 0px; top: 0px;">
\r
372 <p align="center"><strong>Instructions</strong>
\r
374 <b>To Edit a Share:</b><br>
\r
375 Select the share in the left hand menu and click edit.<br><br>
\r
377 <b>To Delete a Share</b><br>
\r
378 Select the share in the left hand menu and click delete.<br><br>
\r
380 <b>To Add a Share/Tivo/Section</b><br>
\r
381 Click the add section button. Then provide the name of the share or TiVo. You must save your
\r
382 changes before you can edit settings in the new share.<br><br>
\r
384 <b>To Add a Setting</b><br>
\r
385 Select you share first. If the setting is a known setting simply add the value to the appropriate setting.
\r
386 If the setting is not listed you can add a "User Defined Setting". Simple click add setting and provide
\r
387 the name and value of this new setting.<br><br>
\r
389 <b>To Delete a Setting</b><br>
\r
390 Delete the value of the setting so that it is blank. If this is a known share the name will remain after a save.
\r
391 If the setting is a user defined setting the name will be deleted after the save.<br><br>
\r
393 <b>Save Settings</b><br>
\r
394 Clicking Save Settings will write your changes to the pyTivo.conf file. These settings will not have an effect on
\r
395 your pyTivo server until it is Soft Reset or restarted.<br><br>
\r
397 <b>Soft Reset</b><br>
\r
398 Soft Reset allows your new settings to take effect without manually restarting the TiVo. The Soft Reset will cause
\r
399 a re-read of the pyTivo.conf file so your changes must be saved to the file before the reset. <b>Note:</b> The only
\r
400 setting that will not take effect until a hard restart is the Port setting. Changing the Port setting requires a full
\r
404 <div id="help-add" style="position: absolute; left: 0px; top: 0px; visibility: hidden;">
\r
405 <p align="center"><strong>Add a New Section</strong> </p>
\r
407 <p> Add the name of a new section.<br>
\r
409 Remember if you want to add TiVo section remember it must start with _tivo_<br>
\r
411 You must save your settings before the new section will be editable.<br>
\r
415 #for $setting in $help_list
\r
416 <div id="help-$setting" style="visibility: hidden; width: 400px; overflow: scroll; height: 450px; position: absolute; left: 0px; top: 0px;">
\r
417 <p align="center"><strong>$setting</strong></p>
\r
418 #for $line in $help_list[$setting]
\r
419 <strong>$(line.split(':',1)[0]):</strong>$(line.split(':',1)[1])</p>
\r
423 <!-- END HELP SECTIONS --> </div>
\r