Network list view: Fix incorrect 'acquire new ip' message from appearing

Fixes issue where global flag was sometimes causing the confirm
message to be incorrect for non-VPC acquire IP action.

Conflicts:
	ui/scripts/network.js
This commit is contained in:
Brian Federle 2012-11-13 10:39:45 -08:00
parent 456202162c
commit 70a5a22329
3 changed files with 5 additions and 5 deletions

View File

@ -17,6 +17,7 @@
#new labels (begin) **********************************************************************************************
message.acquire.new.ip.vpc=Please confirm that you would like to acquire a new IP for this VPC.
label.zoneWizard.trafficType.management=Mangement: Traffic between CloudStack\'s internal resources, including any components that communicate with the Management Server, such as hosts and CloudStack system VMs
label.zoneWizard.trafficType.public=Public: Traffic between the internet and virtual machines in the cloud.
label.zoneWizard.trafficType.guest=Guest: Traffic between end-user virtual machines

View File

@ -25,6 +25,7 @@ under the License.
<% long now = System.currentTimeMillis(); %>
<script language="javascript">
dictionary = {
'message.acquire.new.ip.vpc': '<fmt:message key="message.acquire.new.ip.vpc"/>',
'label.quickview': '<fmt:message key="label.quickview"/>',
'label.migrate.to.host': '<fmt:message key="label.migrate.to.host"/>',
'label.migrate.to.storage': '<fmt:message key="label.migrate.to.storage"/>',

View File

@ -1209,20 +1209,18 @@
preFilter: function(args) {
if('networks' in args.context) { //from Guest Network section
if(args.context.networks[0].vpcid == null) { //if it's a non-VPC network, show Acquire IP button
checkVpc=0;
return true;
}
else //if it's a VPC network, hide Acquire IP button
return false;
}
else { //from VPC section
checkVpc=1;
return true; //show Acquire IP button
}
},
messages: {
confirm: function(args) {
if(checkVpc == 1)
if(args.context.vpc)
return 'Please confirm that you would like to acquire a new IP for this VPC';
else
return 'message.acquire.new.ip';