2011-07-11 23:29:21 +00:00
|
|
|
<!--#include virtual="/lib/header.shtml" -->
|
|
|
|
|
|
|
|
<style type=text/css>
|
|
|
|
button.install
|
|
|
|
{
|
|
|
|
display: none;
|
|
|
|
background-image: none;
|
|
|
|
background: #ccff99;
|
|
|
|
}
|
|
|
|
button.remove
|
|
|
|
{
|
|
|
|
display: none;
|
|
|
|
background-image: none;
|
|
|
|
background: #ff6666;
|
|
|
|
}
|
|
|
|
button.upgrade
|
|
|
|
{
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<div class=va style="padding: 0 0 1em 0">
|
|
|
|
<h1 style="display: inline" class=va>Package Management</h1>
|
|
|
|
<small>
|
|
|
|
<button class=va id=opkgupdate style="display: none">
|
|
|
|
Update package list from Internet
|
|
|
|
</button>
|
2011-10-05 22:07:22 +00:00
|
|
|
<button class=va id=opkgupgradeall style="display: none">
|
|
|
|
Upgrade all packages
|
|
|
|
</button>
|
2011-07-11 23:29:21 +00:00
|
|
|
</small>
|
|
|
|
</div>
|
|
|
|
|
2011-10-05 22:07:22 +00:00
|
|
|
<div id=refreshing class=shadowbox
|
|
|
|
style="display: none; margin: 1 0 1em 0">
|
|
|
|
<div>
|
|
|
|
<img border=0 src=/img/loading.gif>
|
|
|
|
Refreshing...
|
|
|
|
</div>
|
2011-07-11 23:29:21 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id=dialogue style="display: none; align: center">
|
|
|
|
<pre id=dresults></pre>
|
2012-02-13 21:02:12 +00:00
|
|
|
<div id=dspinner>
|
|
|
|
<img border=0 src=/img/loading.gif>
|
|
|
|
Processing request...
|
|
|
|
</div>
|
|
|
|
<div class=hidden id=complete>
|
|
|
|
<img border=0 src=/images/167_2_00_Check_W2_SUB.png>
|
|
|
|
Operation complete.
|
|
|
|
</div>
|
2011-07-11 23:29:21 +00:00
|
|
|
</div>
|
|
|
|
|
2011-10-05 22:07:22 +00:00
|
|
|
<script type=text/javascript src=/js/iajax.js></script>
|
2011-07-11 23:29:21 +00:00
|
|
|
<script type=text/javascript>
|
|
|
|
|
|
|
|
var opkg = '/cgi-bin/opkg.jim?cmd=';
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
2011-07-14 22:22:54 +00:00
|
|
|
|
|
|
|
$('#opkgupdate')
|
|
|
|
.button()
|
|
|
|
.click(function() { execopkg('update'); })
|
|
|
|
.fadeIn('slow');
|
2011-07-11 23:29:21 +00:00
|
|
|
|
2011-10-05 22:07:22 +00:00
|
|
|
$('#opkgupgradeall')
|
|
|
|
.button()
|
|
|
|
.click(function() { execopkg('upgrade'); })
|
|
|
|
.fadeIn('slow');
|
|
|
|
|
2011-07-12 18:57:30 +00:00
|
|
|
$('#pkgtabs').tabs({
|
|
|
|
load: setup_buttons,
|
|
|
|
spinner: '<img border=0 src=/img/loading.gif> ' +
|
|
|
|
'<em>Loading...</em>'
|
|
|
|
});
|
2011-07-11 23:29:21 +00:00
|
|
|
|
|
|
|
var $dialog = $('#dialogue').dialog({
|
|
|
|
title: "Package Management Results",
|
|
|
|
modal: false, autoOpen: false,
|
|
|
|
height: 500, width: 700,
|
|
|
|
show: 'scale', hide: 'fade',
|
|
|
|
draggable: true, resizable: true,
|
|
|
|
buttons: { "Close":
|
|
|
|
function() {$(this).dialog('close');}},
|
2011-10-05 22:07:22 +00:00
|
|
|
close: function(e,u) {
|
|
|
|
$('#refreshing').show('slow');
|
|
|
|
$('#pkgtabs').hide('fast');
|
|
|
|
window.location.reload(true);
|
|
|
|
}
|
2011-07-11 23:29:21 +00:00
|
|
|
});
|
|
|
|
|
2011-10-05 22:07:22 +00:00
|
|
|
jQuery.ajaxSetup({progressInterval: 1});
|
|
|
|
|
|
|
|
function loaddata(data, isfinal)
|
|
|
|
{
|
|
|
|
//console.log('loaddata called, final=' + isfinal);
|
|
|
|
//console.log('Data: ' + data);
|
|
|
|
$('#dresults').append(data);
|
|
|
|
if (isfinal)
|
|
|
|
{
|
|
|
|
$('#dspinner').hide('slow');
|
|
|
|
if (!$('#dresults').text())
|
|
|
|
$('#dresults').append('Nothing to do.');
|
2012-02-13 21:02:12 +00:00
|
|
|
else
|
|
|
|
$('#complete').show('slow');
|
2011-10-05 22:07:22 +00:00
|
|
|
}
|
|
|
|
}
|
2011-07-14 22:22:54 +00:00
|
|
|
|
|
|
|
function execopkg(arg)
|
|
|
|
{
|
2011-10-05 22:07:22 +00:00
|
|
|
$('button.va')
|
|
|
|
.attr('disabled', true)
|
|
|
|
.addClass('ui-state-disabled');
|
2011-07-14 22:22:54 +00:00
|
|
|
$('#dspinner').show();
|
2012-02-13 21:02:12 +00:00
|
|
|
$('#complete').hide();
|
2011-10-05 22:07:22 +00:00
|
|
|
$('#dresults').empty();
|
2011-07-14 22:22:54 +00:00
|
|
|
$dialog.dialog('open');
|
2011-10-05 22:07:22 +00:00
|
|
|
|
|
|
|
// $('#dresults').load(opkg + arg, function() {
|
|
|
|
// $('#dspinner').hide('slow');
|
2011-09-22 20:27:41 +00:00
|
|
|
// });
|
2011-10-05 22:07:22 +00:00
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
type: "GET",
|
|
|
|
url: opkg + arg,
|
|
|
|
progress: loaddata,
|
|
|
|
success: function(data) {
|
|
|
|
//console.log("ajax success");
|
|
|
|
loaddata(data, true);
|
|
|
|
},
|
|
|
|
error: function(_, _, e) {
|
|
|
|
//console.log("ajax error");
|
|
|
|
alert(e);
|
|
|
|
}
|
|
|
|
});
|
2011-07-14 22:22:54 +00:00
|
|
|
}
|
|
|
|
|
2011-07-11 23:29:21 +00:00
|
|
|
function setup_buttons()
|
|
|
|
{
|
|
|
|
$('button.remove, button.install, button.upgrade')
|
|
|
|
.button()
|
|
|
|
.click(function() {
|
|
|
|
if ($(this).attr('action') == 'remove' &&
|
|
|
|
!confirm('Please confirm removal of the ' +
|
|
|
|
$(this).attr('id') + ' package.'))
|
|
|
|
return;
|
2011-07-14 22:22:54 +00:00
|
|
|
execopkg(encodeURIComponent($(this).attr('action') +
|
|
|
|
' ' + $(this).attr('id')));
|
2011-07-11 23:29:21 +00:00
|
|
|
}).fadeIn('slow');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<div id=pkgtabs>
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<a href=/cgi-bin/pkg.jim?type=upgr>
|
|
|
|
<span>Upgrades</span>
|
|
|
|
</a>
|
2012-01-06 23:44:55 +00:00
|
|
|
</li><li>
|
|
|
|
<a href=/cgi-bin/pkg.jim?type=inst>
|
|
|
|
<span>Installed</span>
|
|
|
|
</a>
|
2011-07-11 23:29:21 +00:00
|
|
|
</li><li>
|
|
|
|
<a href=/cgi-bin/pkg.jim?type=avail>
|
|
|
|
<span>Available</span>
|
|
|
|
</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<!--#include virtual="/lib/footer.shtml" -->
|