Tidy up HTML

This commit is contained in:
prpr 2024-02-21 19:45:00 +00:00
parent ac21373095
commit 5a1b0fe2b2
8 changed files with 108 additions and 96 deletions

View File

@ -21,9 +21,10 @@ setting_toggle "Automatically remove unneeded dependent packages?" \
puts -nonewline "
<tr>
<form class=auto id=logsize method=get action=$env(SCRIPT_NAME)>
<th class=key>Rotate logs when they exceed</th>
<td><select name=logsize
<td>
<form class=auto id=logsize method=get action=$env(SCRIPT_NAME)>
<select name=logsize
class=\"text ui-widget-content ui-corner-all\">
"
set sizes { 102400 262144 524288 1048576 1572864 2097152 }
@ -36,8 +37,8 @@ puts "
</select>
<small><input value=\"set\" type=submit></small>
<div id=logsize_output></div>
</form>
</td>
</form>
</tr>
"
@ -65,16 +66,17 @@ puts "
Native encryption key
</th><td><span id=nativekey>[system encryptionkey]</span></td></tr>
<tr>
<form class=auto id=cryptokey method=post action=$env(SCRIPT_NAME)>
<input type=hidden name=act value=cryptokey>
<th class=key>Custom encryption key</th>
<td><input name=cryptokey size=40 maxlength=32
<td>
<form class=auto id=cryptokey method=post action=$env(SCRIPT_NAME)>
<input type=hidden name=act value=cryptokey>
<input name=cryptokey size=40 maxlength=32
class=\"text ui-widget-content ui-corner-all\"
value=\"$cryptokey\">
<small><input value=set type=submit></small>
<div id=cryptokey_output></div>
</td>
</form>"
<small><input value=\"set\" type=submit></small>
<div id=cryptokey_output></div>
</form>
</td>"
# Script that clears the custom key input field when the native key
# is restored by entering its full value (as shown in #nativekey).
# We rely on magical knowledge that the form holding this <input> is

View File

@ -13,28 +13,29 @@ puts "
puts -nonewline "
<tr>
<form class=auto id=autolog method=get action=$env(SCRIPT_NAME)>
<th class=key>Auto-processing log level</th>
<td><select id=autolog name=autolog
<td>
<form class=auto id=autolog method=get action=$env(SCRIPT_NAME)>
<select id=autolog name=autolog
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=0"
if {$autolog == 0} { puts " selected" }
puts ">Actions and errors only\n"
puts "<option value=1"
if {$autolog == 1} { puts " selected" }
puts ">Actions, errors and scan information\n"
puts "<option value=2"
if {$autolog == 2} { puts " selected" }
puts ">Debugging information\n"
puts -nonewline " <option value=0"
if {$autolog == 0} { puts -nonewline " selected" }
puts ">Actions and errors only"
puts -nonewline " <option value=1"
if {$autolog == 1} { puts -nonewline " selected" }
puts ">Actions, errors and scan information"
puts -nonewline " <option value=2"
if {$autolog == 2} { puts -nonewline " selected" }
puts -nonewline ">Debugging information"
puts "
</select>
<small>
<input name=autolog value=\"set\" type=submit>
<input name=autolog_submit value=\"set\" type=submit>
</small>
<div id=autolog_output></div>
</form>
</td>
</form>
</tr>
"
@ -51,29 +52,29 @@ setting_number autorecperiod "...how many minutes is soon?" $autorecperiod \
puts -nonewline "
<tr>
<form class=auto id=noautohours method=get action=$env(SCRIPT_NAME)>
<th class=key>Choose hours during which
automatic processing runs:
</th>
<td>
<form class=auto id=noautohours method=get action=$env(SCRIPT_NAME)>
<input class=hidden name=\"noautohours\[]\" value=dummy>
<select name=\"noautohours\[]\" id=s_noautohours
multiple size=8
class=\"text ui-widget-content ui-corner-all\">
"
loop h 0 24 {
puts -nonewline "<option value=$h"
puts -nonewline " <option value=$h"
if {$h in $noautohours} { puts -nonewline " selected" }
puts ">[format "%02d:00 - %02d:59" $h $h]</option>"
}
puts "
</select>
<small>
<input name=noautohours value=\"set\" type=submit>
<input name=noautohours_submit value=\"set\" type=submit>
</small>
<div id=noautohours_output></div>
</form>
</td>
</form>
</tr>
"

View File

