Compare commits

..

23 Commits

Author SHA1 Message Date
hummypkg
9fb84443cd add rmdir_if_empty
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1654 2a923420-c742-0410-a762-8d5b09965624
2013-09-05 18:52:13 +00:00
hummypkg
0ae9a07cce update
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1651 2a923420-c742-0410-a762-8d5b09965624
2013-09-04 23:52:40 +00:00
hummypkg
ed20eec408 update
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1646 2a923420-c742-0410-a762-8d5b09965624
2013-08-30 21:22:30 +00:00
hummypkg
c095cc7913 1.0.5
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1632 2a923420-c742-0410-a762-8d5b09965624
2013-07-30 20:07:13 +00:00
hummypkg
b379bb64dc update for new channel icons
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1611 2a923420-c742-0410-a762-8d5b09965624
2013-07-11 22:13:36 +00:00
hummypkg
e82d303c95 update version
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1574 2a923420-c742-0410-a762-8d5b09965624
2013-06-24 21:42:11 +00:00
hummypkg
84a03f49bf webif updates
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1573 2a923420-c742-0410-a762-8d5b09965624
2013-06-24 21:34:46 +00:00
hummypkg
e0fea797bb update mongoose dependency
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1560 2a923420-c742-0410-a762-8d5b09965624
2013-05-16 21:02:24 +00:00
hummypkg
102ae13acb 1.0.2
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1545 2a923420-c742-0410-a762-8d5b09965624
2013-04-17 18:05:12 +00:00
hummypkg
0bca853384 1.0.1
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1534 2a923420-c742-0410-a762-8d5b09965624
2013-04-10 21:49:11 +00:00
hummypkg
38a079b0ba 1.0.0-2
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1524 2a923420-c742-0410-a762-8d5b09965624
2013-04-05 20:07:42 +00:00
hummypkg
cf0a6b5028 1.0.0 final
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1522 2a923420-c742-0410-a762-8d5b09965624
2013-04-04 22:44:16 +00:00
hummypkg
93cbf651ba synchronise scheduled event detection with RS code. Add blue shading
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1521 2a923420-c742-0410-a762-8d5b09965624
2013-04-04 22:20:41 +00:00
hummypkg
26ef83fbff add button links to foot of front page
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1520 2a923420-c742-0410-a762-8d5b09965624
2013-04-04 00:24:24 +00:00
hummypkg
a1e45d5e9c 1.0.0 rc
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1519 2a923420-c742-0410-a762-8d5b09965624
2013-04-03 23:50:25 +00:00
hummypkg
232546feef checkpoint on the way to 1.0.0
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1516 2a923420-c742-0410-a762-8d5b09965624
2013-04-03 22:42:15 +00:00
hummypkg
246112d68f new channelicons + nocase sort
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1502 2a923420-c742-0410-a762-8d5b09965624
2013-03-26 19:11:13 +00:00
hummypkg
b2c7be03a4 add thumbnail generation
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1445 2a923420-c742-0410-a762-8d5b09965624
2013-03-11 23:00:41 +00:00
hummypkg
ccf3cc1888 add thumbnail generation/display
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1442 2a923420-c742-0410-a762-8d5b09965624
2013-03-07 23:37:56 +00:00
hummypkg
9d3e52edd3 fix decrypt
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1441 2a923420-c742-0410-a762-8d5b09965624
2013-03-07 21:41:38 +00:00
hummypkg
612f9f8866 add automp3, fix ffmpeg
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1440 2a923420-c742-0410-a762-8d5b09965624
2013-03-06 22:49:28 +00:00
hummypkg
d4a4af756d fix ffmpeg
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1439 2a923420-c742-0410-a762-8d5b09965624
2013-03-06 19:46:44 +00:00
hummypkg
070fd7a749 update
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1436 2a923420-c742-0410-a762-8d5b09965624
2013-03-05 00:10:38 +00:00
129 changed files with 5580 additions and 2320 deletions

View File

@@ -1,9 +1,9 @@
Package: webif
Priority: optional
Section: web
Version: 0.13.1
Version: 1.0.5-5
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.0.4-1),mongoose(>=3.0-7),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.10),hmt(>=1.1.13),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.05)
Suggests: ffmpeg
Depends: webif-channelicons(>=1.1.4),mongoose(>=3.0-9),jim(>=0.73-1),jim-oo,jim-sqlite3(>=0.73-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6)
Suggests:
Description: An evolving web interface for the Humax.

View File

@@ -1,31 +1,44 @@
#!/bin/sh
echo "Postinstall $*"
export tmpf=/tmp/cronf.$$
# Add cron jobs
crond=$PKG_ROOT/var/spool/cron/crontabs
[ -d $crond ] || exit 1
cronf=$crond/root
grep -v webif/lib/bin/auto $cronf > $tmpf
(
cat $tmpf
echo '*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1'
) > $cronf
crontab=$PKG_ROOT/bin/crontab
if [ -x $crontab ]; then
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
cat $tmpf - << EOM | $crontab -
*/10 * * * * /mod/webif/lib/bin/auto >/dev/null 2>&1
EOM
fi
# Add anacron jobs
ana=$PKG_ROOT/etc/anacrontab
grep -v 'backup/backup.jim' $ana > $tmpf
(
cat $tmpf
echo "1 8 sched_backup /mod/var/mongoose/cgi-bin/backup/backup.jim"
) > $ana
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
cat $tmpf - << EOM > $ana
1 8 sched_backup /mod/webif/cgi-bin/backup/backup.jim
1 5 diskattrs /mod/webif/lib/bin/diskattrs
EOM
$PKG_ROOT/etc/init.d/S02anacron start < /dev/null > /dev/null 2>&1 &
[ -f /tmp/webif_auto.log ] && rm -f /tmp/webif_auto.log
if [ ! -f /mod/webif/.strip-updated ]; then
echo "*********************************"
echo "* Please wait while any shrunk recordings are flagged..."
echo "*********************************"
/mod/webif/lib/bin/strip-update
touch /mod/webif/.strip-updated
fi
/mod/webif/lib/bin/diskattrs
[ -f $tmpf ] && rm -f $tmpf
exit 0

View File

@@ -2,16 +2,17 @@
export tmpf=/tmp/cronf.$$
cronf=$PKG_ROOT/var/spool/cron/crontabs/root
if [ -f $cronf ]; then
grep -v webif/lib/bin/auto $cronf > $tmpf
cp $tmpf $cronf
[ -s $cronf ] || rm -f $cronf
crontab=$PKG_ROOT/bin/crontab
if [ -x $crontab ]; then
$crontab -l | grep -v webif/lib/bin/auto > $tmpf
[ -s $tmpf ] && $crontab $tmpf || $crontab -r
fi
ana=/mod/etc/anacrontab
grep -v 'backup/backup.jim' $ana > $tmpf
egrep -v 'backup/backup.jim|bin/diskattrs' $ana > $tmpf
cp $tmpf $ana
[ -f $tmpf ] && rm -f $tmpf
exit 0

View File

