forked from hummypkg/webif
rma mode and stream size monitor
git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1202 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
parent
328ca16b5c
commit
c208e186c3
@ -359,6 +359,7 @@ if {[file exists /mnt/hd3/Streamer_down_file]} {
|
||||
puts {
|
||||
<button id=save_stream file=/mnt/hd3/Streamer_down_file>
|
||||
Save last streamed content (e.g. iPlayer/YouTube)
|
||||
<div id=streamstatus></div>
|
||||
</button>
|
||||
}
|
||||
}
|
||||
|
@ -822,5 +822,24 @@ var dmenuclick = function(action, el, pos)
|
||||
|
||||
});
|
||||
|
||||
var streamsize = 0;
|
||||
|
||||
function checkstream()
|
||||
{
|
||||
$.get('/cgi-bin/streamsize.jim', function(size) {
|
||||
console.log('Stream size: %o', size);
|
||||
var mb = size / (1024 * 1024);
|
||||
mb = mb|0;
|
||||
if (streamsize && size > streamsize)
|
||||
$('#streamstatus').text(mb + ' MiB (growing)');
|
||||
else
|
||||
$('#streamstatus').text(mb + ' MiB');
|
||||
streamsize = size;
|
||||
});
|
||||
}
|
||||
|
||||
if ($('#streamstatus').length)
|
||||
setInterval(checkstream, 3000);
|
||||
|
||||
});
|
||||
|
||||
|
@ -1,7 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ -n "$QUERY_STRING" ] && rma="${QUERY_STRING##*=}" || rma=0
|
||||
|
||||
echo "Content-Type: text/plain"
|
||||
echo
|
||||
|
||||
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
|
||||
if [ "$rma" = 1 ]; then
|
||||
touch /var/lib/humaxtv/.rma
|
||||
else
|
||||
touch /var/lib/humaxtv/mod/_RESET_CUSTOM_FIRMWARE_ENVIRONMENT
|
||||
fi
|
||||
|
||||
|
12
var/mongoose/cgi-bin/streamsize.jim
Executable file
12
var/mongoose/cgi-bin/streamsize.jim
Executable file
@ -0,0 +1,12 @@
|
||||
#!/mod/bin/jimsh
|
||||
|
||||
set stream "/mnt/hd3/Streamer_down_file"
|
||||
|
||||
puts "Content-type: text/plain\n"
|
||||
|
||||
if {[file exists $stream]} {
|
||||
puts -nonewline [file size $stream]
|
||||
} else {
|
||||
puts -nonewline 0
|
||||
}
|
||||
|
@ -2,11 +2,13 @@
|
||||
|
||||
package require cgi
|
||||
source /mod/webif/lib/setup
|
||||
require pretty_size
|
||||
require pretty_size system.class
|
||||
|
||||
puts "Content-Type: text/html"
|
||||
puts ""
|
||||
|
||||
set smv [system modversion 1]
|
||||
|
||||
header
|
||||
|
||||
puts {
|
||||
@ -78,7 +80,7 @@ puts {
|
||||
<button id=runreset style="width: 100%"
|
||||
}
|
||||
|
||||
if {[system modversion 1] < 200} {
|
||||
if {$smv < 200} {
|
||||
puts -nonewline " disabled class=ui-state-disabled"
|
||||
}
|
||||
|
||||
@ -88,7 +90,7 @@ Remove all custom firmware packages and settings
|
||||
</button>
|
||||
}
|
||||
|
||||
if {[system modversion 1] < 200} {
|
||||
if {$smv < 200} {
|
||||
puts {
|
||||
<div class=footnote style="text-align: center">
|
||||
(Install custom firmware v2.00 to enable this option)
|
||||
@ -106,6 +108,34 @@ Allow it to turn off completely before restarting.<br>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td colspan=2>
|
||||
<button id=runrma style="width: 100%"
|
||||
}
|
||||
|
||||
if {$smv < 213} {
|
||||
puts -nonewline " disabled class=ui-state-disabled"
|
||||
}
|
||||
|
||||
puts {
|
||||
>
|
||||
Set Return-to-manufacturer (RMA) Mode
|
||||
</button>
|
||||
}
|
||||
|
||||
if {$smv < 213} {
|
||||
puts {
|
||||
<div class=footnote style="text-align: center">
|
||||
(Install custom firmware v2.13 to enable this option)
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
puts {
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<span class=also style="padding-left: 5px">
|
||||
View:
|
||||
|
@ -83,6 +83,20 @@ $('#runreset').click(function(e) {
|
||||
});
|
||||
});
|
||||
|
||||
$('#runrma').click(function(e) {
|
||||
e.preventDefault();
|
||||
if (!confirm('Are you sure? This will completely remove all packages and settings and return the unit to state where you can re-install official firmware ready to return a faulty box to Humax for repair.'))
|
||||
return;
|
||||
if (!confirm('Are you really sure?'))
|
||||
return;
|
||||
if (!confirm('One last time, are you sure?'))
|
||||
return;
|
||||
$.get('/cgi-bin/cfwreset.cgi?rma=1', function() {
|
||||
$('button').disable();
|
||||
$('#resetdone').slideDown();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user