git-svn-id: file:///root/webif/svn/pkg/webif/trunk@3437 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2016-12-19 10:14:19 +00:00
parent 4f8c5a7b46
commit 4adc26d2f2
4 changed files with 24 additions and 8 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 1.3.4-2
Version: 1.3.4-3
Architecture: mipsel
Maintainer: af123@hpkg.tv
Depends: tcpfix,webif-channelicons(>=1.1.24),lighttpd(>=1.4.39-1),jim(>=0.77),jim-oo(>=0.77),jim-sqlite3(>=0.76),jim-cgi(>=0.7-1),jim-binary(>=0.76),service-control(>=2.3),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.3),hmt(>=2.0.10),ssmtp,cron-daemon(>=1.18.3-3),at(>=3.1.18),anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.1.9),webif-charts(>=1.2-1),stripts(>=1.2.5-3),tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7),hwctl,nugget(>=0.95),sqlite3(>=3.15.1)

View File

@ -10,6 +10,6 @@ handle_int_update autolog $autolog "Auto-processing log level"
handle_int_update noautorec $noautorec "Auto-processing during recording"
handle_int_update noautorecimm $noautorecimm "Auto-processing before recording"
handle_int_update autorecperiod $autorecperiod \
"Auto-processing recording wait period"
"Auto-processing recording wait period" 1 1 $(60 * 24)
handle_str_update noautohours $noautohours "Auto processing hours" ascii

View File

@ -43,7 +43,8 @@ setting_toggle "Suspend automatic processing whilst recording?" \
setting_toggle "Suspend automatic processing if will record soon?" \
"noautorecimm" $noautorecimm
setting_number autorecperiod "...how many minutes is soon?" $autorecperiod
setting_number autorecperiod "...how many minutes is soon?" $autorecperiod \
1 $(60 * 24)
puts -nonewline "
<tr>

View File

@ -13,7 +13,7 @@ set modules {general auto tvdb web epg network advanced}
set settings [settings new]
if {![dict exists $env SCRIPT_NAME]} { set env(SCRIPT_NAME) "" }
proc _handle_update {class var old text {trim 1}} {
proc _handle_update {class var old text {trim 1} {min ""} {max ""}} {
global _cgi
global settings
@ -25,6 +25,14 @@ proc _handle_update {class var old text {trim 1}} {
if {$new == $old} {
puts "$text unchanged."
} elseif {[string is $class -strict $new]} {
if {$class == "digit" && $min ne "" && $new < $min} {
puts "Invalid value for $var (too small)."
exit
}
if {$class == "digit" && $max ne "" && $new > $max} {
puts "Invalid value for $var (too large)."
exit
}
$settings $var $new
puts "$text updated."
} else {
@ -34,8 +42,8 @@ proc _handle_update {class var old text {trim 1}} {
}
}
proc handle_int_update {var old {text "Value"} {trim 1}} {
_handle_update digit $var $old $text $trim
proc handle_int_update {var old {text "Value"} {trim 1} {min ""} {max ""}} {
_handle_update digit $var $old $text $trim $min $max
}
proc handle_str_update {var old {text "Value"} {class alnum} {trim 1}} {
@ -86,7 +94,7 @@ proc setting_toggle {name attr checked {invert 0} {val 0}} {
"
}
proc setting_number {name descr val} {
proc setting_number {name descr val {min ""} {max ""}} {
puts -nonewline "
<tr>
<form class=auto id=${name} method=get action=$::env(SCRIPT_NAME)>
@ -94,7 +102,14 @@ proc setting_number {name descr val} {
<td>
<input name=${name} size=5 type=number
class=\"text ui-widget-content ui-corner-all\"
maxlength=10 value=\"$val\">
maxlength=10"
if {$min ne ""} {
puts -nonewline " min=$min"
}
if {$max ne ""} {
puts -nonewline " max=$max"
}
puts -nonewline " value=\"$val\">
<small>
<input value=\"set\" type=submit>
</small>