Persistent Networks support - UI functionality

This commit is contained in:
Pranav Saxena 2013-02-01 16:41:29 +05:30
parent 777147ce8a
commit bd825109d8
2 changed files with 47 additions and 9 deletions

View File

@ -1388,13 +1388,26 @@
if ($(this).val() == "Shared") {
$form.find('.form-item[rel=specifyVlan]').find('input[type=checkbox]').attr("disabled", "disabled"); //make it read-only
$form.find('.form-item[rel=specifyVlan]').find('input[type=checkbox]').attr('checked', true); //make it checked
$form.find('.form-item[rel=isPersistent]').find('input[type=checkbox]').attr("disabled","disabled");
} else { //$(this).val() == "Isolated"
$form.find('.form-item[rel=specifyVlan]').find('input[type=checkbox]').removeAttr("disabled"); //make it editable
$form.find('.form-item[rel=isPersistent]').find('input[type=checkbox]').removeAttr("disabled");
}
});
}
},
isPersistent:{
label:'Persistent ',
isBoolean:true,
isChecked:false
},
specifyVlan: { label: 'label.specify.vlan', isBoolean: true, docID: 'helpNetworkOfferingSpecifyVLAN' },
useVpc: {
@ -1759,16 +1772,29 @@
if(inputData['guestIpType'] == "Shared"){ //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
inputData['specifyIpRanges'] = true;
inputData['isPersistent'] = false;
}
else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown
if (inputData['specifyVlan'] == 'on') { //specifyVlan checkbox is checked
inputData['specifyVlan'] = true;
inputData['specifyIpRanges'] = true;
}
else { //specifyVlan checkbox is unchecked
inputData['specifyVlan'] = false;
inputData['specifyIpRanges'] = false;
}
if(inputData['isPersistent'] == 'on') { //It is a persistent network
inputData['isPersistent'] = true;
}
else { //Isolated Network with Non-persistent network
inputData['isPersistent'] = false;
}
}
@ -1992,6 +2018,12 @@
guestiptype: {
label: 'label.guest.type'
},
ispersistent:{
label:'Persistent ',
converter:cloudStack.converters.toBooleanText
},
availability: {
label: 'label.availability',
isEditable: true,

View File

@ -940,6 +940,12 @@
state: {
label: 'label.state'
},
ispersistent:{
label:'Persistent ',
converter:cloudStack.converters.toBooleanText
},
restartrequired: {
label: 'label.restart.required',
converter: function(booleanValue) {