Compare commits

..

17 Commits

Author SHA1 Message Date
hummypkg
3dbc3cbf82 add genre rename
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1316 2a923420-c742-0410-a762-8d5b09965624
2013-01-06 23:50:39 +00:00
hummypkg
41047e8668 add grid EPG hours option
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1314 2a923420-c742-0410-a762-8d5b09965624
2013-01-05 22:27:00 +00:00
hummypkg
d6df19dd32 add build number to main screen
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1299 2a923420-c742-0410-a762-8d5b09965624
2013-01-03 22:20:57 +00:00
hummypkg
79bff00465 require latest tmenu, busybox, new dedup prefix, lower dedup reserve threshold
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1292 2a923420-c742-0410-a762-8d5b09965624
2013-01-02 22:22:11 +00:00
hummypkg
4ce9701792 show 20 minutes upcoming, tweak dedup reserve
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1270 2a923420-c742-0410-a762-8d5b09965624
2013-01-01 20:58:42 +00:00
hummypkg
6ff5b7a8e3 rejig dedup, prepare for RMA in 2.15
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1261 2a923420-c742-0410-a762-8d5b09965624
2012-12-31 22:41:09 +00:00
hummypkg
25523058f0 rejig dedup, prepare for RMA in 2.15
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1260 2a923420-c742-0410-a762-8d5b09965624
2012-12-31 22:39:54 +00:00
hummypkg
d661c8016e clear log function
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1256 2a923420-c742-0410-a762-8d5b09965624
2012-12-01 22:00:03 +00:00
hummypkg
ebcd6cdbf7 tweak settings ON/OFF to YES/NO
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1255 2a923420-c742-0410-a762-8d5b09965624
2012-11-30 21:17:16 +00:00
hummypkg
4fe5bd1bff update
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1253 2a923420-c742-0410-a762-8d5b09965624
2012-11-29 22:28:08 +00:00
hummypkg
d5679ead84 disc -> disk
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1252 2a923420-c742-0410-a762-8d5b09965624
2012-11-29 21:33:58 +00:00
hummypkg
e666711eeb various changes
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1250 2a923420-c742-0410-a762-8d5b09965624
2012-11-25 00:22:18 +00:00
hummypkg
775add8c04 improve media rename, require HMT 1.1.7
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1231 2a923420-c742-0410-a762-8d5b09965624
2012-11-18 12:07:53 +00:00
hummypkg
d4dc56b816 minor updates for new menu system
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1221 2a923420-c742-0410-a762-8d5b09965624
2012-11-16 21:16:03 +00:00
hummypkg
e720740507 0.10.0-3
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1214 2a923420-c742-0410-a762-8d5b09965624
2012-11-12 22:42:33 +00:00
hummypkg
3c327ff80d minor updates
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1212 2a923420-c742-0410-a762-8d5b09965624
2012-11-09 21:56:36 +00:00
hummypkg
d05632e8d3 various updates
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1210 2a923420-c742-0410-a762-8d5b09965624
2012-11-06 22:58:17 +00:00
41 changed files with 617 additions and 129 deletions

View File

@@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.10.0
Version: 0.10.2
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73),jim-cgi(>=0.5),service-control(>=1.2),busybox(>=1.19.3-1),lsof,epg(>=1.0.9),hmt(>=1.1.6),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2)
Depends: webif-channelicons(>=1.0.3),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.5),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.9-1),hmt(>=1.1.8),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.1.2),smartmontools,tmenu(>=1.04)
Suggests: ffmpeg
Description: An evolving web interface for the Humax.

View File

