mirror of https://github.com/apache/cloudstack.git
cloudstack 3.0 UI - VPC - IP Address - after a Port Forwarding rule is added, hide tier dropdown.
This commit is contained in:
parent
f43a92a2af
commit
32fe57aa77
|
|
@ -2814,23 +2814,34 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Check if tiers are present; hide/show header drop-down
|
||||
var $headerFields = $multi.find('.header-fields');
|
||||
if ('vpc' in args.context) {
|
||||
$headerFields.show();
|
||||
if(args.context.ipAddresses[0].associatednetworkid == null) {
|
||||
//$headerFields.find("select").removeAttr("disabled");
|
||||
$headerFields.show();
|
||||
|
||||
// Check if tiers are present; hide/show header drop-down (begin) ***
|
||||
//dataProvider() is called when a LB rule is added in multiEdit. However, adding a LB rule might change parent object (IP Address object). So, we have to force to refresh args.context.ipAddresses[0] here
|
||||
$.ajax({
|
||||
url: createURL('listPublicIpAddresses'),
|
||||
data: {
|
||||
id: args.context.ipAddresses[0].id
|
||||
},
|
||||
success: function(json) {
|
||||
var item = json.listpublicipaddressesresponse.publicipaddress[0];
|
||||
args.context.ipAddresses.shift(); //remove the first element in args.context.ipAddresses
|
||||
args.context.ipAddresses.push(item);
|
||||
|
||||
var $headerFields = $multi.find('.header-fields');
|
||||
if ('vpc' in args.context) {
|
||||
if(args.context.ipAddresses[0].associatednetworkid == null) {
|
||||
$headerFields.show();
|
||||
}
|
||||
else {
|
||||
$headerFields.hide();
|
||||
}
|
||||
}
|
||||
else if('networks' in args.context){
|
||||
$headerFields.hide();
|
||||
}
|
||||
}
|
||||
else {
|
||||
//$headerFields.find("select").attr("disabled", true);
|
||||
$headerFields.hide();
|
||||
}
|
||||
}
|
||||
else if('networks' in args.context){
|
||||
$headerFields.hide();
|
||||
}
|
||||
});
|
||||
// Check if tiers are present; hide/show header drop-down (end) ***
|
||||
},
|
||||
error: function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
|
|
|
|||
Loading…
Reference in New Issue