pkg management updates

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@1760 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-01-18 00:26:33 +00:00
parent 26981ebb2d
commit d08475daaa
4 changed files with 36 additions and 19 deletions

View File

@ -1,9 +1,9 @@
Package: webif Package: webif
Priority: optional Priority: optional
Section: web Section: web
Version: 1.0.7-11 Version: 1.0.7-12
Architecture: mipsel Architecture: mipsel
Maintainer: af123@hummypkg.org.uk Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.7),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6) Depends: webif-channelicons(>=1.1.8),mongoose(>=3.0-9),jim(>=0.74-4),jim-oo,jim-sqlite3(>=0.74-1),jim-cgi(>=0.7),jim-binary,service-control(>=1.2),busybox(>=1.20.2-1),lsof,epg(>=1.0.13),hmt(>=1.1.14),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2),stripts(>=1.2.3),smartmontools,tmenu(>=1.05),ffmpeg,id3v2,multienv(>=1.6)
Suggests: Suggests:
Description: An evolving web interface for the Humax. Description: An evolving web interface for the Humax.

View File

@ -7,7 +7,7 @@ require ts.class
httpheader httpheader
set perc [cgi_get perc 100] set perc [cgi_get perc 100]
set tsfile [file normalize [cgi_get file]] set tsfile [cgi_get file]
set origfile "[file dirname $tsfile]/_original/[file tail $tsfile]" set origfile "[file dirname $tsfile]/_original/[file tail $tsfile]"
set newfile [file rootname $tsfile] set newfile [file rootname $tsfile]

View File

@ -3,34 +3,41 @@ var opkg = '/cgi-bin/opkg.jim?cmd=';
$(document).ready(function() { $(document).ready(function() {
var busy = false; var busy = false;
var reload = false; var tswitch = false;
$('#opkgupdate') $('#opkgupdate')
.button() .button()
.click(function() { reload = true; execopkg('update'); }) .click(function() { tswitch = 2; execopkg('update'); })
.fadeIn('slow'); .fadeIn('slow');
$('#opkgupgradeall') $('#opkgupgradeall')
.button() .button()
.click(function() { reload = true; execopkg('upgrade'); }) .click(function() { tswitch = 2; execopkg('upgrade'); })
.fadeIn('slow'); .fadeIn('slow');
$('#pkgtabs').tabs({ $('#pkgtabs').tabs({
select: function() { create: function(event, ui) {
$(ui.panel).html("<img src=/img/loading.gif>" +
"Loading data... Please wait...");
busy = true;
$('#pkgtabs').tabs('disable');
},
activate: function(event, ui) {
if (busy) if (busy)
{ {
alert('Please wait until the current ' + alert('Please wait until the current ' +
'operation completes.'); 'operation completes.');
return false; return false;
} }
$(ui.newPanel).html("<img src=/img/loading.gif>" +
"Loading data... Please wait...");
busy = true; busy = true;
$('#pkgtabs') $('#pkgtabs').tabs('disable');
.tabs('option', 'disabled', [0,1,2]);
}, },
load: function() { load: function() {
busy = false; busy = false;
setup_buttons(); setup_buttons();
$('#pkgtabs').tabs('option', 'disabled', []); $('#pkgtabs').tabs('enable');
}, },
spinner: '<img border=0 src=/img/loading.gif> ' + spinner: '<img border=0 src=/img/loading.gif> ' +
'<em>Loading...</em>' '<em>Loading...</em>'
@ -45,11 +52,17 @@ $(document).ready(function() {
buttons: { "Close": buttons: { "Close":
function() {$(this).dialog('close');}}, function() {$(this).dialog('close');}},
close: function(e,u) { close: function(e,u) {
if (reload) if (tswitch)
{ {
$('#refreshing').show('slow'); var curtab = $('#pkgtabs')
$('#pkgtabs').hide('fast'); .tabs('option', 'active');
window.location.reload(true); if (curtab != tswitch)
$('#pkgtabs').tabs('option',
'active', tswitch);
else
$('#pkgtabs').tabs('load', tswitch);
tswitch = false;
$('button.va').enable();
} }
else else
{ {
@ -64,18 +77,20 @@ $(document).ready(function() {
jQuery.ajaxSetup({progressInterval: 1}); jQuery.ajaxSetup({progressInterval: 1});
function loaddata(data, isfinal) function loaddata(data, status)
{ {
if (window.console) if (window.console)
{ {
console.log('loaddata called, final=' + isfinal); console.log('loaddata called, status=' + status);
console.log('Data: ' + data); console.log('Data: ' + data);
} }
if (isfinal) if (status)
{ {
$('#dresults').text(data); $('#dresults').text(data);
$('#dspinner').hide('slow'); $('#dspinner').hide('slow');
$('#complete').show('slow'); $('#complete').show('slow');
if (status == 'success')
$('#dialogue').dialog('close');
} }
else else
$('#dresults').append(data); $('#dresults').append(data);
@ -101,8 +116,8 @@ $(document).ready(function() {
type: "GET", type: "GET",
url: opkg + arg, url: opkg + arg,
progress: loaddata, progress: loaddata,
success: function(data) { success: function(data, status) {
loaddata(data, true); loaddata(data, status);
}, },
error: function(_, _, e) { error: function(_, _, e) {
if (window.console) if (window.console)

View File

@ -101,6 +101,7 @@ proc {pkg fetchmeta} {} {
set f [socket stream hummypkg.org.uk:80] set f [socket stream hummypkg.org.uk:80]
$f puts -nonewline "GET /hdrfoxt2/pkg.meta HTTP/1.1\r\n" $f puts -nonewline "GET /hdrfoxt2/pkg.meta HTTP/1.1\r\n"
$f puts -nonewline "Host: hummypkg.org.uk\r\n" $f puts -nonewline "Host: hummypkg.org.uk\r\n"
$f puts -nonewline "Connection: close\r\n"
$f puts -nonewline "\r\n" $f puts -nonewline "\r\n"
set line [string trim [$f gets]] set line [string trim [$f gets]]
@ -119,6 +120,7 @@ proc {pkg fetchdiagmeta} {} {
set f [socket stream hummypkg.org.uk:80] set f [socket stream hummypkg.org.uk:80]
$f puts -nonewline "GET /diag/diag.meta HTTP/1.1\r\n" $f puts -nonewline "GET /diag/diag.meta HTTP/1.1\r\n"
$f puts -nonewline "Host: hummypkg.org.uk\r\n" $f puts -nonewline "Host: hummypkg.org.uk\r\n"
$f puts -nonewline "Connection: close\r\n"
$f puts -nonewline "\r\n" $f puts -nonewline "\r\n"
set line [string trim [$f gets]] set line [string trim [$f gets]]