fix diskspace bug, add sortable schedule list, fix plugin bug

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@276 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-07-17 20:52:33 +00:00
parent b2f5f2c48a
commit 1b8761b8f3
9 changed files with 90 additions and 23 deletions

View File

@ -0,0 +1,21 @@
table.tablesorter .header {
background-image: url(/img/tsort/bg.png);
background-repeat: no-repeat;
border-left: 1px solid #FFF;
border-right: 1px solid #000;
border-top: 1px solid #FFF;
padding-left: 30px;
padding-top: 8px;
height: auto;
}
table.tablesorter .headerSortUp {
background-image: url(/img/tsort/asc.png);
background-repeat: no-repeat;
}
table.tablesorter .headerSortDown {
background-image: url(/img/tsort/desc.png);
background-repeat: no-repeat;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,6 @@
<!--#include virtual="/lib/header.shtml" -->
<script type="text/javascript" src="/js/jquery.tablesorter.js"></script>
<link type=text/css href=/css/tsort.css rel=Stylesheet />
<!--#exec cmd="/mod/var/mongoose/include/sched.jim" -->
<!--#include virtual="/lib/footer.shtml" -->

View File

@ -1,23 +1,24 @@
#!/mod/bin/jimsh
if {[os.gethostname] eq "hosting"} {
set size "1TB"
set used "100GB"
set perc "10"
} else {
set used 0
set size 0
set perc 0
foreach df [split [exec df -h 2>>/dev/null] "\n\r"] {
if {[string match *sd?2* $df] || \
[string match *media/drive1* $df]} {
regsub -all -- {[[:space:]]+} $df " " df
set fields [split $df]
set size [lindex $fields 1]
set used [lindex $fields 2]
set perc [string trimright [lindex $fields 4] "%"]
break
}
proc extract {line} {
regsub -all -- {[[:space:]]+} $line " " line
set fields [split $line]
set ::size [lindex $fields 1]
set ::used [lindex $fields 2]
set ::perc [string trimright [lindex $fields 4] "%"]
}
set used 0
set size 0
set perc 0
foreach df [split [exec df -h 2>>/dev/null] "\n\r"] {
if {[string match *sd?2* $df]} {
extract $df
break;
}
if {[string match *media/drive* $df]} {
extract $df
}
}

View File

@ -6,10 +6,47 @@ require altrow rsv.class progressbar
set events [rsv list]
puts {
<table class=borders>
<script type=text/javascript>
$.tablesorter.addParser({
id: 'programme',
is: function () { return false; },
format: function(s) {
return s.toLowerCase().replace(/---/, 'zzz');
},
type: 'text'
});
$.tablesorter.addParser({
id: 'date',
is: function () { return false; },
format: function(s) {
var d = new Date(s.substring(0, s.length - 4));
return d.getTime();
},
type: 'numeric'
});
$(document).ready(function() {
$('#schedtable').tablesorter({
headers: {
1: { sorter: false },
3: { sorter: 'programme' },
4: { sorter: 'date' },
5: { sorter: 'date' },
5: { sorter: false },
6: { sorter: false },
7: { sorter: false }
}
});
});
</script>
<table id=schedtable class="borders tablesorter">
<thead>
<tr>
<th></th>
<th colspan=2>Channel</th>
<th>&nbsp;</th><th>Channel</th>
<th>Programme</th>
<th>Start Time</th>
<th>Duration</th>
@ -17,6 +54,8 @@ puts {
<th>Event/Series ID</th>
<th>Events</th>
</tr>
</thead>
<tbody>
}
foreach event $events {
@ -67,7 +106,7 @@ foreach event $events {
[$event channel_name]</td>
"
} else {
puts "<td colspan=2>&nbsp;<br><br></td>"
puts "<td>&nbsp;<br><br></td><td>&nbsp;</td>"
}
puts "<td nowrap>$name</td>"
@ -130,7 +169,7 @@ foreach event $events {
}
puts "</tr>"
}
puts "</table>"
puts "</tbody></table>"
puts "<font class=footnote>Click on the CRID to view episodes.</font>"
puts {

View File

@ -1,6 +1,6 @@
proc eval_plugins {hook} {
foreach plugin [glob /mod/var/mongoose/plugin/*] {
foreach plugin [glob -nocomplain /mod/var/mongoose/plugin/*] {
if {[file isfile "$plugin/$hook.hook"]} {
uplevel source "$plugin/$hook.hook"
}