@@ -148,6 +148,21 @@ proc entry {file} {{i 0}} {
set bx 0
set dlna 0
if {$type eq "ts"} {
# Genre
switch [$ts get genre] {
16 { set img "Movie" }
32 { set img "News" }
48 { set img "Special" }
64 { set img "Sports" }
80 { set img "Children" }
96 { set img "Education" }
160 { set img "Leisure" }
240 { set img "Show" }
default { set img "Unclassified" }
}
#icon "/images/173_1_00_G1_$img.png"
icon "/images/173_3_00_G3_$img.png" $img
# HD / SD
if {[$ts get definition] eq "HD"} {
set def HD

View File

@@ -67,8 +67,7 @@ puts {
<div id=renameform title="Rename media file" style="display: none">
<form id=renameform_form>
<input type=hidden name="renameorig" id="renameorig" value="">
<input type=hidden name="titleorig" id="titleorig" value="">
<input type=hidden name="renamefile" id="renamefile" value="">
<table border=0>
<tr>
<th>
@@ -82,21 +81,68 @@ puts {
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<th>
<label for="renametitle" style="padding-top: 0.5em">
<label for="rename_title" style="padding-top: 0.5em">
<b>New Medialist Title</b>
</label>
</th>
<td>
<input type=text name="renametitle" id="renametitle"
<input type=text name="rename_title" id="rename_title"
value="" size=70 maxlength=48
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<td colspan=2 id=synopsis style="font-style: italic"></td>
<th>
<label for="rename_synopsis" style="padding-top: 0.5em">
<b>New Synopsis</b>
</label>
</th>
<td>
<textarea name="rename_synopsis" id="rename_synopsis"
value="" cols=70 rows=4
class="text ui-widget-content ui-corner-all"></textarea>
</td>
</tr>
<tr style="display: none" class=tstype>
<th>
<label for="rename_guidance" style="padding-top: 0.5em">
<b>New Guidance Text</b>
</label>
</th>
<td>
<input type=text name="rename_guidance" id="rename_guidance"
value="" size=70 maxlength=74
class="text ui-widget-content ui-corner-all">
</td>
</tr>
<tr style="display: none" class=tstype>
<th>
<label for="rename_genre" style="padding-top: 0.5em">
<b>New Genre</b>
</label>
</th>
<td>
<select name="rename_genre" id="rename_genre"
class="text ui-widget-content ui-corner-all">
<option value=0>Unclassified
<option value=16>Film
<option value=32>News &amp; Factual
<option value=48>Entertainment
<option value=64>Sport
<option value=80>Children
<option value=96>Education
<option value=160>Lifestyle
<option value=240>Drama
</select>
</td>
</tr>
</table>
</form>
</div>

View File

@@ -74,19 +74,17 @@ $('#paste').button()
function epginfo_callback(data, status, xhr)
{
var width = 85;
//console.log(status);
//console.dir(data);
if (status != 'success')
return;
//console.log(status);
//console.dir(data);
$('#rename_title').val(data.title);
$('#rename_synopsis').val(data.synopsis);
$('#rename_guidance').val(data.guidance);
$('#rename_genre').val(data.genre);
$('#titleorig').val(data.title);
$('#renametitle').val(data.title);
if (data.synopsis.length > width)
data.synopsis = data.synopsis.substring(0, width) + '...';
$('#synopsis').html(data.synopsis);
$('tr.tstype').show('slow');
}
@@ -183,7 +181,7 @@ function new_callback(file, type, id)
function rename_submit()
{
var s = $('#renameform_form').serialize();
$.get('/cgi-bin/browse/rename.jim?' + s,
$.post('/cgi-bin/browse/rename.jim', s,
function() { window.location.reload(true); });
}
@@ -394,11 +392,11 @@ var menuclick = function(action, el, pos)
case 'rename':
$('#rename').val(decodeURIComponent(bfile));
$('#renameorig').val(decodeURIComponent(file));
$('#renamefile').val(decodeURIComponent(file));
$('#titleorig').val('');
$('#renametitle').val('');
$('#synopsis').val('');
$('#rename_title').val('');
$('#rename_synopsis').val('');
$('#rename_guidance').val('');
$('tr.tstype').css('display', 'none');
if (type == 'ts')
@@ -827,7 +825,7 @@ var dmenuclick = function(action, el, pos)
function checkstream()
{
$.get('/cgi-bin/streamsize.jim', function(size) {
console.log('Stream size: %o', size);
//console.log('Stream size: %o', size);
var mb = size / (1024 * 1024);
mb = mb|0;
if (streamsize && size > streamsize)

View File

@@ -110,9 +110,11 @@ switch $action {
}
} else {
if {$mode eq "cut"} {
catch {file rename $path "$dir/[file tail $f]"}
catch {file rename $path \
"$dir/[file tail $path]"}
} else {
catch {file copy $path "$dir/[file tail $f]"}
catch {file copy $path \
"$dir/[file tail $path]"}
}
}
}

View File

@@ -17,6 +17,8 @@ set ts [ts fetch $file]
puts "{"
puts "\"title\" : \"[$ts get title]\","
puts "\"synopsis\" : \"[$ts get synopsis]\""
puts "\"synopsis\" : \"[$ts get synopsis]\","
puts "\"guidance\" : \"[$ts get guidance]\","
puts "\"genre\" : [$ts get genre]"
puts "}"

View File

@@ -10,43 +10,34 @@ puts ""
cgi_input
#cgi_dump
#renameorig
#titleorig
#rename
#renametitle
set file [cgi_get renamefile "-"]
if {$file eq "-"} exit
#set _cgi(renameorig) "/media/My Video/The Walking Dead/The Walking Dead_20110521_2201.ts"
#set _cgi(rename) "Last Episode"
if {![dict exists $_cgi renameorig]} { exit }
set file [dict get $_cgi renameorig]
set newfile [dict get $_cgi rename]
if {[string length [string trim $newfile]] == 0 || $file eq $newfile} {
set newfile ""
}
set newfile [string trim [cgi_get rename]]
set dir [file dirname $file]
if {[file isdirectory $file]} {
#puts "Directory."
if {$newfile ne ""} {
set dir [file dirname $file]
set newfile "${dir}/${newfile}"
file rename $file $newfile
}
} elseif {[set ts [ts fetch $file]] != 0} {
#puts "TS file."
catch {
set title [dict get $_cgi renametitle]
set titleorig [dict get $_cgi titleorig]
if {[string length [string trim $title]] > 0 &&
$title ne $titleorig} {
$ts settitle $title
foreach attr {title synopsis guidance genre} {
if {[catch {
set new [string trim [cgi_get "rename_$attr"]]
set old [$ts get $attr]
if {[string length $new] > 0 && $new ne $old} {
$ts set$attr $new
}
} msg]} {
puts "$attr: $msg"
}
}
if {$newfile ne ""} { ts renamegroup $file $newfile }
if {"$dir/$newfile.ts" ne "$file"} { ts renamegroup $file $newfile }
} else {
#puts "Normal file."
if {$newfile ne ""} { ts renamegroup $file $newfile }

View File

@@ -6,7 +6,12 @@ echo "Content-Type: text/plain"
echo
if [ "$rma" = 1 ]; then
touch /var/lib/humaxtv/.rma
modver="`cat /etc/modversion`"
if [ "$modver" -ge 215 ]; then
touch /var/lib/humaxtv_backup/.rma
else
touch /var/lib/humaxtv/.rma
fi
else
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
fi

View File

@@ -30,6 +30,9 @@ if {$cmd eq "update" || $cmd eq "upgrade"} {
chunk "Updating package meta information\r\n"
pkg fetchmeta
chunk "Done.\r\n"
chunk "Updating diagnostic meta information\r\n"
pkg fetchdiagmeta
chunk "Done.\r\n"
}
end_chunked

View File

@@ -2,8 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require settings.class
require plugin
require settings.class plugin system.class
puts "Content-Type: text/html"
puts ""
@@ -22,6 +21,17 @@ if {[cgi_get act] eq "https"} {
exit
}
if {[cgi_get act] eq "xtelnet"} {
if {[cgi_get val off] eq "off"} {
file delete /mod/boot/xtelnet
puts "Telnet server expert mode will be disabled after next reboot."
} else {
exec /mod/bin/busybox/touch /mod/boot/xtelnet
puts "Telnet server expert mode will be enabled after next reboot."
}
exit
}
set settings [settings new]
set hostname [$settings hostname]
@@ -31,6 +41,8 @@ set epg_style [$settings epg_style]
set pkgdev [$settings pkgdev]
set notoolbar [$settings notoolbar]
set nomobile [$settings nomobile]
set xepghours [$settings xepghours]
if {$xepghours == 0} { set xepghours 4 }
# Handle updates
@@ -65,6 +77,7 @@ proc handle_str_update {var old {text "Value"}} {
handle_str_update hostname $hostname Hostname
_handle_update ascii smtp_server $smtp_server "SMTP Server"
handle_int_update channel_group $channel_group "Channel Group"
handle_int_update xepghours $xepghours "Grid EPG Hours"
handle_str_update epg_style $epg_style "EPG Type"
handle_int_update pkgdev $pkgdev "Development Package Display"
handle_int_update notoolbar $notoolbar "Disable toolbar"
@@ -220,6 +233,33 @@ puts "
</tr>
"
puts "
<tr>
<form class=auto id=xepghours method=get action=$env(REQUEST_URI)>
<th class=key>Grid-style EPG Hours</th>
<td><select id=xepghours name=xepghours
class=\"text ui-widget-content ui-corner-all\">
"
foreach xehopt {2 3 4 5 6} {
puts -nonewline "<option value=$xehopt"
if {$xehopt == $xepghours} {
puts -nonewline " selected"
}
puts ">$xehopt hours"
}
puts "
</select>
<small>
<input name=xepghours value=\"set\" type=submit>
</small>
<div id=xepghours_output></div>
</td>
</form>
</tr>
"
puts "
</table>
</fieldset>
@@ -354,6 +394,24 @@ if {$pkgdev} { puts -nonewline " checked" }
puts ">
</td>
</tr>
"
if {[system modversion 1] >= 214} {
puts -nonewline "
<tr>
<th class=key>Expert mode telnet server?</th>
<td><input id=xtelnet_toggle name=xtelnet type=checkbox value=yes"
if {[file exists /mod/boot/xtelnet]} { puts -nonewline " checked" }
puts ">
<div id=xtelnet_output></div>
</td>
</tr>
"
}
puts "
</table>
<div id=pkgdev_output></div>
</fieldset>

View File

@@ -21,7 +21,11 @@
$(document).ready(function () {
$(":submit").button();
$(":checkbox").iphoneStyle();
//$('[type="checkbox"] :not(.yesno)').iphoneStyle();
$('[type="checkbox"]').iphoneStyle({
checkedLabel: 'YES',
uncheckedLabel: 'NO'
});
$('form.auto').each(function(i, el) {
var id = $(this).attr('id');
var output = '#' + id + '_output';
@@ -76,6 +80,26 @@ $(document).ready(function () {
});
});
$('#xtelnet_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
$(this).disable();
$('#xtelnet_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=xtelnet&val=' + arg,
function() {
$('#xtelnet_toggle').enable();
$('#xtelnet_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#toolbar_toggle').change(function() {
var arg = '1';
if ($(this).attr('checked'))

View File

@@ -2,20 +2,25 @@
package require cgi
source /mod/webif/lib/setup
require system.class findhsvc epg.class
require system.class findhsvc epg.class rsv.class
set runmode cli
if {[string match {*jim} $argv0]} { set runmode cgi }
cgi_input
set type [cgi_get type "full"]
if {$runmode eq "cgi"} {
set schedtime 1200
case $runmode {
cgi {
cgi_input
set type [cgi_get type "full"]
puts "Content-Type: text/html"
puts "Pragma: no-cache"
puts "Expires: Thu, 01 Jan 1970 00:00:00 GMT"
puts ""
}
cli {
set type "full"
if {"-X" in $argv} { set schedtime 7200 }
}
}
if {[catch {set pid [exec pgrep humaxtv]}]} {
@@ -146,6 +151,29 @@ if {[system instandby]} {
}
}
set events [rsv list tbl_reservation \
" where ersvtype = 3 and nsttime - [clock seconds] < $schedtime
and nsttime > [clock seconds] "]
foreach event $events {
if {$runmode eq "cgi"} {
set icon "175_1_11_Reservation_Record.png"
lappend output [concat \
"<span class=\"va stitem\">\n" \
" <img class=va src=/images/$icon width=20>\n" \
" <span>Will record <i>[$event name]</i>" \
" on [$event channel_name] at"\
" [clock format [$event get nsttime] -format {%H:%M}]" \
" </span>\n" \
"</span>\n" \
} else {
lappend output [concat \
"Will record '[$event name]' " \
"on [$event channel_name] at " \
"[clock format [$event get nsttime] -format {%H:%M}]" \
]
}
}
if {[llength $output]} {
if {$runmode eq "cgi"} {
puts [join $output "\n<br>\n"]

View File

@@ -11,19 +11,23 @@ require epg.class spinner.class altrow epg_search totop
cgi_input
puts {<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />}
puts {
<link type="text/css" href="/css/xepg.css" rel="Stylesheet" />
<script type=text/javascript src=/js/enadis.js></script>
}
[spinner new {
text "Loading Now/Next Information..."
text "Loading EPG Information..."
size "1.2em"
style "margin: 1em;"
}] start
require epg_popup
set stt [cgi_get stt [clock seconds]]
if {$stt <= [clock seconds]} {
set stt [clock seconds]
set now [clock seconds]
set stt [cgi_get stt $now]
if {$stt <= $now} {
set stt $now
set current 1
} else {
set current 0
@@ -31,7 +35,8 @@ if {$stt <= [clock seconds]} {
set favgroup [[settings] channel_group]
set hours 4.0
set hours [expr 1.0 * [[settings] xepghours]]
if {$hours == 0} { set hours 4.0 }
set seconds $($hours * 3600)
set ostt $stt
@@ -40,7 +45,7 @@ set stt [expr int($stt / 1800.0) * 1800]
set ett $(int($stt + $seconds))
set offset $(($ostt - $stt) / 1800.0)
set chanpx 120
set chanpx 160
set eventpx 1000
set totalpx $($chanpx + $eventpx)
set contwidth $($totalpx + 50)
@@ -64,21 +69,42 @@ if {$::qepg} {
}
set got [clock milliseconds]
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
if {$stt > [clock seconds]} {
puts "<button id=earlier>&lt;&lt;&lt; Earlier</button>"
proc but {label time {active 1}} {
puts -nonewline "<button style=\"margin-right: 2em\" tt=$time"
if {$active} {
puts -nonewline " class=nav"
} else {
puts -nonewline " disabled class=\"nav ui-state-disabled\""
}
puts " active=$active>$label</button>"
}
puts "<button id=later>Later &gt;&gt;&gt;</button>"
puts "<!-- Hours $hours ($seconds) -->"
puts "<div id=buttons style=\"width: $eventpx; margin-left: ${chanpx}px;\">"
but "&lt&lt; -1 Week" $($stt - 3600 * 24 * 7) \
$($stt - $now + 3600 >= 3600 * 24 * 7)
but "&lt&lt; -1 Day" $($stt - 3600 * 24) $($stt - $now >= 3600 * 23)
but "&lt;&lt; Earlier", $($stt - 3600 * 4) $($stt > $now)
but "&lt; Now &gt;" $now $($current == 0)
but "&gt;&gt; Later" $ett;
but "&gt;&gt; +1 Day" $($stt + 3600 * 24) $($stt < $now + 8 * 3600 * 24)
but "&gt;&gt; +1 Week" $($stt + 3600 * 24 * 7) $($stt < $now + 8 * 3600 * 24)
puts "</div>"
puts "
<script type=text/javascript>
\$('button.nav').button();
</script>
<div id=xepg style=\"min-width: ${contwidth}px; overflow: auto\">
<div id=xepgnow></div>
<div id=xegrid>
"
puts "<div id=epgdate style=\"width: ${eventpx}px; margin-left: ${chanpx}px;\">"
puts [clock format $stt -format {%a %D}]
puts [clock format $stt -format {%a %d/%m/%Y}]
puts "<input type=hidden id=xepg_dp stt=$stt>"
puts "</div>"
puts "<div class=xechan style=\"width: ${chanpx}px;\">&nbsp;</div>"
@@ -173,6 +199,9 @@ puts "
Switch to standard now/next display.
</button></small>
</div>
"
puts "
<script type=text/javascript>
\$(document).ready(function() {
@@ -180,12 +209,37 @@ puts "
\$('#epgswitch').button().click(function() {
window.location = '/epg.shtml';
});
\$('#earlier').button().click(function() {
window.location = '/cgi-bin/xepg.jim?stt=$earlier';
\$('button.nav').click(function() {
window.location = '/cgi-bin/xepg.jim?stt=' + \$(this).attr('tt') +
'&pos=' + \$('#xegrid').scrollTop();
});
\$('#later').button().click(function() {
window.location = '/cgi-bin/xepg.jim?stt=$ett';
\$('#xepg_dp').datepicker({
buttonImage: '/img/cal.gif',
buttonImageOnly: true,
showOn: 'button',
dateFormat: '@',
minDate: '[expr $now * 1000]',
maxDate: '[expr ($now + 7 * 86400) * 1000]',
onSelect: function(val, sel) {
var stt = \$(this).attr('stt');
// Extract date part
dval = ~~(val / 86400000);
// Extract current time part
var tm = ~~(stt % 86400);
var ret = dval * 86400 + tm;
window.location = '/cgi-bin/xepg.jim?stt=' + ret;
}
});
\$('img.ui-datepicker-trigger').hover(
function() { \$(this).css('cursor', 'pointer'); },
function() { \$(this).css('cursor', 'auto'); }
);
"
if {$current} {

View File

@@ -400,3 +400,8 @@ button.red
color: #ffffff;
}
div#restart_block
{
z-index: 31;
}

View File

@@ -4,6 +4,7 @@ set dedup_prefixes {
{^new series\.* *}
{^cbeebies\.* *}
{^cbbc\.* *}
{^t4: *}
{^brand new series *-* *}
{^\.+}
}
@@ -53,15 +54,6 @@ proc dedupnormalise {title {reserve ""}} {
}
}
# if still short, add the reserve string.
if {[string length $title] < 10} {
if {[string match "${title}*" $reserve]} {
set title $reserve
} else {
append title " $reserve"
}
}
if {[dict exists $seriesmap $title]} {
set ntitle "$seriesmap($title): $title"
set title $ntitle
@@ -73,6 +65,15 @@ proc dedupnormalise {title {reserve ""}} {
}
}
# if still short, add the reserve string.
if {[string length $title] < 6} {
if {[string match "${title}*" $reserve]} {
set title $reserve
} else {
append title " $reserve"
}
}
# Shorten if too long.
if {[string length $title] > 40} {
set title [string range $title 0 39]

View File

@@ -0,0 +1,24 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
puts "Content-Type: text/html"
puts ""
set logdirs {/var/log /mod/tmp /mnt/hd3}
set logext {.log}
cgi_input
#cgi_dump
set log [cgi_get file 0]
set ldir [file dirname $log]
if {[file dirname $log] in $logdirs && [file extension $log] in $logext} {
file copy -force "/dev/null" $log
puts "Cleared $log"
exit
}
puts "Cannot clear $log"

View File

@@ -2,11 +2,13 @@
package require cgi
source /mod/webif/lib/setup
require pretty_size system.class
require pretty_size system.class pkg.class
puts "Content-Type: text/html"
puts ""
pkg loaddiagmeta
set smv [system modversion 1]
header
@@ -21,10 +23,24 @@ puts {
<tr>
<td>Run Diagnostic:</td>
<td><input name=seq id=seq autocorrect=off autocapitalize=off
value=general size=30 maxlength=50
<td class=va><span class=cleft>
<select name=diagsel id=diagsel class="text ui-widget-content ui-corner-all">
<option value=0>-- Select diag or type name in box below --
}
foreach diag [array names ::diagmeta] {
puts "<option value=\"$diag\">$diag\n"
}
puts {
</select><br>
<input name=seq id=seq autocorrect=off autocapitalize=off
value="general" size=30 maxlength=50
class="text ui-widget-content ui-corner-all">
</span>
<span class="left va">
<button id=rundiag>Run Diagnostic</button>
</span>
</td>
</tr>
@@ -48,7 +64,11 @@ puts {
<tr>
<td colspan=2 align=center>
<button id=diskdiag style="width: 48%">Hard Disc</button>
}
if {[system model] eq "HDR"} {
puts { <button id=diskdiag style="width: 48%">Hard Disk</button> }
}
puts {
<button id=channelinfo style="width: 48%">Channel Information</button>
</td>
</tr>
@@ -156,7 +176,11 @@ foreach file [lsort [concat \
]] {
puts "<a href=# class=log file=\"$file\">
<img border=0 height=14 src=/images/421_1_00_CH_Title_2R_Arrow.png>
[file tail $file]</a> ([pretty_size [file size $file]]) <br>"
[file tail $file]</a>
(<span class=lsize>[pretty_size [file size $file]]</span>)
<a class=\"va footnote logclear\" href=# file=\"$file\">
<img class=va border=0 src=/img/close.png width=20>Clear</a>
<br>"
}
puts {

View File

@@ -138,8 +138,12 @@ puts {
</tr>
}
if {[catch {set msg [exec /mod/bin/smartctl -l selftest $device]} xmsg]} {
set msg $xmsg
}
set i 0
foreach line [split [exec /mod/bin/smartctl -l selftest $device] "\n"] {
foreach line [split $msg "\n"] {
regsub -all -- {[[:space:]][[:space:]]+} $line "|" line
if {[incr i] < 7} continue
lassign [split $line "|"] id name status remaining when lba

View File

@@ -4,11 +4,14 @@ $(function() {
$('button').button();
$('#rundiag').click(function() {
var val = $('#diagsel').val();
if (val == '0')
val = $('#seq').val();
$('#results')
.slideDown()
.text('\n\nRunning diagnostic, please wait...\n\n')
.load('rundiag.jim?diag=' +
encodeURIComponent($('#seq').val()), function() {
.html('<br><br><img src=/img/loading.gif> ' +
'Running diagnostic, please wait...')
.load('rundiag.jim?diag=' + encodeURIComponent(val), function() {
$('#results').wrapInner('<pre>');
});
});
@@ -24,7 +27,8 @@ $('#runfopkg').click(function() {
});
});
$('a.log').click(function() {
$('a.log').click(function(e) {
e.preventDefault();
$('#results')
.slideDown()
.text('\n\nLoading log, please wait...\n\n')
@@ -34,6 +38,21 @@ $('a.log').click(function() {
});
});
$('a.logclear').click(function(e) {
var t = $(this);
e.preventDefault();
if (!confirm('Delete ' + $(this).attr('file') + '?'))
return;
$('#results')
.slideDown()
.text('\n\nClearing log, please wait...\n\n')
.load('clearlog.jim?file=' +
encodeURIComponent($(this).attr('file')), function() {
$('#results').wrapInner('<pre>');
$(t).prev('span.lsize').html('0 bytes');
});
});
$('#runedit').click(function(e) {
e.preventDefault();
window.location = '/edit/edit.jim';

View File

@@ -2,6 +2,7 @@
package require cgi
source /mod/webif/lib/setup
require plugin
puts "Content-Type: text/html"
puts ""
@@ -49,6 +50,15 @@ Use the <i>Open</i> button below to begin.
<ul>
<li><a href=# class=qfile>/mod/etc/anacrontab</a></li>
<li><a href=# class=qfile>/mod/var/spool/cron/crontabs/root</a></li>
}
proc quickedit {file} {
puts "<li><a href=# class=qfile>$file</a></li>"
}
eval_plugins quickedit
puts {
</ul>
</fieldset>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -13,6 +13,7 @@ set dir [cgi_get dir [system mediaroot]]
set model [system model]
set dustbin [system dustbin 1]
set order [[settings new] sortorder]
proc icon {img {hover ""} {extra ""} {class "va"}} {
puts -nonewline "<img src=$img class=\"$class\" height=21 $extra"
@@ -173,8 +174,38 @@ puts "
directory [join [lrange [split $dir /] 0 end-1] /] "\[parent directory\]" \
_parent "/images/711_3_09_Media_Folder_UP.png"
proc s_time {a b} {
global dir
set a "$dir/$a"
set b "$dir/$b"
set ad [file isdirectory $a]
set bd [file isdirectory $b]
if {$ad && !$bd} { return -1 }
if {$bd && !$ad} { return 1 }
if {$ad && $bd} {
if {$a < $b} { return -1 }
if {$a > $b} { return 1 }
return 0
}
if {[catch {file stat $a l}]} { return 0}
set at $l(ctime)
if {[catch {file stat $b l}]} { return 0}
set bt $l(ctime)
if {$at < $bt} { return -1 }
if {$at > $bt} { return 1 }
return 0
}
set files [readdir -nocomplain $dir]
set files [lsort $files]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort $files] }
}
foreach file $files { entry "$dir/$file" }

View File

@@ -28,11 +28,11 @@ puts {
<script type="text/javascript" src="/js/enadis.js">
</script>
<script type="text/javascript" src="/m/script.js"></script>
<xlink rel="apple-touch-icon" href="/img/mobile.png" />
<xlink rel="apple-touch-icon" sizes="57x57" href="/img/remote_57.png" />
<xlink rel="apple-touch-icon" sizes="72x72" href="/img/remote_72.png" />
<xlink rel="apple-touch-icon" sizes="114x114" href="/img/remote_114.png" />
<xlink rel="apple-touch-icon" sizes="144x144" href="/img/remote_144.png" />
<link rel="apple-touch-icon" href="/img/mobile_57.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/img/mobile_57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/img/mobile_72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/img/mobile_114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/img/mobile_144.png" />
</head>
}

View File

@@ -23,7 +23,8 @@ if {![$ts flag "ODEncrypted"]} {
} else {
lassign [$ts dlnaloc] url
if {$url eq ""} {
alert("Media is encrypted and not indexed by the DLNA Server.");
puts "Media is encrypted and not indexed by the DLNA Server."
exit
}
}

View File

@@ -7,8 +7,17 @@ require altrow rsv.class progressbar epg.class system.class
puts "Content-Type: text/html"
puts ""
set svcmap {}
lmap i \
[$::channeldb query {select hSvc, usSvcid from TBL_SVC}] \
{
set svcmap([lindex $i 1]) [lindex $i 3]
}
header
require epg_popup
puts {
<script type=text/javascript src=/js/jquery.tablesorter.js></script>
<link type=text/css href=/css/tsort.css rel=Stylesheet />
@@ -17,7 +26,7 @@ puts {
<script type=text/javascript src=/js/jquery.form.js></script>
<script type=text/javascript src=script.js></script>
<div id=dialogue></div>
<div id=sdialogue></div>
}
proc eventheader {{table TBL_RESERVATION} note} {
@@ -49,6 +58,8 @@ proc eventheader {{table TBL_RESERVATION} note} {
}
proc eventrow {event {table TBL_RESERVATION}} {
global svcmap
set name [$event name]
set attrs "table=$table sid=[$event get ulslot] \
@@ -83,6 +94,7 @@ proc eventrow {event {table TBL_RESERVATION}} {
} {
puts "<br><span class=also>&nbsp;(Folder: [$event folder])</span>"
}
puts "</td>"
set s [$event get nsttime]
@@ -90,18 +102,33 @@ proc eventrow {event {table TBL_RESERVATION}} {
set e $($s + $d)
set n [clock seconds]
set ds "[clock format $s -format "%a %d %b %Y"]<br>
[clock format $s -format "%H:%M %Z"]"
if {$n > $e && [$event get ersvtype] <= 3} {
puts "<td nowrap class=va
alt=\"$ds\" title=\"$ds\">
--- -- --- ----<br>--:--"
set ds "[clock format $s -format {%a %d %b %Y %H:%M}]"
puts "<td nowrap class=va>
--- -- --- ---- --:--<br>
<span class=footnote>(Last: $ds)</span>"
puts "</td><td>--:--:--</td>"
} else {
set elist [$event aul]
set ds "[clock format $s -format {%a %d %b %Y %H:%M}]"
puts "<td nowrap class=\"va"
if {$n > $e} { puts " blood" }
puts "\">$ds"
puts "\">"
if {[llength $elist] > 0} {
lassign [lindex $elist 0] service_id start end event_id
if {$start == $s} {
puts "<a class=event href=#
xs=$svcmap($service_id) xe=$event_id>
$ds</a>"
} else {
puts $ds
}
} else {
puts $ds
}
if {$d > 0 && $n > $s && $n < $e} {
puts "<br>"
set perc [expr [expr $n - $s] * 100 / $d]
@@ -109,8 +136,34 @@ proc eventrow {event {table TBL_RESERVATION}} {
src=/images/745_1_11_Video_1REC.png>"
puts [progressbar $perc]
}
puts "</td><td>"
puts "[clock format [$event get nduration] -format %T]</td>"
if {[llength $elist] > 1} {
puts "<div class=also style=\"margin-top: 0.5em\">"
foreach e $elist {
lassign $e service_id start end event_id
if {$start == $s} continue
puts "<a class=event href=#
xs=$svcmap($service_id) xe=$event_id>
[clock format $start \
-format {%a %d %b %Y %H:%M}]</a><br>"
}
puts "</div>";
}
puts "</td><td align=center>"
puts "[clock format [$event get nduration] -format %H:%M]"
if {[llength $elist] > 1} {
puts "<div class=also style=\"margin-top: 0.5em\">"
foreach e $elist {
lassign $e service_id start end event_id
if {$start == $s} continue
puts "[clock format $($end - $start) \
-format {%H:%M}]<br>"
}
puts "</div>";
}
puts "</td>"
}
puts "<td nowrap>[join [$event iconset] ""]</td>"

View File

@@ -37,8 +37,8 @@ $('table.tablesorter thead th').filter('[class!=header]')
function docancel()
{
var table = $('#dialogue').attr('table');
var slot = $('#dialogue').attr('slot');
var table = $('#sdialogue').attr('table');
var slot = $('#sdialogue').attr('slot');
if (confirm('Really remove scheduled event?'))
{
@@ -46,7 +46,7 @@ function docancel()
'&table=' + table, function() {
window.location.reload(true);
});
$('#dialogue').dialog('close');
$('#sdialogue').dialog('close');
}
}
@@ -57,14 +57,14 @@ var $buttons2 = $.extend(
{"Cancel Event": function() { docancel() }},
$buttons1);
var $dialog = $('#dialogue').dialog({
var $dialog = $('#sdialogue').dialog({
title: "Schedule Details",
modal: false, autoOpen: false,
height: 500, width: 700,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: $buttons2,
close: function(e,u) { $('#dialogue').empty().html(
close: function(e,u) { $('#sdialogue').empty().html(
'<img src="/img/loading.gif" alt="loading">'); }
});
@@ -73,11 +73,11 @@ function schedpopup(e, o)
e.preventDefault();
var slot = o.attr('slot');
var table = o.attr('table');
$('#dialogue').attr('slot', slot).attr('table', table);
$('#sdialogue').attr('slot', slot).attr('table', table);
var url = 'info.jim?slot=' + slot +
'&table=' + table;
$('#dialogue').load(url);
$('#sdialogue').load(url);
$dialog.dialog('open');
}
$('a.schedule').click(function(e) { schedpopup(e, $(this)) });

View File

@@ -1,14 +1,22 @@
<!--#include virtual="/lib/header.shtml" -->
<link href=/css/iphone-style-checkboxes.css rel=stylesheet type=text/css />
<script type="text/javascript" src="/js/iphone-style-checkboxes.js"></script>
<script type="text/javascript" src="/js/enadis.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('input:checkbox').iphoneStyle();
// Don't allow turning off the web server from within the web server..
$('input:checkbox[name=mongoose][class=toggle]').attr('disabled', true);
$('input:checkbox[name=mongoose][class=toggle]').disable();
$(':checkbox').change(function() {
if ($(this).attr('name') == 'mongoose' &&
!$(this).is(':checked'))
alert(
'Note that mongoose is the web server service that ' +
'provides this web interface. If you disable auto-start ' +
'then the web interface will not be available when the ' +
'Humax is restarted.');
var url = '/cgi-bin/service.jim?action=' +
escape($(this).attr('class')) +
'&service=' +

View File

@@ -8,11 +8,11 @@ proc menuitem {title icon link {width 217} {height 0} {extra ""}} {{num 0}} {
if {$title eq ""} return
if {$num > 4} {
puts {</div><div style="clear: both; padding-top: 1em">}
set num 0
set num 1
}
if {$extra ne ""} { append extra " " }
puts -nonewline "
<div class=left>
<div class=left num=$num>
<center>
<a href=$link>
<img src=$icon ${extra}border=0 width=$width"

View File

@@ -3,10 +3,15 @@
source /mod/webif/lib/setup
require system.class
set modver [system modversion]
set modbuild [system modbuild]
if {$modbuild > 0} {
append modver " (build $modbuild)"
}
puts "<font class=blood style=\"font-size: 0.9em; float: right; clear: right\">
Web interface version: [system pkgver webif]<br>
Custom firmware version: [system modversion]
Custom firmware version: $modver
"
if {![catch {set fhtcpversion [system fhtcpversion]}]} {
puts "<br>Humax Version: $fhtcpversion"

View File

@@ -35,7 +35,12 @@ puts {
$('#restart_humaxtv').button()
.click(function() {
if (confirm('Are you sure you wish to perform a restart now?'))
window.location = '/cgi-bin/restart.jim';
if (confirm('Really sure?\n\nThere is a small chance the ' +
' Humax may not restart\n' +
'without physical intervention.\n\n' +
'i.e. pressing the standby button or using the ' +
'remote control'))
window.location = '/cgi-bin/restart.jim';
});
$('#restart_cancel').button()
.click(function() {

View File

@@ -419,7 +419,7 @@ proc {epg dbfetch} {mode args} {
lappend records [epg new $rec]
}
} msg]} {
puts "MSG: $msg"
puts "No cached EPG data, try again later ($msg)."
}
return $records
}

View File

@@ -65,7 +65,10 @@ $(document).ready(function() {
.attr('xe', o.attr('xe'));
$dialog.dialog('open');
}
$('a.event').click(function(e) { epgpopup(e, $(this)) });
$('a.event').click(function(e) {
e.preventDefault();
epgpopup(e, $(this))
});
});
</script>
}

View File

@@ -9,6 +9,7 @@ class pkg {
}
set ::pkgmeta {}
set ::diagmeta {}
pkg method _load {nm} {
set name $nm
@@ -85,6 +86,17 @@ proc {pkg loadmeta} {} {
}
}
proc {pkg loaddiagmeta} {} {
if {[llength $::diagmeta]} { return }
if {![file exists "/mod/var/diag.meta"]} {
catch {pkg fetchdiagmeta}
} else {
set meta [open "/mod/var/diag.meta" r]
set ::diagmeta [read $meta]
$meta close
}
}
proc {pkg fetchmeta} {} {
set f [socket stream hummypkg.org.uk:80]
$f puts -nonewline "GET /hdrfoxt2/pkg.meta HTTP/1.1\r\n"
@@ -103,3 +115,21 @@ proc {pkg fetchmeta} {} {
$ff close
}
proc {pkg fetchdiagmeta} {} {
set f [socket stream hummypkg.org.uk:80]
$f puts -nonewline "GET /diag/diag.meta HTTP/1.1\r\n"
$f puts -nonewline "Host: hummypkg.org.uk\r\n"
$f puts -nonewline "\r\n"
set line [string trim [$f gets]]
while {[string length $line]} {
set line [string trim [$f gets]]
}
set ::diagmeta [$f read]
$f close
set ff [open "/mod/var/diag.meta" w]
puts $ff $::diagmeta
$ff close
}

View File

@@ -60,7 +60,7 @@ rsv method aul {} {
for {set i 0} {$i < [string length $aulEventToRecordInfo]} {incr i 16} {
binary scan [string range $aulEventToRecordInfo $i $($i + 15)] \
iiii service start end event_id
lappend aul [list $service $start $end $event_id]
catch {lappend aul [list $service $start $end $event_id]}
}
return $aul
}
@@ -290,8 +290,8 @@ rsv method insert {{table pending} {force 0}} {
$rsvdb query $query
}
proc {rsv list} {{table tbl_reservation}} {
set res [$::rsvdb query "
proc {rsv list} {{table tbl_reservation} {extra ""}} {
set qstring "
select $table.*,
channel.TBL_SVC.szSvcName, channel.TBL_SVC.usLcn,
case when ersvtype > 3 then 1 else 0 end as sort1,
@@ -300,9 +300,15 @@ proc {rsv list} {{table tbl_reservation}} {
from $table
left join channel.TBL_SVC
on $table.hSvc = channel.TBL_SVC.hSvc
"
if {$extra ne ""} { append qstring $extra }
append qstring "
order by sort1, sort2 desc, nsttime
"]
"
#puts "QSTRING: ($qstring)"
set res [$::rsvdb query $qstring]
set records {}
foreach rec $res {
lappend records [rsv new $rec]

View File

@@ -24,6 +24,7 @@ class settings {
pkgdev 0
notoolbar 0
nomobile 0
xepghours 4
}
settings method hostname {{name ""}} {
@@ -102,6 +103,10 @@ settings method channel_group {{group -1}} {
return [$self _nval_setting channel_group $group]
}
settings method xepghours {{hours -1}} {
return [$self _nval_setting xepghours $hours]
}
settings method epg_style {{style -1}} {
if {$style != -1} {
if {$style eq "grid"} { set style 1 } else { set style 0}

View File

@@ -43,6 +43,16 @@ proc {system modversion} {{short 0}} {
return [format "%d.%d%d" $a $b $c]
}
proc {system modbuild} {} {
if {[catch {set fp [open /etc/modbuild r]}]} {
return 0
} else {
set modbuild [string trim [read $fp]]
close $fp
}
return $modbuild
}
proc {system fhtcpversion} {} {
set file "/etc/fhtcpversion"
if {![file exists $file]} { set file "/root/fhtcpversion" }

View File

@@ -23,6 +23,7 @@ class ts {
bookmarks 0
schedstart 0
scheddur 0
genre 0
}
ts method duration {{raw 0}} {
@@ -41,7 +42,8 @@ ts method _parse {line} {
lassign [split $line "\t"] \
title synopsis definition channel_num channel_name \
start end flags_list guidance bookmarks schedstart scheddur
start end flags_list guidance bookmarks schedstart scheddur \
genre
set flags [split [string range $flags_list 0 end-1] ,]
}
@@ -169,6 +171,22 @@ ts method settitle {newtitle} {
exec /mod/bin/hmt "+settitle=${newtitle}" $file
}
ts method setsynopsis {newsynopsis} {
if {[string length newsynopsis] > 48} { return }
exec /mod/bin/hmt "+setsynopsis=${newsynopsis}" $file
}
ts method setguidance {newguidance} {
if {[string length newguidance] > 48} { return }
exec /mod/bin/hmt "+setguidance=${newguidance}" $file
}
ts method setgenre {newgenre} {
exec /mod/bin/hmt "+setgenre=-${newgenre}" $file
}
ts method dlnaloc {{urlbase 0}} {
set mime "video/ts"
if {![file exists $::dmsfile]} { return {} }