only show transmission/mediatomb icons if running, fix pkgdev toggle
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@681 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
8ec03f2636
commit
572e31efcc
@ -1,7 +1,7 @@
|
|||||||
Package: webif
|
Package: webif
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Section: web
|
Section: web
|
||||||
Version: 0.8.13
|
Version: 0.8.13-1
|
||||||
Architecture: mipsel
|
Architecture: mipsel
|
||||||
Maintainer: af123@hummypkg.org.uk
|
Maintainer: af123@hummypkg.org.uk
|
||||||
Depends: mongoose(>=3.0-7),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.5),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2
|
Depends: mongoose(>=3.0-7),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.5),jim-oo,jim-pack,service-control,busybox(>=1.19.3-1),lsof,epg(>=1.0.8),hmt(>=1.1.4),ssmtp,anacron,trm,openssl-command,nicesplice,id3v2
|
||||||
|
@ -64,9 +64,6 @@ handle_str_update hostname $hostname Hostname
|
|||||||
_handle_update ascii smtp_server $smtp_server "SMTP Server"
|
_handle_update ascii smtp_server $smtp_server "SMTP Server"
|
||||||
handle_int_update channel_group $channel_group "Channel Group"
|
handle_int_update channel_group $channel_group "Channel Group"
|
||||||
handle_str_update epg_style $epg_style "EPG Type"
|
handle_str_update epg_style $epg_style "EPG Type"
|
||||||
if {[dict exists $_cgi pkgdevoff] && ![dict exists $_cgi pkgdev]} {
|
|
||||||
set _cgi(pkgdev) 0
|
|
||||||
}
|
|
||||||
handle_int_update pkgdev $pkgdev "Development Package Display"
|
handle_int_update pkgdev $pkgdev "Development Package Display"
|
||||||
|
|
||||||
set acluser [cgi_get acluser "-"]
|
set acluser [cgi_get acluser "-"]
|
||||||
@ -318,34 +315,21 @@ $('button.pwchange').click(function(el) {
|
|||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
|
||||||
puts "
|
puts -nonewline "
|
||||||
<br><br>
|
<br><br>
|
||||||
<fieldset style=\"display: inline\">
|
<fieldset style=\"display: inline\">
|
||||||
<legend> Advanced Settings </legend>
|
<legend> Advanced Settings </legend>
|
||||||
<table>
|
<table>
|
||||||
"
|
|
||||||
|
|
||||||
puts "
|
|
||||||
<tr>
|
<tr>
|
||||||
<form class=auto id=pkgdev method=get action=$env(REQUEST_URI)>
|
|
||||||
<th class=key>Show development and advanced packages?</th>
|
<th class=key>Show development and advanced packages?</th>
|
||||||
<td><input name=pkgdevoff value=0 type=hidden>
|
<td><input name=pkgdev id=pkgdev value=1 type=checkbox
|
||||||
<input name=pkgdev id=pkgdev value=1 type=checkbox
|
|
||||||
"
|
"
|
||||||
if {$pkgdev} { puts " checked" }
|
if {$pkgdev} { puts -nonewline " checked" }
|
||||||
puts {
|
puts ">
|
||||||
>
|
|
||||||
<small>
|
|
||||||
<input id=pkgdev_submit value="save" type=submit>
|
|
||||||
</small>
|
|
||||||
<div id=pkgdev_output></div>
|
|
||||||
</td>
|
</td>
|
||||||
</form>
|
|
||||||
</tr>
|
</tr>
|
||||||
}
|
|
||||||
|
|
||||||
puts "
|
|
||||||
</table>
|
</table>
|
||||||
|
<div id=pkgdev_output></div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
"
|
"
|
||||||
|
|
||||||
|
@ -35,6 +35,25 @@ $(document).ready(function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#pkgdev').change(function() {
|
||||||
|
var arg = '0';
|
||||||
|
if ($(this).attr('checked'))
|
||||||
|
arg = '1';
|
||||||
|
|
||||||
|
$(this).disable();
|
||||||
|
|
||||||
|
$('#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');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
$('#https_toggle').change(function() {
|
$('#https_toggle').change(function() {
|
||||||
var arg = 'off';
|
var arg = 'off';
|
||||||
if ($(this).attr('checked'))
|
if ($(this).attr('checked'))
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
#!/mod/bin/jimsh
|
#!/mod/bin/jimsh
|
||||||
|
|
||||||
|
source /mod/var/mongoose/lib/setup
|
||||||
|
require system.class
|
||||||
|
|
||||||
if { [catch {set fd [open "/mod/mediatomb/config/mediatomb.html" r]} fid] } {
|
if { [catch {set fd [open "/mod/mediatomb/config/mediatomb.html" r]} fid] } {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
@ -8,6 +11,10 @@ close $fd
|
|||||||
regexp {URL=([^"]*)} $data match
|
regexp {URL=([^"]*)} $data match
|
||||||
set url [string range $match 4 [string length $match]]
|
set url [string range $match 4 [string length $match]]
|
||||||
|
|
||||||
|
set port [string range [lindex [split $url ":"] 2] 0 end-1]
|
||||||
|
|
||||||
|
if {![system is_listening $port]} { exit 0 }
|
||||||
|
|
||||||
puts "
|
puts "
|
||||||
<div style=\"float: left; padding-top: 5em\">
|
<div style=\"float: left; padding-top: 5em\">
|
||||||
<center>
|
<center>
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
#!/mod/bin/jimsh
|
#!/mod/bin/jimsh
|
||||||
|
|
||||||
|
source /mod/var/mongoose/lib/setup
|
||||||
|
require system.class
|
||||||
|
|
||||||
if {![file exists /mod/sbin/transmission-daemon]} { exit 0 }
|
if {![file exists /mod/sbin/transmission-daemon]} { exit 0 }
|
||||||
|
if {![system is_listening 9091]} { exit 0 }
|
||||||
|
|
||||||
set url "/cgi-bin/transmission.jim"
|
set url "/cgi-bin/transmission.jim"
|
||||||
|
|
||||||
|
@ -130,3 +130,23 @@ proc {system mkdir_p} {dir} {
|
|||||||
exec /mod/bin/busybox/mkdir -p $dir
|
exec /mod/bin/busybox/mkdir -p $dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proc {system listening} {{mport 0}} {
|
||||||
|
set ret {}
|
||||||
|
foreach line [split [exec /mod/bin/busybox/netstat -lntpw] "\n"] {
|
||||||
|
# Remove repeated spaces
|
||||||
|
regsub -all -- {[[:space:]]+} $line " " line
|
||||||
|
# tcp 0 0 0.0.0.0:9955 0.0.0.0:* LISTEN 169/humaxtv
|
||||||
|
lassign [split $line " "] x x x port x type app
|
||||||
|
if {$type ne "LISTEN"} { continue }
|
||||||
|
lassign [split $port ":"] x port
|
||||||
|
|
||||||
|
if {$mport && $mport != $port} { continue }
|
||||||
|
lappend ret [list $port [split $app "/"]]
|
||||||
|
}
|
||||||
|
return $ret
|
||||||
|
}
|
||||||
|
|
||||||
|
proc {system is_listening} {mport} {
|
||||||
|
return [llength [system listening $mport]]
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user