fix diagnostic output

git-svn-id: file:///root/webif/svn/pkg/webif/trunk@2612 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2016-02-10 19:37:25 +00:00
parent b092b571e2
commit f4afecf77c
4 changed files with 126 additions and 103 deletions

View File

@ -1,7 +1,7 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.2.7-4 Version: 1.2.8
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.39-1),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7) Depends: webif-channelicons(>=1.1.18),lighttpd(>=1.4.39-1),jim(>=0.76),jim-oo,jim-sqlite3(>=0.76),jim-cgi(>=0.7),jim-binary(>=0.76),service-control(>=2.1),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.2.1),hmt(>=2.0.9),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),tcpping(>=1.1),e2fsprogs,wireless-tools(>=29-1),dbupdate,recmon(>=2.0.7)

89
webif/html/diag/assets.jim Executable file
View File

@ -0,0 +1,89 @@
#!/mod/bin/jimsh
puts {
<div id=d_results class=hidden title="Results">
<div id=results></div>
</div>
<div id=safeconfirm class=hidden xtitle="Safe Mode">
<div class=va>
<img class=va src=/img/safe.png height=50>
<span class="va blood">
<i>Safe mode on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
Safe Mode allows you to start up your Humax without
any of the custom firmware packages in order to run
diagnostics or troubleshoot the system.
<br><br>
If enabled, Safe Mode will be entered the
next time that the system starts up and this will be
indicated by the word <i>SAFE</i> appearing on the front
panel after the Custom Firmware version message.
<br><br>
Safe Mode can be disabled again via a simple web
interface which is available in safe mode or via the
telnet menu.
</div>
</div>
<div id=resetconfirm class=hidden xtitle="CFW Reset">
<div class=va>
<img class=va src=/img/reset.png height=50>
<span class="va blood">
<i>CFW Reset on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
When the CFW Reset option is enabled, all custom firmware
packages and settings will be removed on the next system
startup and a blank custom firmware environment will be
initialised.
<br><br>
The initial bootstrap web interface will be running to allow
the installation of the full web interface and supporting
packages.
</div>
</div>
<div id=rmaconfirm class=hidden xtitle="Return to Manufacturer">
<div class=va>
<img class=va src=/img/shredder.png height=50>
<span class="va blood">
<i>RMA Clear on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
When the RMA Clear option is enabled, all custom firmware
packages and settings will be removed on the next system
startup and the custom firmware environment will <b>not</b> be
re-initialised.
<br><br>
Once in this state, the installation of an official Humax
firmware file followed by the System Flush update image
will return this unit to a factory state with no
traces of the Custom Firmware remaining.
</div>
</div>
<div id=maintconfirm class=hidden xtitle="Maintenance Mode">
<div class=va>
<img class=va src=/img/maint.png height=50>
<span class="va blood">
<i>Maintenance Mode on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
Maintenance Mode allows you to start up your Humax
into a mode where the neither the standard Humax software
nor the custom firmware packages are running.
<br><br>
This mode is primarily intended to be used for checking
and repairing the hard disk or for modifying files which
are locked in normal operation.
</div>
</div>
}

View File

@ -142,90 +142,7 @@ puts {
</div> </div>
} }
###################################################################### source /mod/webif/html/diag/assets.jim
# Confirmation dialogues
puts {
<div id=safeconfirm class=hidden xtitle="Safe Mode">
<div class=va>
<img class=va src=/img/safe.png height=50>
<span class="va blood">
<i>Safe mode on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
Safe Mode allows you to start up your Humax without
any of the custom firmware packages in order to run
diagnostics or troubleshoot the system.
<br><br>
If enabled, Safe Mode will be entered the
next time that the system starts up and this will be
indicated by the word <i>SAFE</i> appearing on the front
panel after the Custom Firmware version message.
<br><br>
Safe Mode can be disabled again via a simple web
interface which is available in safe mode or via the
telnet menu.
</div>
</div>
<div id=resetconfirm class=hidden xtitle="CFW Reset">
<div class=va>
<img class=va src=/img/reset.png height=50>
<span class="va blood">
<i>CFW Reset on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
When the CFW Reset option is enabled, all custom firmware
packages and settings will be removed on the next system
startup and a blank custom firmware environment will be
initialised.
<br><br>
The initial bootstrap web interface will be running to allow
the installation of the full web interface and supporting
packages.
</div>
</div>
<div id=rmaconfirm class=hidden xtitle="Return to Manufacturer">
<div class=va>
<img class=va src=/img/shredder.png height=50>
<span class="va blood">
<i>RMA Clear on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
When the RMA Clear option is enabled, all custom firmware
packages and settings will be removed on the next system
startup and the custom firmware environment will <b>not</b> be
re-initialised.
<br><br>
Once in this state, the installation of an official Humax
firmware file followed by the System Flush update image
will return this unit to a factory state with no
traces of the Custom Firmware remaining.
</div>
</div>
<div id=maintconfirm class=hidden xtitle="Maintenance Mode">
<div class=va>
<img class=va src=/img/maint.png height=50>
<span class="va blood">
<i>Maintenance Mode on next boot is currently
<b><span class=cur></span></b></i>
</span>
</div><div>
Maintenance Mode allows you to start up your Humax
into a mode where the neither the standard Humax software
nor the custom firmware packages are running.
<br><br>
This mode is primarily intended to be used for checking
and repairing the hard disk or for modifying files which
are locked in normal operation.
</div>
</div>
}
footer footer

