start the association behind configure
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8625 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
4ad661ff8f
commit
d51368d680
@ -1125,9 +1125,68 @@ function startStopCondRespDia(){
|
||||
buttons: {
|
||||
close : function(){
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#divStartStopAss button').bind('click', function(){
|
||||
var operationType = '';
|
||||
var conditionName = $(this).attr('name');
|
||||
if ('Start' == $(this).html()){
|
||||
operationType = 'start';
|
||||
}
|
||||
else{
|
||||
operationType = 'stop';
|
||||
}
|
||||
|
||||
$(this).parent().prev().empty().append(createLoader());
|
||||
$('#divStartStopAss').dialog('option', 'disabled', true);
|
||||
$.ajax({
|
||||
url : 'lib/cmd.php',
|
||||
dataType : 'json',
|
||||
data : {
|
||||
cmd : 'webrun',
|
||||
tgt : '',
|
||||
args : operationType + 'condresp;' + conditionName,
|
||||
msg : operationType + ';' + conditionName
|
||||
},
|
||||
|
||||
success : function(data){
|
||||
var conditionName = '';
|
||||
var newOperationType = '';
|
||||
var associationStatus = '';
|
||||
var backgroudColor = '';
|
||||
if ('start' == data.msg.substr(0, 5)){
|
||||
newOperationType = 'Stop';
|
||||
conditionName = data.msg.substr(6);
|
||||
associationStatus = 'Monitored';
|
||||
backgroudColor = '#ffffff';
|
||||
}
|
||||
else{
|
||||
newOperationType = 'Start';
|
||||
conditionName = data.msg.substr(5);
|
||||
associationStatus = 'Not Monitored';
|
||||
backgroudColor = '#fffacd';
|
||||
}
|
||||
|
||||
var button = $('#divStartStopAss button[name="' + conditionName + '"]');
|
||||
if (data.rsp[0]){
|
||||
$('#rmcEventStatus').empty().append('Getting associations\' status').append(createLoader());
|
||||
$('#rmcEventButtons').hide();
|
||||
button.html(newOperationType);
|
||||
button.parent().prev().html(associationStatus);
|
||||
button.parent().parent().css('background-color', backgroudColor);
|
||||
globalCondition = '';
|
||||
getConditions();
|
||||
}
|
||||
else{
|
||||
button.html('Error');
|
||||
}
|
||||
|
||||
$('#divStartStopAss').dialog('option', 'disabled', false);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1245,15 +1304,13 @@ function createAssociationTable(cond){
|
||||
tempStatus = name.substr(tempLength - 3);
|
||||
name = name.substr(1, tempLength - 6);
|
||||
|
||||
showStr += '<tr>';
|
||||
showStr += '<td>' + name + '</td>';
|
||||
if ('Not' == tempStatus){
|
||||
showStr += '<td>Not Monitored</td>';
|
||||
showStr += '<td><button id="button">Start</button></td>';
|
||||
showStr += '<tr style="background-color:#fffacd;"><td>' + name + '</td><td>Not Monitored</td>';
|
||||
showStr += '<td><button id="button" name="' + name + '">Start</button></td>';
|
||||
}
|
||||
else{
|
||||
showStr += '<td>Monitored</td>';
|
||||
showStr += '<td><button id="button">Stop</button></td>';
|
||||
showStr += '<tr><td>' + name + '</td><td>Monitored</td>';
|
||||
showStr += '<td><button id="button" name="' + name + '">Stop</button></td>';
|
||||
}
|
||||
showStr += '</tr>';
|
||||
}
|
||||
|
@ -175,6 +175,8 @@ sub web_mkcondresp {
|
||||
my $retInfo = xCAT::Utils->runcmd($cmd, -1, 1);
|
||||
}
|
||||
#there's no output for "mkcondresp"
|
||||
$cmd = 'startcondresp ' . $conditionName;
|
||||
my $refInfo = xCAT::Utils->runcmd($cmd, -1, 1);
|
||||
$callback->({ data => "Success." });
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user