@@ -67,7 +67,7 @@ foreach tw [$db query {
"BBC ONE" { set mux "PSB1/BBC A" }
"ITV1" { set mux "PSB2/D3&amp;4" }
"ITV" { set mux "PSB2/D3&amp;4" }
"BBC One HD" { set mux "PSB3/BBC B (HD)" }
"BBC ONE HD" { set mux "PSB3/BBC B (HD)" }
"ITV3" { set mux "COM4/SDN" }
"Dave" { set mux "COM5/ARQ A" }
"Film4" { set mux "COM6/ARQ B" }

View File

@@ -6,6 +6,7 @@ source /mod/webif/lib/setup
require altrow
set databases [glob /var/lib/humaxtv/*.db]
lappend databases {*}[glob /mod/etc/*.db]
lappend databases "/mnt/hd2/dms_cds.db"
header

View File

@@ -7,7 +7,8 @@ require settings.class plugin system.class
httpheader
if {[cgi_get act] eq "https"} {
if {[cgi_get val off] eq "off"} {
set val [cgi_get val off]
if {$val in {0 off}} {
file delete /mod/etc/mongoose.cert
puts "HTTPS Server will be disabled after next reboot."
} else {
@@ -18,7 +19,8 @@ if {[cgi_get act] eq "https"} {
}
if {[cgi_get act] eq "xtelnet"} {
if {[cgi_get val off] eq "off"} {
set val [cgi_get val off]
if {$val in {0 off}} {
file delete /mod/boot/xtelnet
puts "Telnet server expert mode will be disabled after next reboot."
} else {
@@ -37,9 +39,11 @@ set epg_style [$settings epg_style]
set pkgdev [$settings pkgdev]
set notoolbar [$settings notoolbar]
set nomobile [$settings nomobile]
set nohelplinks [$settings nohelplinks]
set xepghours [$settings xepghours]
if {$xepghours == 0} { set xepghours 4 }
set genrededup [$settings genrededup]
set autolog [$settings autolog]
# Handle updates
@@ -79,7 +83,9 @@ handle_str_update epg_style $epg_style "EPG Type"
handle_int_update pkgdev $pkgdev "Development Package Display"
handle_int_update notoolbar $notoolbar "Disable toolbar"
handle_int_update nomobile $nomobile "Disable mobile link"
handle_int_update nohelplinks $nohelplinks "Disable help links"
handle_int_update genrededup $genrededup "Genre search dedup"
handle_int_update autolog $autolog "Auto-processing log level"
set acluser [cgi_get acluser "-"]
set aclpass [cgi_get aclpass "-"]
@@ -120,6 +126,22 @@ puts {
<link href=/css/iphone-style-checkboxes.css rel=stylesheet type=text/css />
}
proc setting_toggle {name attr checked {invert 0} {val 0}} {
puts -nonewline "
<tr>
<th class=key>$name</th>
<td><input class=setting_toggle type=checkbox value=yes"
if {$checked} { puts -nonewline " checked" }
puts -nonewline " attr=$attr"
if {$invert} { puts -nonewline " invert=1" }
if {$val} { puts -nonewline " useval=1" }
puts -nonewline ">
<div id=${attr}_output></div>
</td>
</tr>
"
}
puts "
<fieldset style=\"display: inline\">
<legend>
@@ -144,36 +166,36 @@ puts "
</tr>
"
puts -nonewline "
<tr>
<th class=key>HTTPS web server?</th>
<td><input id=https_toggle name=https type=checkbox value=yes"
if {[file exists /mod/etc/mongoose.cert]} { puts -nonewline " checked" }
puts ">
<div id=https_output></div>
</td>
</tr>
"
setting_toggle "HTTPS web server?" "https" \
[file exists /mod/etc/mongoose.cert] 0 1
setting_toggle "Slide-down toolbar?" "notoolbar" $(!$notoolbar) 1
setting_toggle "Mobile link on main page?" "nomobile" $(!$nomobile) 1
setting_toggle "Help links on main page?" "nohelplinks" $(!$nohelplinks) 1
puts -nonewline "
<tr>
<th class=key>Slide-down toolbar?</th>
<td><input id=toolbar_toggle name=toolbar type=checkbox value=yes"
if {$notoolbar == 0} { puts -nonewline " checked" }
puts ">
<div id=toolbar_output></div>
</td>
</tr>
<form class=auto id=autolog method=get action=$env(REQUEST_URI)>
<th class=key>Auto-processing log level</th>
<td><select id=autolog name=autolog
class=\"text ui-widget-content ui-corner-all\">
"
puts -nonewline "
<tr>
<th class=key>Mobile link on main page?</th>
<td><input id=mobile_toggle name=mobile type=checkbox value=yes"
if {$nomobile == 0} { puts -nonewline " checked" }
puts ">
<div id=mobile_output></div>
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 == 1} { puts " selected" }
puts ">Debugging information\n"
puts "
</select>
<small>
<input name=autolog value=\"set\" type=submit>
</small>
<div id=autolog_output></div>
</td>
</form>
</tr>
"
@@ -268,49 +290,43 @@ puts "
</tr>
"
puts -nonewline "
<tr>
<th class=key>De-duplicate genre search results?</th>
<td><input id=genrededup_toggle name=genrededup type=checkbox value=yes"
if {$genrededup == 1} { puts -nonewline " checked" }
puts ">
<div id=genrededup_output></div>
</td>
</tr>
"
setting_toggle "De-duplicate genre search results?" genrededup $genrededup
puts "
</table>
</fieldset>
<br><br>
<fieldset style=\"display: inline\">
<legend> Email Settings </legend>
<table>
"
puts "
<tr>
<form class=auto id=smtp_server method=get action=$env(REQUEST_URI)>
<th class=key>SMTP Server for outbound email</th>
<td><input name=smtp_server value=\"$smtp_server\"
class=\"text ui-widget-content ui-corner-all\"
length=20 maxlength=50>
<small>
<input id=smtp_server_submit value=\"change\" type=submit>
</small>
<div id=smtp_server_output></div>
</td>
</form>
</tr>
"
#puts "
# <fieldset style=\"display: inline\">
# <legend> Email Settings </legend>
# <table>
#"
#
#puts "
# <tr>
# <form class=auto id=smtp_server method=get action=$env(REQUEST_URI)>
# <th class=key>SMTP Server for outbound email</th>
# <td><input name=smtp_server value=\"$smtp_server\"
# class=\"text ui-widget-content ui-corner-all\"
# length=20 maxlength=50>
# <small>
# <input id=smtp_server_submit value=\"change\" type=submit>
# </small>
# <div id=smtp_server_output></div>
# </td>
# </form>
# </tr>
#"
#
#puts "
# </table>
# </fieldset>
# <br><br>
#"
puts "
</table>
</fieldset>
"
puts "
<br><br>
<fieldset style=\"display: inline\">
<legend> Web Interface User Access Control </legend>
<table>
@@ -405,34 +421,16 @@ puts -nonewline "
<fieldset style=\"display: inline\">
<legend> Advanced Settings </legend>
<table>
<tr>
<th class=key>Show development and advanced packages?</th>
<td><input name=pkgdev id=pkgdev value=1 type=checkbox
"
if {$pkgdev} { puts -nonewline " checked" }
puts ">
</td>
</tr>
"
setting_toggle "Show development and advanced packages?" "pkgdev" $pkgdev
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>
"
setting_toggle "Expert mode telnet server?" "xtelnet" \
[file exists /mod/boot/xtelnet] 0 1
}
puts "
</table>
<div id=pkgdev_output></div>
</fieldset>
"

View File

@@ -41,117 +41,33 @@ $(document).ready(function () {
});
});
$('#pkgdev').change(function() {
$('.setting_toggle').change(function() {
var arg = '0';
var urlargs;
if ($(this).attr('checked'))
arg = '1';
$(this).disable();
if ($(this).attr('invert'))
arg = arg == "0" ? "1" : "0";
$('#pkgdev_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?pkgdev=' + arg,
function() {
$('#pkgdev').enable();
$('#pkgdev_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
var el = $(this);
var attr = $(this).attr('attr');
var output = '#' + attr + '_output';
$('#https_toggle').change(function() {
var arg = 'off';
if ($(this).attr('checked'))
arg = 'on';
if ($(this).attr('useval'))
urlargs = 'act=' + attr + '&val=' + arg;
else
urlargs = attr + '=' + arg;
$(this).disable();
$('#https_output')
.empty()
.html('<img src=/img/loading.gif>Please Wait...')
.show('slow')
.load('/cgi-bin/settings.jim?act=https&val=' + arg,
function() {
$('#https_toggle').enable();
$('#https_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#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'))
arg = '0';
$(this).disable();
$('#toolbar_output')
$(output)
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?notoolbar=' + arg,
.load('/cgi-bin/settings.jim?' + urlargs,
function() {
$('#toolbar_toggle').enable();
$('#toolbar_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#mobile_toggle').change(function() {
var arg = '1';
if ($(this).attr('checked'))
arg = '0';
$(this).disable();
$('#mobile_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?nomobile=' + arg,
function() {
$('#mobile_toggle').enable();
$('#mobile_output')
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});
});
$('#genrededup_toggle').change(function() {
var arg = '0';
if ($(this).attr('checked'))
arg = '1';
$(this).disable();
$('#genrededup_output')
.empty()
.show('slow')
.load('/cgi-bin/settings.jim?genrededup=' + arg,
function() {
$('#genrededup_toggle').enable();
$('#genrededup_output')
$(el).enable();
$(output)
.css('font-style', 'italic')
.delay(2000).fadeOut('slow');
});

View File

@@ -63,7 +63,10 @@ if {[llength $data]} {
foreach name [array names ndata] {
if {![dict exists $seen $name]} { set seen($name) 0 }
if {![dict exists $data $name]} { set data($name) 0 }
if {$ndata($name) == -1} {
if {[file exists "/mod/tmp/webif_auto/decrypting.$name.ts"]} {
set mode "Decrypting"
set icon "178_1_00_Icon_Lock.png style=\"padding: 0 0.2em 0 0.5em\""
} elseif {$ndata($name) == -1} {
incr rec
incr play
set mode "Chase Playing"

View File

@@ -123,7 +123,7 @@ foreach e $records {
puts "[$e channel_icon 30]&nbsp;"
puts "$chnum
<a href=/cgi-bin/epg/service.jim?service=[$e get service_id]
<a href=\"/cgi-bin/epg/service.jim?service=[$e get service_id]\"
title=\"[$e get channel_name]\">
[$e get channel_name]
</a></div>"
@@ -173,7 +173,10 @@ foreach e $records {
clock format $ee -format "%H:%M"])"
if {$showing} { append hxt " ($perc%)" }
puts "<div class=\"xeprog $bg\"
set lbg $bg
if {[$e scheduled]} { set lbg "blueshade" }
puts "<div class=\"xeprog $lbg\"
style=\"width: [expr $px - 4]px;\" title=\"$htxt\">
<a class=event href=# xs=[$e get service_id]
xe=[$e get event_id] sch=[$e get sched_type]
@@ -221,7 +224,7 @@ puts "
onSelect: function(val, sel) {
var stt = \$(this).attr('stt');
// Extract date part
dval = ~~(val / 86400000);
dval = Math.round(val / 86400000.0);
// Extract current time part
var tm = ~~(stt % 86400);

View File

@@ -21,10 +21,14 @@ if {$model eq "HDR"} {
}
if {[system pkginst ffmpeg]} {
puts {
<li><a href=#audio>Extract Audio</a></li>
<li><a href=#mpg>Extract to MPG</a></li>
<li class=mp3><a href=#audio>Extract Audio</a></li>
<li class=mpg><a href=#mpg>Extract to MPG</a></li>
<li class=thm><a href=#thm>Set Thumbnail</a></li>
}
}
puts { <li><a href=#vthm>View Thumbnail</a></li> }
if $nicesplice {
puts {
<li class="cut"><a href=#crop>Crop</a></li>
@@ -77,7 +81,16 @@ if $flatten {
puts {
<li class=clock><a href=#expire>Auto-Expire</a></li>
<li class=mpg><a href=#mpg>Auto-MPG Extract</a></li>
}
if {[system pkginst ffmpeg]} {
puts {
<li class=mp3><a href=#mp3>Auto-Audio Extract</a></li>
<li class=mpg><a href=#mpg>Auto-MPG Extract</a></li>
}
}
puts {
</ul>
<div id=renameform title="Rename media file" style="display: none">
@@ -255,7 +268,7 @@ puts {
</label>
</th>
<td>
<input type=text name="aexpiry_days" id="aexpiry_days"
<input name="aexpiry_days" id="aexpiry_days"
type=number value=0 size=5 maxlength=3
class="text ui-widget-content ui-corner-all">
</td>
@@ -278,5 +291,9 @@ Please wait...
</center>
</div>
<div id=bmpdialogue title="Recording Thumbnail" class=hidden>
<img id=thmbmp class=doublebmp src="about:blank">
</div>
}

View File

@@ -0,0 +1,19 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require cat
set file [cgi_get file]
set file "[file rootname $file].thm"
if {![file exists $file]} {
httpheader "text/plain"
puts "No such file, $file"
exit
}
httpheader "image/bmp"
cat "/mod/webif/lib/bmpheader"
cat $file

View File

@@ -49,6 +49,8 @@ set newname "$shname-[clock seconds]"
puts "Renaming file group to $newname"
ts renamegroup "$dir/$shname.ts" $newname
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
# New nicesplice shrinks whilst cropping.
exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
set croptime [expr [expr [clock milliseconds] - $cropstart] / 1000.0]
puts "Time taken: $croptime"

View File

@@ -11,7 +11,7 @@ set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc] url
lassign [$ts dlnaloc "127.0.0.1"] url
puts "
<link href=/css/jquery.progressbar.css rel=stylesheet type=text/css />

View File

@@ -11,7 +11,7 @@ set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts dlnaloc] url
lassign [$ts dlnaloc "127.0.0.1"] url
if {$url eq ""} {
puts "This file has not been indexed by the media server.

View File

@@ -23,7 +23,12 @@ if {$type eq "ts"} {
<table class=keyval>
<tr>
<th>Title</th>
<td>[$ts get title]</td>
<td class=va>
"
if {[file exists "[file rootname $file].thm"]} {
puts "<img class=\"bmp va\" width=70 height=39 src=\"bmp.jim?file=$file\">"
}
puts "[$ts get title]</td>
</tr><tr>
<th>Synopsis</th>
<td>[$ts get synopsis]</td>
@@ -146,7 +151,7 @@ puts "
</table>
"
set url "/bin/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
set url "/browse/ffmpeg.jim?file=[cgi_quote_url $file]"
puts { <script type="text/javascript"> }
puts "var url = \"$url\";"
puts {

View File

@@ -77,13 +77,19 @@ proc directory {file bfile tbfile} {
puts "</div>"
}
set dircount 0
set filecount 0
proc entry {file} {{i 0}} {
global dircount filecount
set bfile [file tail $file]
regsub -all " +" $bfile "" tbfile
if {[string index $bfile 0] == "\025"} {
set bfile [string range $bfile 1 end]
}
if [file isdirectory "$file"] {
incr dircount
directory $file $bfile $tbfile
return
}
@@ -96,11 +102,13 @@ proc entry {file} {{i 0}} {
set base [file rootname $file]
set thmok 0
if {$ext eq ".ts" && [file exists "${base}.nts"]} {
set type ts
set ts [ts fetch $file 1]
set img Video_TS
set omenu opt
if {[file exists "${base}.thm"]} { set thmok 1 }
} elseif {$ext eq ".hmt"} {
if {[file exists "${base}.ts"]} { continue }
# Sole hmt file indicates failure to track.
@@ -114,6 +122,7 @@ proc entry {file} {{i 0}} {
set img Video_Other
set omenu oopt
}
incr filecount
set new 0
if {$type eq "ts"} {
@@ -152,6 +161,7 @@ proc entry {file} {{i 0}} {
set def unknown
set bx 0
set dlna 0
set shrunk 0
if {$type eq "ts"} {
set genre [$ts get genre]
set glist [ts genrelist]
@@ -204,12 +214,11 @@ proc entry {file} {{i 0}} {
set dlna 1
}
# Shrunk (shown when necessary via Ajax)
icon "/img/compress.png" "Shrunk" \
"id=\"sp_$tbfile\"" "va hidden"
# Timeshifted (shown when necessary via Ajax)
# icon "/img/clock.png" "Time-shifted Recording" \
# "id=\"tsr_$tbfile\"" "va hidden"
# Shrunk
if {[$ts flag Shrunk]} {
icon "/img/compress.png" "Shrunk"
set shrunk 1
}
set bx [$ts get bookmarks]
}
@@ -220,8 +229,8 @@ proc entry {file} {{i 0}} {
<a href=#>
<img class=\"$omenu va\" border=0 width=45 type=$type did=$i
locked=$locked encd=$encd def=$def new=$new bx=$bx
rsize=$rsz
odencd=$odencd dlna=$dlna
shrunk=$shrunk rsize=$rsz
odencd=$odencd dlna=$dlna thmok=$thmok
src=/images/181_1_00_Help5_OPT_Plus.png>
</a>
<div class=\"results blood\" style=\"margin: 0 0 0 5em\"></div>
@@ -259,7 +268,7 @@ set stub ""
foreach part [split $dir /] {
if {$stub eq "/"} { set name $part } else { set name "/$part" }
append stub $name
puts "<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $stub]>$name</a>
puts "<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $stub]\">$name</a>
}
puts "<span class=filesize id=dirsize></span>"
puts "</legend>"
@@ -269,7 +278,7 @@ set parent [join [lrange [split $dir /] 0 end-1] /]
if {$parent ne ""} {
puts "
<div class=va>
<a href=$env(REQUEST_URI)?dir=[cgi_quote_url $parent]>
<a href=\"$env(REQUEST_URI)?dir=[cgi_quote_url $parent]\">
<img border=0 src=/images/711_3_09_Media_Folder_UP.png class=va>
\[parent directory\]</a>
</div>
@@ -306,12 +315,16 @@ proc s_time {a b} {
set files [readdir -nocomplain $dir]
switch $order {
1 { set files [lsort -command s_time $files] }
default { set files [lsort $files] }
default { set files [lsort -nocase $files] }
}
foreach file $files { entry "$dir/$file" }
puts "<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>"
puts "
<a href=# id=selectall>Select all</a> | <a href=# id=deselectall>none</a>
&nbsp;&nbsp;
Directories: $dircount, Files: $filecount
"
# Sort icons
puts "<div id=sortdiv>"
@@ -324,7 +337,7 @@ foreach sl $sortlist {
set tag "Currently sorting"
if {$order != $index} {
puts "
<a href=$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index>"
<a href=\"$env(REQUEST_URI)?$env(QUERY_STRING)&order=$index\">"
set tag "Sort"
}
puts "<img class=va border=0 src=/img/$img.gif> $tag by $descr"

View File

@@ -15,6 +15,7 @@ foreach dir [glob -nocomplain "$root"] {
if {[file exists "$dir/.series"]} {
set fd [open "$dir/.series"]
set bytes [read $fd 8]
$fd close
set recs [unpack $bytes -uintle 0 32]
set plays [unpack $bytes -uintle 32 32]
set diff $($recs - $plays)

View File

@@ -1,45 +1,12 @@
#!/mod/bin/jimsh
package require cgi
package require pack
source /mod/webif/lib/setup
require ts.class hexdump
require ts.class
httpheader
set dir [cgi_get dir]
if {![file isdirectory $dir]} { exit }
if {![file exists "$dir/.series"]} { exit }
set tot 0
set watched 0
foreach file [readdir -nocomplain $dir] {
if {![string match {*.ts} $file]} { continue }
#puts "FILE: $file"
incr tot
if {[set ts [ts fetch "$dir/$file"]] != 0} {
if {![$ts flag "New"]} { incr watched }
}
}
set fd [open "$dir/.series"]
set bytes [read $fd]
close $fd
set recs [unpack $bytes -uintle 0 32]
set played [unpack $bytes -uintle 32 32]
puts "Current: $played/$recs"
#hexdump $bytes
puts "Calculated: $watched/$tot"
pack bytes $tot -intle 32 0
pack bytes $watched -intle 32 32
#hexdump $bytes
set fd [open "$dir/.series" "w"]
puts -nonewline $fd $bytes
close $fd
ts resetnew $dir

View File

@@ -125,23 +125,23 @@ function new_folder_callback(data, status, xhr)
$.each(data, set_folder_new);
}
function insert_shrunk(file, perc)
{
if (perc == 0)
{
file = file.replace(/[ ]/g, '');
file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
//console.log("File: (%s) = (%s)", file, perc);
$('#sp_' + file).show();
}
}
//function insert_shrunk(file, perc)
//{
// if (perc == 0)
// {
// file = file.replace(/[ ]/g, '');
// file = file.replace(/([ #;&,.+*~\':"!^$[\]()=>|\/@])/g, '\\$1');
// //console.log("File: (%s) = (%s)", file, perc);
// $('#sp_' + file).show();
// }
//}
function shrunk_callback(data, status, xhr)
{
//console.log("Status: %s", status);
//console.dir(data);
$.each(data, insert_shrunk);
}
//function shrunk_callback(data, status, xhr)
//{
// //console.log("Status: %s", status);
// //console.dir(data);
// $.each(data, insert_shrunk);
//}
function delete_callback(file, dir, id)
{
@@ -178,6 +178,20 @@ function new_callback(file, type, id)
$.get(url, function() { window.location.reload(true); });
}
function thumbnail_callback(file, type, id)
{
var el = 'div.bf#' + id;
var results = el + ' .results';
$(results)
.html('<img src=/img/loading.gif>Generating thumbnail, ' +
'please wait...')
.slideDown('slow')
.load('/browse/thumbnail.jim?file=' + file)
.delay(3000)
.slideUp('slow');
$('div.bf#' + id + ' img.opt').attr('thmok', 1);
}
function rename_submit()
{
var s = $('#renameform_form').serialize();
@@ -257,6 +271,16 @@ function preparemenu(el, menu)
else
$(menu).disableContextMenuItems('#crop');
if (el.attr('odencd') == 0)
$(menu).enableContextMenuItems('#thm');
else
$(menu).disableContextMenuItems('#thm');
if (el.attr('thmok') == 1)
$(menu).enableContextMenuItems('#vthm');
else
$(menu).disableContextMenuItems('#vthm');
$(menu).enableContextMenuItems('#strip');
if (el.attr('rsize') > 4294967296)
@@ -358,13 +382,13 @@ function preparedmenu(el, menu)
fixdmenu(el, menu, 'autodedup', '#dedup', 'Auto-dedup', 0);
fixdmenu(el, menu, 'autodecrypt', '#decrypt', 'Auto-decrypt', 1);
fixdmenu(el, menu, 'autompg', '#mpg', 'Auto-mpg', 0);
fixdmenu(el, menu, 'automp3', '#mp3', 'Auto-audio', 0);
fixdmenu(el, menu, 'autoexpire', '#expire', 'Auto-expire', 0);
}
$(document).ready(function() {
dir = $('#dir').text();
mediaroot = $('#mediaroot').text();
var menuclick = function(action, el, pos)
{
@@ -424,6 +448,19 @@ var menuclick = function(action, el, pos)
$('#renameform').dialog('open');
break;
case 'thm':
window.location.href = '/browse/thumbnail/index.jim?file=' +
file;
break;
case 'vthm':
// window.open('/browse/bmpw.jim?file=' + file, 'hxwebifbmp',
// 'height=156,width=280,toolbar=no,' +
// 'scrollbars=no,menubar=no,location=no,titlebar=no');
$('#thmbmp').attr('src', 'bmp.jim?file=' + file);
$('#bmpdialogue').dialog('open');
break;
case 'download':
window.location.href = '/browse/download.jim?file=' +
file + '&base=' +
@@ -570,6 +607,10 @@ var dmenuclick = function(action, el, pos)
flagdir(file, 'autompg', iconset, results, el);
break;
case 'mp3':
flagdir(file, 'automp3', iconset, results, el);
break;
case 'shrink':
flagdir(file, 'autoshrink', iconset, results, el);
break;
@@ -744,6 +785,18 @@ var dmenuclick = function(action, el, pos)
close: function() { $('#savestream_name').val(''); }
});
$('#bmpdialogue').dialog({
autoOpen: false,
height: 'auto', width: 'auto',
modal: true,
buttons: {
"Close": function() {
$(this).dialog('close');
}
},
close: function() { $('#thmbmp').attr('src', 'about:blank'); }
});
// Create re-usable confirmation dialogue.
$confirm = $('#confirm').dialog({
modal: true, autoOpen: false,
@@ -757,8 +810,8 @@ var dmenuclick = function(action, el, pos)
folder_size_callback);
// Flag shrunk recordings
$.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
shrunk_callback);
// $.getJSON('/browse/shrunk.jim?dir=' + encodeURIComponent(dir),
// shrunk_callback);
// Flag folders with unwatched items
$.getJSON('/browse/newdir.jim?dir=' + encodeURIComponent(dir),

View File

@@ -2,18 +2,29 @@
package require cgi
source /mod/webif/lib/setup
require ts.class
httpheader "application/json"
set dir [cgi_get dir "/media/My Video/Children"]
set dir [cgi_get dir "-"]
if {$dir eq "-"} exit
puts "{"
foreach file [readdir -nocomplain $dir] {
if {![string match {*.ts} $file]} { continue }
set xfile [file rootname $file]
if {[catch {set eit [exec /mod/bin/stripts -cq "$dir/$xfile"]}]} {
continue
if {[catch {set ts [ts fetch "$dir/$file"]}]} continue
set eit 1
if {[$ts flag "Shrunk"]} { set eit 0 }
if {$eit} {
set xfile [file rootname $file]
if {[catch {set eit [\
exec /mod/bin/stripts -cq "$dir/$xfile"]}]} {
continue
}
if {!$eit} { $ts set_shrunk }
}
puts " \"$file\": $eit,"

View File

@@ -43,6 +43,7 @@ set newname "$shname-[clock seconds]"
puts "Renaming file group to $newname"
ts renamegroup "$dir/$shname.ts" $newname
exec /mod/bin/hmt "+setfilename=$newname" "$dir/$newname.hmt"
exec /mod/bin/hmt "+shrunk" "$dir/$newname.hmt"
set striptime [expr [expr [clock milliseconds] - $stripstart] / 1000.0]
puts "Time taken: $striptime"

View File

@@ -0,0 +1,19 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class cat
httpheader "image/bmp"
set rfile [cgi_get file]
set pos [cgi_get pos 0]
if {![catch {set ts [ts fetch $rfile]}]} {
$ts mkbmp $pos ".pos$pos"
set f "[file rootname $rfile].pos$pos.bmp"
cat $f
file delete $f
}

View File

@@ -0,0 +1,17 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require cat
httpheader "image/bmp"
set rfile [cgi_get file]
set pos [cgi_get pos 0]
set f "[file rootname $rfile].pos$pos.bmp"
if {[file exists $f]} {
cat $f
file delete $f
}

View File

@@ -0,0 +1,98 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class pretty_size
header
set rfile [cgi_get file]
set ts [ts fetch $rfile]
set dir [file dirname $rfile]
set len [$ts duration 1]
lassign [$ts bookmarks] book
if {$book eq ""} { set book 0 }
set pos [cgi_get pos $book]
set pos $($pos + 0)
if {$pos < 0} { set pos 0 }
puts "
<script type=text/javascript src=script.js></script>
<script type=text/javascript src=/js/enadis.js></script>
<fieldset class=cleft>
<legend>Replace Thumbnail</legend>
<table class=keyval cellpadding=5>
<tr><th>File:</th><td>
<span class=hidden id=dir>[file dirname $rfile]</span>
<span id=file>$rfile</span>
</td></tr>
<tr><th>Length:</th><td>[clock format $len -format %T]</td></tr>
<tr><th>Size:</th><td>[pretty_size [$ts size]] ([$ts get definition])</td></tr>
<tr><th>Bookmarks:</th><td>[$ts get bookmarks] ($book second(s))</td></tr>
<tr><th>Thumbnail:</th><td>
<img class=doublebmp src=\"../bmp.jim?file=[cgi_quote_url $rfile]\">
</td></tr>
</table>
"
if {[$ts get definition] eq "HD"} {
set start $($pos - 0.5)
set incr 1.0
} else {
set start $($pos - 1)
set incr 2.0
}
if {$start < 0} { set start 0 }
set limit $($start + $incr)
puts "<div style=\"width=100%; text-align: center\">
<button id=back>Back to media browser</button>
<br /> <br />
<form method=get action=index.jim>
<input type=hidden name=file value=\"$rfile\">
Thumbnails from around
<input name=pos id=pos size=5 maxlength=4 value=\"$pos\">
second(s) into recording.
</form>
<button class=mvpos pos=[expr $pos - 30]>&lt;&lt; 30 seconds</button>
<button class=mvpos pos=[expr $pos - 5]>&lt; 5 seconds</button>
<button id=repos>Update</button>
<button class=mvpos pos=[expr $pos + 5]>&gt; 5 seconds</button>
<button class=mvpos pos=[expr $pos + 30]>&gt;&gt; 30 seconds</button>
</div>
<span id=start class=hidden>$start</span>
<span id=end class=hidden>$limit</span>
<table class=keyval cellpadding=5>
<tr>
"
for {set i [expr $start + 0.0]} {$i <= $limit} {set i [expr $i + 0.5]} {
lappend times $i
puts "<th style=\"text-align: center\">
@ <span class=mark>$i</span>s</th>"
}
puts "</tr><tr>"
foreach i $times {
puts "<td>
<img class=bmp src=/img/generating.png pos=$i>
</td>"
}
puts "</tr><tr>"
foreach i $times {
puts "<td style=\"text-align: center\">
<button class=usethm pos=\"$i\">Use</button>
</td>"
}
puts "</tr>"
puts "</table>"

View File

@@ -0,0 +1,21 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class
httpheader
set rfile [cgi_get file]
set s [cgi_get s 0]
set e [cgi_get e $($s + 2)]
set i [expr [cgi_get i 0.5] + 0.0]
if {![catch {set ts [ts fetch $rfile]}]} {
$ts cleanbmp
for {set n [expr $s + 0.0]} {$n <= $e} {set n [expr $n + $i]} {
puts "Generating thumbnail for pos $n"
$ts mkbmp $n ".pos$n"
}
}

View File

@@ -0,0 +1,58 @@
$(document).ready(function() {
var dir = $('#dir').text();
var file = $('#file').text();
$('button').button();
function go(pos)
{
window.location.href = 'index.jim?file=' +
encodeURIComponent(file) + '&pos=' + pos;
}
$('button.mvpos').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
go(pos);
});
$('#repos').disable().on('click', function(e) {
e.preventDefault();
var pos = $('#pos').val();
go(pos);
});
$('#back').on('click', function(e) {
e.preventDefault();
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});
$('button.usethm').disable().on('click', function(e) {
e.preventDefault();
var pos = $(this).attr('pos');
$('button,input').disable();
$.get('set.jim?file=' + encodeURIComponent(file) + '&pos=' + pos,
function() {
window.location.href = '/browse/index.jim?dir=' +
encodeURIComponent(dir);
});;
});
var start = $('#start').text();
var end = $('#end').text();
$.get('mkrange.jim?file=' + encodeURIComponent(file) +
'&s=' + start + '&e=' + end, function() {
$('img.bmp').each(function(i) {
var pos = $(this).attr('pos');
$(this).attr('src',
'fetch.jim?file=' + encodeURIComponent(file) +
'&pos=' + pos);
});
$('button').enable();
});
});

View File

@@ -0,0 +1,15 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require ts.class
httpheader
set file [cgi_get file]
set pos [cgi_get pos 0]
if {![catch {set ts [ts fetch $file]}]} {
$ts mkthm $pos
}

View File

@@ -70,6 +70,8 @@
.contextMenu LI.decrypt A { background-image: url(/img/context/decrypt.png); }
.contextMenu LI.decryptr A { background-image: url(/img/context/decryptr.png); }
.contextMenu LI.mpg A { background-image: url(/img/context/mpg.png); }
.contextMenu LI.mp3 A { background-image: url(/img/context/mp3.png); }
.contextMenu LI.clock A { background-image: url(/img/context/clock.png); }
.contextMenu LI.thm A { background-image: url(/img/context/thumb.png); }

View File

@@ -65,13 +65,33 @@ div.footer
padding-top: 2em;
}
div.warningbox
div.owarningbox
{
background: url('/img/redshade.png') repeat-x;
padding: 0.5em;
margin: 1em;
}
div.warningbox
{
width: 60%;
background: url('/img/redshade.png') repeat-x;
background-size: 100%;
#color: #005000;
border: 1px solid #7a4707;
padding: 10px;
position: relative;
top: -2px;
left: -2px;
font-weight: bold;
z-index: 30;
box-shadow: 2px 2px 11px #666;
-moz-box-shadow: 2px 2px 11px #666;
-webkit-box-shadow: 2px 2px 11px #666;
border-radius: 5px;
-moz-border-radius: 5px;
}
table
{
empty-cells: show;
@@ -410,3 +430,18 @@ div#restart_block
z-index: 31;
}
img.bmp, img.doublebmp
{
transform: scaleY(-1);
-webkit-transform: scaleY(-1);
-o-transform: scaleY(-1);
height: 78px;
width: 140px;
}
img.doublebmp
{
height: 156px;
width: 280px;
}

View File

@@ -26,6 +26,7 @@ puts "<fieldset style=\"display: inline\">
"
loadseries $dir
set recalc 0
foreach file [readdir $dir] {
set file "$dir/$file"
if {[file extension $file] ne ".hmt"} { continue }
@@ -52,6 +53,7 @@ foreach file [readdir $dir] {
}
ts renamegroup $file "_duplicates/$fn"
puts -nonewline " - Renamed to _duplicates/$fn"
incr recalc
}
}
error {
@@ -78,6 +80,8 @@ foreach file [readdir $dir] {
puts "</tr>"
}
if {$recalc} { ts resetnew $dir }
puts {
</table>
</fieldset>

View File

@@ -9,10 +9,12 @@ set logdirs {/var/log /mod/tmp /mnt/hd3}
set logext {.log}
set log [cgi_get file 0]
set unlink [cgi_get unlink 0]
set ldir [file dirname $log]
if {[file dirname $log] in $logdirs && [file extension $log] in $logext} {
file copy -force "/dev/null" $log
if {$unlink} { file delete $log }
puts "Cleared $log"
exit
}

View File

@@ -11,6 +11,9 @@ pkg loaddiagmeta
set smv [system modversion 1]
puts {
<style>
button.half { width: 48%; }
</style>
<script type=text/javascript src=/js/enadis.js></script>
<script type=text/javascript src=script.js></script>
@@ -54,8 +57,8 @@ puts {
<tr>
<td colspan=2 align=center>
<button id=runedit style="width: 48%">File Editor</button>
<button id=dbinfo style="width: 48%">Database Browser</button>
<button id=runedit class=half>File Editor</button>
<button id=dbinfo class=half>Database Browser</button>
</td>
</tr>
@@ -63,26 +66,25 @@ puts {
<td colspan=2 align=center>
}
if {[system model] eq "HDR"} {
puts { <button id=diskdiag style="width: 48%">Hard Disk</button> }
puts { <button id=diskdiag class=half>Hard Disk</button> }
}
puts {
<button id=channelinfo style="width: 48%">Channel Information</button>
<button id=channelinfo class=half>Channel Information</button>
</td>
</tr>
<tr>
<td colspan=2 align=center>
<button id=dspace class=half>Disk Space</button>
}
if {[system model] eq "HDR"} {
puts {
<tr>
<td colspan=2 align=center>
<button id=dlna style="width: 48%">DLNA Server</button>
</td>
</tr>
}
puts { <button id=dlna class=half>DLNA Server</button> }
}
puts {
</td>
</tr>
<tr><td colspan=2 style="height: 10px"></td></tr>

View File

@@ -2,12 +2,12 @@
package require cgi
source /mod/webif/lib/setup
require system.class
require system.class settings.class
header
set space [system diskspace]
set device [string range [lindex $space 5] 0 end-1]
set device [system disk]
set settings [settings]
set smart Unknown
set line ""
@@ -16,9 +16,11 @@ catch { set line [exec /mod/bin/smartctl -H $device | sed -n 5p] } msg
if {$msg ne "" && $line eq ""} { set line $msg }
if {$line ne ""} {
set smart [string range [lindex [split $line :] 1] 1 end]
$settings _tval_setting "SMART_status" $smart
}
puts "
<script type=text/javascript src=/js/enadis.js></script>
<h3 class=va>
<img class=va width=100 src=/img/disc.png>
SMART data read from device $device
@@ -99,9 +101,22 @@ foreach line [split [exec /mod/bin/smartctl -A $device] "\n"] {
id name flags val worst thresh type updated when rval
set class normal
switch $id {
5 { if {$rval > 0} { set class orangeshade } }
197 { if {$rval > 0} { set class redshade } }
198 { if {$rval > 0} { set class redshade } }
5 {
$settings _nval_setting "SMART_realloc" $rval
if {$rval > 0} { set class orangeshade }
}
10 {
$settings _nval_setting "SMART_spinretry" $rval
if {$rval > 0} { set class orangeshade }
}
197 {
$settings _nval_setting "SMART_pending" $rval
if {$rval > 0} { set class redshade }
}
198 {
$settings _nval_setting "SMART_offline" $rval
if {$rval > 0} { set class redshade }
}
}
puts "<tr class=$class>"
puts "
@@ -144,6 +159,7 @@ 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
if {[string length $id] > 10} continue
puts "<tr>
<td>$id</td>
<td>$name</td>
@@ -157,6 +173,28 @@ foreach line [split $msg "\n"] {
puts {
</table>
</fieldset>
<div class=cleft style="padding-top: 2em">
<button id=diskack>Acknowledge any current disk faults.</button>
</div>
<script type=text/javascript>
$(function() {
$('#diskack')
.button()
.on('click', function(e) {
e.preventDefault();
$('button').disable();
$.get('diskack.jim', function() {
window.location.reload(true);
});
});
});
</script>
}
footer

View File

@@ -0,0 +1,16 @@
#!/mod/bin/jimsh
source /mod/webif/lib/setup
require settings.class
httpheader
set settings [settings]
foreach attr {realloc pending offline} {
set val [$settings _nval_setting "SMART_$attr"]
if {$val <= 0} continue
$settings _nval_setting "SMART_ack_$attr" $val
}

View File

@@ -0,0 +1,96 @@
#!/mod/bin/jimsh
package require cgi
source /mod/webif/lib/setup
require system.class pretty_size
header
jqplugin easy-pie-chart
puts {
<link href=style.css rel=stylesheet type=text/css />
<script type=text/javascript src=script.js></script>
}
set dustbin [system dustbin 1]
set root [system mediaroot]
set lroot [string length $root]
proc hasnew {dir} {
if {![file exists "$dir/.series"]} { return 0 }
if {[catch {set fd [open "$dir/.series"]}]} { return 0 }
set bytes [read $fd 8]
$fd close
set recs [unpack $bytes -uintle 0 32]
set plays [unpack $bytes -uintle 32 32]
set diff $($recs - $plays)
if {$diff != 0} { return 1 }
return 0
}
set rsize 0
proc gen {dir ddir {depth 0} {expand 0}} {
global root lroot rsize
if {[catch {set dsize [exec /mod/bin/busybox/du -s "$dir/"]} msg]} {
puts "Error, $dir, $msg"
return
}
lassign $dsize dsize
if {!$rsize} { set rsize $dsize }
set dlist {}
foreach entry [lsort [readdir -nocomplain $dir]] {
if {[string index $entry 0] eq "."} continue
if {![file isdirectory "$dir/$entry"]} continue
lappend dlist $entry
}
set img "/images/711_1_09_Media_Folder.png"
if {[hasnew $dir]} { set img "/img/Folder_New.png" }
if {[string first "/$::dustbin" $dir] > -1} {
set img "/img/Dustbin_Folder.png"
}
if {$expand > 0} { set class "open" } else { set class "closed" }
if {$expand > 1} { set timg "minus" } else { set timg "plus" }
if {![llength $dlist]} { set timg "join" }
set perc $($dsize * 100 / $rsize)
puts -nonewline "
<div class=\"va $class\" style=\"padding-left: ${depth}em\">
<img border=0 class=\"va tlink\" src=/img/tree/$timg.png>
<span class=\"va fileperc\" data-percent=$perc>
<img border=0 class=va src=\"$img\"></span>
<span class=filesize>
([pretty_size $($dsize * 1024)] - $perc%)
</span>
<span class=path>
<a target=dspace_drill
href=\"/browse/index.jim?dir=[cgi_quote_url $dir]\">$ddir</a>
</span>
"
incr depth 2
incr expand -1
foreach subd $dlist { gen "$dir/$subd" $subd $depth $expand }
puts {</div>}
}
puts {
<fieldset style="display: inline">
<legend> Disk Utilisation </legend>
}
gen $root "/" 0 2
puts {
</fieldset>
}
footer

View File

@@ -0,0 +1,40 @@
$(function() {
$('img.tlink').hover(
function() { $(this).css('cursor', 'pointer'); },
function() { $(this).css('cursor', 'auto'); }
).on('click', function(e) {
e.preventDefault();
if ($(this).attr('src') == '/img/tree/plus.png')
{
$(this).attr('src', '/img/tree/minus.png');
$(this).parent().children('div')
.slideDown('slow')
.addClass('open')
.removeClass('closed');
}
else
{
$(this).attr('src', '/img/tree/plus.png');
$(this).parent().children('div')
.slideUp('slow')
.addClass('closed')
.removeClass('open');
}
});
$('span.fileperc').easyPieChart({
size: 20,
barColor: '#00ff00',
trackColor: '#A3A3C2',
lineWidth: 4,
scaleColor: false,
lineCap: 'butt'
});
});

View File

@@ -0,0 +1 @@
div.closed { display: none; }

View File

@@ -78,6 +78,11 @@ $('#dlna').click(function(e) {
window.location = '/dlna/dlna.jim';
});
$('#dspace').click(function(e) {
e.preventDefault();
window.location = 'dspace/index.jim';
});
$('#reboot').click(function(e) {
e.preventDefault();
if (confirm('Are you sure you wish to perform a reboot now?'))

View File

@@ -23,7 +23,8 @@ puts {
Use the <i>Open</i> button below to begin.
</div>
<textarea cols=80 rows=20 id=editor></textarea>
<textarea cols=120 rows=20 id=editor
class="ui-widget ui-corner-all"></textarea>
<br>
<button class=xeditactive id=open>Open</button>

View File

@@ -2,6 +2,7 @@ textarea
{
background: white;
color: black;
font-family: Consolas, "Courier New", "Lucida Console", Monaco, "Courier", monospace !important;
}
#filename

View File

@@ -0,0 +1 @@
img/fav/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 813 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 754 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: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,6 @@
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 64x64" type=image/vnd.microsoft.icon />
<link rel="apple-touch-icon" href="/img/fav/57.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/img/fav/57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/img/fav/72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/img/fav/114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/img/fav/144.png" />

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@@ -0,0 +1 @@
context/mp3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 749 B

View File

@@ -0,0 +1,32 @@
<img src=blank.png>blank.png<br>
<img src=folder.png>folder.png<br>
<img src=folderopen.png>folderopen.png<br>
<img src=index.html>index.html<br>
<img src=join.png>join.png<br>
<img src=joinbottom-down.png>joinbottom-down.png<br>
<img src=joinbottom.png>joinbottom.png<br>
<img src=leaf.png>leaf.png<br>
<img src=line.png>line.png<br>
<img src=minus.png>minus.png<br>
<img src=minusbottom.png>minusbottom.png<br>
<img src=minusonly.png>minusonly.png<br>
<img src=minustop.png>minustop.png<br>
<img src=nullonly.png>nullonly.png<br>
<img src=plus.png>plus.png<br>
<img src=plusbottom.png>plusbottom.png<br>
<img src=plusonly.png>plusonly.png<br>
<img src=plustop.png>plustop.png<br>
<img src=rev-join.png>rev-join.png<br>
<img src=rev-joinbottom-down.png>rev-joinbottom-down.png<br>
<img src=rev-joinbottom.png>rev-joinbottom.png<br>
<img src=rev-leaf.png>rev-leaf.png<br>
<img src=rev-line.png>rev-line.png<br>
<img src=rev-minus.png>rev-minus.png<br>
<img src=rev-minusbottom.png>rev-minusbottom.png<br>
<img src=rev-minusonly.png>rev-minusonly.png<br>
<img src=rev-minustop.png>rev-minustop.png<br>
<img src=rev-nullonly.png>rev-nullonly.png<br>
<img src=rev-plus.png>rev-plus.png<br>
<img src=rev-plusbottom.png>rev-plusbottom.png<br>
<img src=rev-plusonly.png>rev-plusonly.png<br>
<img src=rev-plustop.png>rev-plustop.png<br>

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 216 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 228 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

View File

@@ -19,7 +19,6 @@ $(document).ready(function() {
</script>
<!--#exec cmd="/mod/webif/include/menuicons.jim" -->
<!--#exec cmd="/mod/webif/include/menuplugins.jim" -->
</div>
<div class=footer>

File diff suppressed because it is too large Load Diff

View File

@@ -14,8 +14,8 @@
//
// For details, visit http://creativecommons.org/licenses/by/3.0/us/
// Modified by Andy Fiddaman to support left click and
// support modification of menu items.
// Modified by af123 to support left click, modification of menu items and
// utilise jQuery.ui.position for smart element positioning.
if (jQuery) (function() {
$.extend($.fn, {
@@ -53,31 +53,17 @@ if (jQuery) (function() {
if (o.beforeShow) o.beforeShow(el, menu);
// Detect mouse position
var d = {}, x, y;
if (self.innerHeight) {
d.pageYOffset = self.pageYOffset;
d.pageXOffset = self.pageXOffset;
d.innerHeight = self.innerHeight;
d.innerWidth = self.innerWidth;
} else if (document.documentElement &&
document.documentElement.clientHeight) {
d.pageYOffset = document.documentElement.scrollTop;
d.pageXOffset = document.documentElement.scrollLeft;
d.innerHeight = document.documentElement.clientHeight;
d.innerWidth = document.documentElement.clientWidth;
} else if (document.body) {
d.pageYOffset = document.body.scrollTop;
d.pageXOffset = document.body.scrollLeft;
d.innerHeight = document.body.clientHeight;
d.innerWidth = document.body.clientWidth;
}
(e.pageX) ? x = e.pageX : x = e.clientX + d.scrollLeft;
(e.pageY) ? y = e.pageY : x = e.clientY + d.scrollTop;
// Show the menu
$(document).unbind('click');
$(menu).css({ top: y, left: x }).fadeIn(o.inSpeed);
// $(menu).css({ top: y, left: x }).fadeIn(o.inSpeed);
$(menu).css('display', 'block').position({
my: "left top",
at: "right bottom",
of: this,
offset: "0 5",
collision: "fit"
}).css('display', 'none').fadeIn(o.inSpeed);
// Hover events
$(menu).find('A').mouseover(function() {
$(menu).find('LI.hover').removeClass('hover');
@@ -120,7 +106,8 @@ if (jQuery) (function() {
$(document).unbind('click').unbind('keypress');
$(".contextMenu").hide();
// Callback
if (callback) callback($(this).attr('href').substr(1), $(srcElement), { x: x - offset.left, y: y - offset.top, docX: x, docY: y });
//if (callback) callback($(this).attr('href').substr(1), $(srcElement), { x: x - offset.left, y: y - offset.top, docX: x, docY: y });
if (callback) callback($(this).attr('href').substr(1), $(srcElement));
return false;
});

View File

@@ -11,7 +11,13 @@ source /mod/webif/include/model.jim
puts {
</title>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
<link rel="shortcut icon" href=/img/favicon.ico />
<link rel="icon" href="/favicon.ico" sizes="16x16 32x32 64x64"
type="image/vnd.microsoft.icon" />
<link rel="apple-touch-icon" href="/img/fav/57.png" />
<link rel="apple-touch-icon" sizes="57x57" href="/img/fav/57.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/img/fav/72.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/img/fav/114.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/img/fav/144.png" />
<link type="text/css" href="/lib/jquery.ui/css/custom-theme/jquery-ui.css"
rel="Stylesheet" />
<link href="/css/style.css" rel="Stylesheet" type="text/css" />
@@ -25,6 +31,8 @@ source /mod/webif/html/lib/topbar.jim
puts "<div id=restart_block>"
source /mod/webif/include/restart.jim
puts "</div>"
source /mod/webif/include/diskcheck.jim
source /mod/webif/include/notify.jim
puts {
<div style="clear: both">

View File

@@ -0,0 +1,21 @@
.context-menu-item.icon-pwedit { background-image: url(/img/context/page_white_edit.png); }
.context-menu-item.icon-pwcopy { background-image: url(/img/context/page_white_copy.png); }
.context-menu-item.icon-pwpaste { background-image: url(/img/context/page_white_paste.png); }
.context-menu-item.icon-pwdelete { background-image: url(/img/context/page_white_delete.png); }
.context-menu-item.icon-edit { background-image: url(/img/context/edit.png); }
.context-menu-item.icon-copy { background-image: url(/img/context/copy.png); }
.context-menu-item.icon-paste { background-image: url(/img/context/paste.png); }
.context-menu-item.icon-delete { background-image: url(/img/context/delete.png); }
.context-menu-item.icon-cut { background-image: url(/img/context/cut.png); }
.context-menu-item.icon-quit { background-image: url(/img/context/door.png); }
.context-menu-item.icon-compress { background-image: url(/img/context/compress.png); }
.context-menu-item.icon-compressr { background-image: url(/img/context/compressr.png); }
.context-menu-item.icon-dedup { background-image: url(/img/context/dedup.png); }
.context-menu-item.icon-decrypt { background-image: url(/img/context/decrypt.png); }
.context-menu-item.icon-decryptr { background-image: url(/img/context/decryptr.png); }
.context-menu-item.icon-mpg { background-image: url(/img/context/mpg.png); }
.context-menu-item.icon-mp3 { background-image: url(/img/context/mp3.png); }
.context-menu-item.icon-clock { background-image: url(/img/context/clock.png); }
.context-menu-item.icon-thm { background-image: url(/img/context/thumb.png); }

Binary file not shown.

After

Width:  |  Height:  |  Size: 648 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 412 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 309 B

Some files were not shown because too many files have changed in this diff Show More