View File

@ -6,43 +6,60 @@ $('button').button();
$('#rundiag').button({icons: {primary: "ui-icon-play"}}); $('#rundiag').button({icons: {primary: "ui-icon-play"}});
$('#runfopkg').button({icons: {primary: "ui-icon-play"}}); $('#runfopkg').button({icons: {primary: "ui-icon-play"}});
var $dialog = $('#d_results').dialog({
title: "Results",
modal: true, autoOpen: false,
height: 600, width: 900,
show: 'scale', hide: 'fade',
draggable: true, resizable: true,
buttons: { "Close":
function() {$(this).dialog('close');}},
});
$('#rundiag').on('click', function() { $('#rundiag').on('click', function() {
var val = $('#diagsel').val(); var val = $('#diagsel').val();
if (val == '0') if (val == '0')
val = $('#seq').val(); val = $('#seq').val();
$('#results') $('#results')
.slideDown() .html('<img src=/img/loading.gif> Running diagnostic ' +
.html('<span class=blood><img src=/img/loading.gif> ' + '<i>' + val + '</i>')
'Running diagnostic, please wait...</span>') .load('rundiag.jim', { diag: val }, function() {
.load('rundiag.jim?diag=' + encodeURIComponent(val), function() {
$('#results').wrapInner('<pre>'); $('#results').wrapInner('<pre>');
}); });
$('#d_results').dialog('open');
}); });
$('#runfopkg').on('click', function() { $('#runfopkg').on('click', function() {
var pkg = $('#fopkg').val();
$('#results') $('#results')
.slideDown() .html('<img src=/img/loading.gif> ' +
.text('\n\nForcibly re-installing package, please wait...\n\n') 'Forcibly re-installing package <i>' + pkg + '</i>')
.load('/cgi-bin/opkg.jim?cmd=install+--force-reinstall+' + .load('/cgi-bin/opkg.jim', {
encodeURIComponent($('#fopkg').val()), function() { cmd: 'install --force-reinstall ' + pkg
}, function() {
$('#results').wrapInner('<pre>'); $('#results').wrapInner('<pre>');
$('#fopkg').val('');
}); });
$('#d_results').dialog('open');
}); });
$('a.logclear').on('click', function(e) { $('a.logclear').on('click', function(e) {
var t = $(this);
e.preventDefault(); e.preventDefault();
if (!confirm('Delete ' + $(this).attr('file') + '?'))
var $t = $(this);
var file = $t.attr('file');
if (!confirm('Delete ' + file + '?'))
return; return;
$('#results') $('#results')
.slideDown() .html('<img src=/img/loading.gif> Clearing log ' +
.text('\n\nClearing log, please wait...\n\n') '<i>' + file + '</i>')
.load('/log/act.jim?action=clear&file=' + .load('/log/act.jim', {
encodeURIComponent($(this).attr('file')), function() { action: 'clear',
$('#results').wrapInner('<pre>'); file: file
$(t).prev('span.lsize').html('0 bytes'); }, function() {
}); $('#results').wrapInner('<pre>');
});
$('#d_results').dialog('open');
}); });
$.getJSON('/diag/rpc.jim?act=getall', function(data) { $.getJSON('/diag/rpc.jim?act=getall', function(data) {