@ -11,67 +11,70 @@ puts "
<table>
"
puts "
puts -nonewline "
<tr>
<form class=auto id=epg_style method=get action=$env(SCRIPT_NAME)>
<th class=key>Default Now/Next style</th>
<td><select id=epg_style name=epg_style
<td>
<form class=auto id=epg_style method=get action=$env(SCRIPT_NAME)>
<select id=epg_style name=epg_style
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=standard"
if {$epg_style ne "grid"} { puts " selected" }
puts ">Standard\n"
puts "<option value=grid"
if {$epg_style eq "grid"} { puts " selected" }
puts ">Grid\n"
puts -nonewline " <option value=standard"
if {$epg_style ne "grid"} { puts -nonewline " selected" }
puts ">Standard"
puts -nonewline " <option value=grid"
if {$epg_style eq "grid"} { puts -nonewline " selected" }
puts -nonewline ">Grid"
puts "
</select>
<small>
<input name=epg_style value=\"set\" type=submit>
<input name=epg_style_submit value=\"set\" type=submit>
</small>
<div id=epg_style_output></div>
</form>
</td>
</form>
</tr>
"
puts "
puts -nonewline "
<tr>
<form class=auto id=service_style method=get action=$env(SCRIPT_NAME)>
<th class=key>Default Single-channel style</th>
<td><select id=service_style name=service_style
<td>
<form class=auto id=service_style method=get action=$env(SCRIPT_NAME)>
<select id=service_style name=service_style
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=standard"
if {$service_style eq "standard"} { puts " selected" }
puts ">Standard\n"
puts "<option value=grid"
if {$service_style ne "standard"} { puts " selected" }
puts ">Grid\n"
puts -nonewline " <option value=standard"
if {$service_style eq "standard"} { puts -nonewline " selected" }
puts ">Standard"
puts -nonewline " <option value=grid"
if {$service_style ne "standard"} { puts -nonewline " selected" }
puts -nonewline ">Grid"
puts "
</select>
<small>
<input name=service_style value=\"set\" type=submit>
<input name=service_style_submit value=\"set\" type=submit>
</small>
<div id=service_style_output></div>
</form>
</td>
</form>
</tr>
"
puts "
puts -nonewline "
<tr>
<form class=auto id=channel_group method=get action=$env(SCRIPT_NAME)>
<th class=key>Channel Group for EPG</th>
<td><select id=channel_group name=channel_group
<td>
<form class=auto id=channel_group method=get action=$env(SCRIPT_NAME)>
<select id=channel_group name=channel_group
class=\"text ui-widget-content ui-corner-all\">
"
set i 0
puts "<option value=0>-- None --"
puts " <option value=0>-- None --"
foreach grp [$settings channel_groups] {
incr i
puts -nonewline "<option value=$i"
puts -nonewline " <option value=$i"
if {$channel_group == $i} {
puts -nonewline " selected"
}
@ -81,24 +84,25 @@ foreach grp [$settings channel_groups] {
puts "
</select>
<small>
<input name=channel_group value=\"set\" type=submit>
<input name=channel_group_submit value=\"set\" type=submit>
</small>
<div id=channel_group_output></div>
</form>
</td>
</form>
</tr>
"
puts "
puts -nonewline "
<tr>
<form class=auto id=xepghours method=get action=$env(SCRIPT_NAME)>
<th class=key>Grid-style EPG Hours</th>
<td><select id=xepghours name=xepghours
<td>
<form class=auto id=xepghours method=get action=$env(SCRIPT_NAME)>
<select id=xepghours name=xepghours
class=\"text ui-widget-content ui-corner-all\">
"
foreach xehopt {2 3 4 5 6 7 8} {
puts -nonewline "<option value=$xehopt"
puts -nonewline " <option value=$xehopt"
if {$xehopt == $xepghours} {
puts -nonewline " selected"
}
@ -108,11 +112,11 @@ foreach xehopt {2 3 4 5 6 7 8} {
puts "
</select>
<small>
<input name=xepghours value=\"set\" type=submit>
<input name=xepghours_submit value=\"set\" type=submit>
</small>
<div id=xepghours_output></div>
</form>
</td>
</form>
</tr>
"

View File

@ -13,17 +13,18 @@ puts "
puts "
<tr>
<form class=auto id=hostname method=get action=$env(SCRIPT_NAME)>
<th class=key>Hostname</th>
<td><input name=hostname value=\"$hostname\"
<td>
<form class=auto id=hostname method=get action=$env(SCRIPT_NAME)>
<input name=hostname value=\"$hostname\"
class=\"text ui-widget-content ui-corner-all\"
length=20 maxlength=50>
<small>
<input id=hostname_submit value=\"change\" type=submit>
</small>
<div id=hostname_output></div>
<small>
<input id=hostname_submit value=\"change\" type=submit>
</small>
<div id=hostname_output></div>
</form>
</td>
</form>
</tr>
"
@ -41,25 +42,26 @@ if {[system pkginst ir]} {
puts -nonewline "
<tr>
<form class=auto id=audiomp3 method=get action=$env(SCRIPT_NAME)>
<th class=key>Audio extraction type</th>
<td><select id=audiomp3 name=audiomp3
<td>
<form class=auto id=audiomp3 method=get action=$env(SCRIPT_NAME)>
<select id=audiomp3 name=audiomp3
class=\"text ui-widget-content ui-corner-all\">
"
puts "<option value=0"
if {$audiomp3 == 0} { puts " selected" }
puts ">[$settings audiomp3descr 0] - very fast but less compatible.\n"
puts "<option value=1"
if {$audiomp3 == 1} { puts " selected" }
puts ">[$settings audiomp3descr 1] - around 60 times slower.\n"
puts -nonewline " <option value=0"
if {$audiomp3 == 0} { puts -nonewline " selected" }
puts ">[$settings audiomp3descr 0] - very fast but less compatible."
puts -nonewline " <option value=1"
if {$audiomp3 == 1} { puts -nonewline " selected" }
puts -nonewline ">[$settings audiomp3descr 1] - around 60 times slower."
puts "
</select>
<small>
<input name=audiomp3 value=\"set\" type=submit>
<input name=audiomp3_submit value=\"set\" type=submit>
</small>
<div id=audiomp3_output></div>
</form>
</td>
</form>
</tr>
"

View File

@ -67,7 +67,7 @@ proc _ns_iftable {if tag} {
<th class=key>DNS Server</th>
<td><input name=dns class=static value=\"[
_ns_extractip [system param ETHERNET_CONF_${tag}_DNS Blob]]\"></td>
</tr><tr>
</tr>
"
if {$if eq "wifi"} {
set authtypes {
@ -105,17 +105,19 @@ proc _ns_iftable {if tag} {
"
append r "
<tr>
<th class=key>Authentication Type</th>
<td><select id=ns_wifi_authmode name=auth>
"
set val [system param WLAN_AUTH_TYPE]
foreach id [array names authtypes] {
append r "<option value=\"$id\""
append r " <option value=\"$id\""
if {$id eq $val} { append r " selected" }
append r ">$authtypes($id)\n"
append r ">$authtypes($id)\n "
}
append r "</select></td></tr><tr>"
append r " </select></td>"
append r "
</tr>"
append r "
<tr>
<th class=key>
@ -127,20 +129,22 @@ proc _ns_iftable {if tag} {
</th>
<td><input type=password id=ns_pp name=pass size=40
value=\"[_ns_pass]\"></td>
</tr><tr>
</tr>
"
}
append r "
<td></td>
<td align=right><small><input type=submit value=\"Save\"></small></td>
<tr>
<th></th>
<td align=right><small><input type=submit value=\"Save\"></small></td>
</tr>
</table>
</form>
<div id=networksettings_${if}_output></div>
"
}
puts "
puts -nonewline "
<h4>Network Settings</h4>
<div id=network_settings>
<fieldset style=\"display: inline; float: left\">
@ -149,6 +153,7 @@ puts "
</legend>
[_ns_iftable eth 1ST]
</fieldset>
<fieldset style=\"display: inline; float: left\">
<legend>
Wireless Interface
@ -179,5 +184,3 @@ puts "
<script type=text/javascript src=/settings/modules/network/script.js>
</script>
"

View File

@ -16,11 +16,11 @@ setting_toggle "Additional diagnostic output?" "tvdb_debug" $tvdb_debug
puts "
<tr>
<form class=auto id=dedup method=get action=$env(SCRIPT_NAME)>
<th class=key>
Dedup Episode Prefix<br>
</th>
<td>
<form class=auto id=dedup method=get action=$env(SCRIPT_NAME)>
<input name=dedup_template value=\"$dedup_template\"
class=\"text ui-widget-content ui-corner-all\"
length=20 maxlength=50>
@ -29,6 +29,7 @@ puts "
<input id=dedup_submit value=\"change\" type=submit>
</small>
<div id=dedup_output></div>
</form>
</td>
<td>
<span class=blood>
@ -40,7 +41,6 @@ puts "
%N - number of episodes (two digits)
</span>
</td>
</form>
</tr>
"

View File

@ -13,7 +13,7 @@ setting_toggle "HTTPS web server?" "https" \
[file exists /mod/etc/webif.pem] 0 1
puts "
</table>
</legend></fieldset>
</fieldset>
<br>
<fieldset style=\"display: inline\">
<legend> User Access Control </legend>

View File

@ -97,9 +97,9 @@ proc setting_toggle {name attr checked {invert 0} {val 0}} {
proc setting_number {name descr val {min ""} {max ""}} {
puts -nonewline "
<tr>
<form class=auto id=${name} method=get action=$::env(SCRIPT_NAME)>
<th class=key>$descr</th>
<td>
<form class=auto id=${name} method=get action=$::env(SCRIPT_NAME)>
<input name=${name} size=5 type=number
class=\"text ui-widget-content ui-corner-all\"
maxlength=10"
@ -114,8 +114,8 @@ proc setting_number {name descr val {min ""} {max ""}} {
<input value=\"set\" type=submit>
</small>
<div id=${name}_output></div>
</form>
</td>
</form>
</tr>
"
}