");
$.ajax({
url: 'lib/systemcmd.php',
dataType : 'json',
data : {
cmd : 'rpm -q xCAT-client perl-xCAT xCAT-server xCAT xCAT-rmc xCAT-UI'
},
success : showRpmInfo
});
}
/**
* Show the Rpm Repository, it can use user's last choice and input
*
* @return Nothing
*/
function showRepository(data) {
var DevelRepository = "";
var StableRepository = "";
var Show = "";
//get the corresponding repository by OS Type
if ("aix" == data.rsp)
{
DevelRepository = "http://xcat.sourceforge.net/aix/devel/xcat-core/";
StableRepository = "http://xcat.sourceforge.net/aix/xcat-core/";
}
else
{
DevelRepository = "http://xcat.sourceforge.net/yum/devel/xcat-core/";
StableRepository = "http://xcat.sourceforge.net/yum/xcat-core/";
}
//dispaly the Devel Repository, remember user's last selection
Show = Show + "";
Show = Show + DevelRepository + "(Devel) ";
$('#repository').append(Show);
//dispaly the Stable Repository, remember user's last selection
Show = "";
Show = Show + StableRepository + "(Stable) ";
$('#repository').append(Show);
//dispaly the Input Repository, remember user's last selection
if (($.cookie('xcatrepository'))
&& (1 != $.cookie('xcatrepository'))
&& (2 != $.cookie('xcatrepository')))
{
Show = "Other:";
Show += "";
}
else
{
Show = "Other:";
Show += "";
}
$('#repository').append(Show);
}
function showRpmInfo(data)
{
var Rpms = null;
var Show = "";
var RpmNames = new Array("xCAT-client","perl-xCAT","xCAT-server","xCAT","xCAT-rmc","xCAT-UI");
var temp = 0;
if(null == data.rsp)
{
$('#rpm').append("Get Rpm Info Error!");
return;
}
Rpms = data.rsp.split(/\n/);
//no rpm installed, return
if (1 > Rpms.length)
{
$('#rpm').append("No Rpm installed!");
return;
}
Show = "
";
Show += "
";
Show += "
";
Show += "
Package Name
Version
";
Show += "
";
for (temp = 0; temp < Rpms.length; temp++)
{
//empty line continue
if ("" == Rpms[temp])
{
continue;
}
//the rpm is not installed, continue
if (-1 != Rpms[temp].indexOf("not"))
{
continue;
}
//show the version in table
Show += "