diff --git a/var/mongoose/cgi-bin/browse.jim b/var/mongoose/cgi-bin/browse.jim index aa2650d..456c450 100755 --- a/var/mongoose/cgi-bin/browse.jim +++ b/var/mongoose/cgi-bin/browse.jim @@ -359,6 +359,7 @@ if {[file exists /mnt/hd3/Streamer_down_file]} { puts { } } diff --git a/var/mongoose/cgi-bin/browse/browse.js b/var/mongoose/cgi-bin/browse/browse.js index 9c2d53e..0882dda 100755 --- a/var/mongoose/cgi-bin/browse/browse.js +++ b/var/mongoose/cgi-bin/browse/browse.js @@ -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); + }); diff --git a/var/mongoose/cgi-bin/cfwreset.cgi b/var/mongoose/cgi-bin/cfwreset.cgi index 9ebfce4..236693d 100755 --- a/var/mongoose/cgi-bin/cfwreset.cgi +++ b/var/mongoose/cgi-bin/cfwreset.cgi @@ -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 diff --git a/var/mongoose/cgi-bin/streamsize.jim b/var/mongoose/cgi-bin/streamsize.jim new file mode 100755 index 0000000..7133627 --- /dev/null +++ b/var/mongoose/cgi-bin/streamsize.jim @@ -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 +} + diff --git a/var/mongoose/html/diag/diag.jim b/var/mongoose/html/diag/diag.jim index 2364337..5363bde 100755 --- a/var/mongoose/html/diag/diag.jim +++ b/var/mongoose/html/diag/diag.jim @@ -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 { +} + +if {$smv < 213} { + puts { +
+(Install custom firmware v2.13 to enable this option) +
+ } +} + +puts { + + + + View: diff --git a/var/mongoose/html/diag/script.js b/var/mongoose/html/diag/script.js index f4b2b3b..349ed0a 100644 --- a/var/mongoose/html/diag/script.js +++ b/var/mongoose/html/diag/script.js @@ -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(); + }); +}); + });