add ganglia option on provision dialog

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10293 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
xq2005 2011-08-16 08:38:46 +00:00
parent 38e619fcdb
commit 41548b978b
2 changed files with 54 additions and 3 deletions

View File

@ -201,6 +201,11 @@ body {
padding-left: 10px;
}
#groups .groupdiv div{
color: blue;
padding: 5px 0px 5px 20px;
}
#groups .groupdiv div:hover {
background: #E7EBFF;
cursor: pointer;

View File

@ -230,7 +230,7 @@ function loadGroups(data) {
var grouplist= $('<div class="groupdiv"></div>');
// Create a link for each group
for (var i = groups.length; i--;) {
grouplist.append('<div><a href="#">' + groups[i] + '</a></div>');
grouplist.append('<div>' + groups[i] + '</div>');
}
$('#groups').append(grouplist);
@ -3259,7 +3259,7 @@ function openQuickProvisionDia(tgtnodes){
showstr += '<tr><td>TFTP Server:</td><td><input id="tftpinput"></td></tr>';
showstr += '<tr><td>NFS Server:</td><td><input id="nfsinput"></td></tr>';
showstr += '</tbody></table>';
showstr += '<div id="imageinfo"></div>';
showstr += '<div id="advoption"></div>';
diaDiv.append(showstr);
diaDiv.dialog({
modal: true,
@ -3272,7 +3272,11 @@ function openQuickProvisionDia(tgtnodes){
});
$('#deployDiv select').parent().append(createLoader());
$('#deployDiv select').bind('change', function(){
$('#deployDiv #advoption').html('<img src="images/loader.gif"></img>');
provisionAdvOption($(this).val());
});
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
@ -3301,6 +3305,8 @@ function openQuickProvisionDia(tgtnodes){
$('#deployDiv select').append('<option value="' + imagename + '">' + imagename + '</option>');
}
$('#deployDiv select').trigger('change');
$('#deployDiv').dialog( "option", "buttons", {'Ok': function(){quickProvision();},
'Cancel': function(){$(this).remove();}}
);
@ -3308,6 +3314,46 @@ function openQuickProvisionDia(tgtnodes){
});
}
function provisionAdvOption(imagename){
$.ajax({
url : 'lib/cmd.php',
dataType : 'json',
data : {
cmd : 'lsdef',
tgt : '',
args : '-t;osimage;' + imagename + ';-i;osname,provmethod',
msg : ''
},
success : function(data){
var index = 0;
var osname = '';
var provmethod = '';
var tempstr = '';
var position = 0;
for (index = 0; index < data.rsp.length; index++){
tempstr = data.rsp[index];
if (-1 != tempstr.indexOf('osname')){
position = tempstr.indexOf('=');
osname = tempstr.substr(position + 1);
}
if (-1 != tempstr.indexOf('provmethod')){
position = tempstr.indexOf('=');
provmethod = tempstr.substr(position + 1);
}
}
$('#deployDiv #advoption').empty();
if ('aix' == osname.toLowerCase()){
return;
}
if ('install' == provmethod){
$('#deployDiv #advoption').html('<input type="checkbox" checked="checked">Install Ganglia.');
}
}
});
}
/**
* get all needed field for provsion and send the command to server
*