diff --git a/CONTROL/control b/CONTROL/control index f8a972d..b4abab4 100644 --- a/CONTROL/control +++ b/CONTROL/control @@ -1,7 +1,7 @@ Package: webif Priority: optional Section: web -Version: 1.2.7-4 +Version: 1.2.8 Architecture: mipsel 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) diff --git a/webif/html/diag/assets.jim b/webif/html/diag/assets.jim new file mode 100755 index 0000000..91d3e4f --- /dev/null +++ b/webif/html/diag/assets.jim @@ -0,0 +1,89 @@ +#!/mod/bin/jimsh + +puts { + + + + + + + + + + +} + diff --git a/webif/html/diag/diag.jim b/webif/html/diag/diag.jim index c219fcf..d18ed93 100755 --- a/webif/html/diag/diag.jim +++ b/webif/html/diag/diag.jim @@ -142,90 +142,7 @@ puts { } -###################################################################### -# Confirmation dialogues - -puts { - - - - - - - -} +source /mod/webif/html/diag/assets.jim footer diff --git a/webif/html/diag/script.js b/webif/html/diag/script.js index 776bac0..1785243 100644 --- a/webif/html/diag/script.js +++ b/webif/html/diag/script.js @@ -6,43 +6,60 @@ $('button').button(); $('#rundiag').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() { var val = $('#diagsel').val(); if (val == '0') val = $('#seq').val(); $('#results') - .slideDown() - .html(' ' + - 'Running diagnostic, please wait...') - .load('rundiag.jim?diag=' + encodeURIComponent(val), function() { + .html(' Running diagnostic ' + + '' + val + '') + .load('rundiag.jim', { diag: val }, function() { $('#results').wrapInner('
');
 	    });
+	$('#d_results').dialog('open');
 });
 
 $('#runfopkg').on('click', function() {
+	var pkg = $('#fopkg').val();
 	$('#results')
-	    .slideDown()
-	    .text('\n\nForcibly re-installing package, please wait...\n\n')
-	    .load('/cgi-bin/opkg.jim?cmd=install+--force-reinstall+' +
-	    encodeURIComponent($('#fopkg').val()), function() {
+	    .html(' ' +
+		'Forcibly re-installing package ' + pkg + '')
+	    .load('/cgi-bin/opkg.jim', {
+		cmd: 'install --force-reinstall ' + pkg
+	    }, function() {
 		$('#results').wrapInner('
');
-		$('#fopkg').val('');
 	    });
+	$('#d_results').dialog('open');
 });
 
 $('a.logclear').on('click', function(e) {
-	var t = $(this);
 	e.preventDefault();
-	if (!confirm('Delete ' + $(this).attr('file') + '?'))
+
+	var $t = $(this);
+	var file = $t.attr('file');
+
+	if (!confirm('Delete ' + file + '?'))
 		return;
 	$('#results')
-	    .slideDown()
-	    .text('\n\nClearing log, please wait...\n\n')
-	    .load('/log/act.jim?action=clear&file=' +
-		encodeURIComponent($(this).attr('file')), function() {
-			$('#results').wrapInner('
');
-			$(t).prev('span.lsize').html('0 bytes');
-		});
+	    .html(' Clearing log ' +
+		'' + file + '')
+	    .load('/log/act.jim', {
+		action: 'clear',
+		file: file
+	    }, function() {
+		$('#results').wrapInner('
');
+	    });
+	$('#d_results').dialog('open');
 });
 
 $.getJSON('/diag/rpc.jim?act=getall', function(data) {