CS-16044: Zone wizard: Add 'use local storage' checkbox

Add checkbox to zone wizard indicating whether zone will use local
storage. If checked, bypass add primary storage step and enable local
storage for zone on creation.

Conflicts:
	ui/index.jsp
This commit is contained in:
Brian Federle 2012-08-20 11:07:06 -07:00
parent 991795bcc4
commit ad2b8d7579
3 changed files with 13 additions and 27 deletions

View File

@ -17,6 +17,7 @@
#new labels (begin) **********************************************************************************************
label.local.storage.enabled=Local storage enabled
label.tier.details=Tier details
label.edit.tags=Edit tags
label.action.enable.physical.network=Enable physical network

View File

@ -1635,6 +1635,7 @@ under the License.
<script language="javascript">
dictionary = {
'label.edit.tags': '<fmt:message key="label.edit.tags"/>',
'label.local.storage.enabled': '<fmt:message key="label.local.storage.enabled"/>',
'label.tier.details': '<fmt:message key="label.tier.details"/>',
'label.action.enable.physical.network': '<fmt:message key="label.action.enable.physical.network"/>',
'label.action.disable.physical.network': '<fmt:message key="label.action.disable.physical.network"/>',

View File

@ -288,31 +288,8 @@
return (args.groupedData.zone.hypervisor != "VMware");
},
addPrimaryStorage: function(args) {
var item;
$.ajax({
url: createURL("listConfigurations&name=" + todb("use.local.storage")),
dataType: 'json',
async: false,
success: function(json) {
var items = json.listconfigurationsresponse.configuration; //unfortunately, it returns 2 items("system.vm.use.local.storage", "use.local.storage") instead of 1 item.
if(items != null && items.length > 0) {
for(var i = 0; i < items.length; i++) {
item = items[i];
if(item.name == "use.local.storage") {
break; //break for loop
}
}
}
}
});
if(item == null || item.value == null || item.value.length == 0 || item.value == "false")
configurationUseLocalStorage = false;
else
configurationUseLocalStorage = true;
return (!configurationUseLocalStorage);
addPrimaryStorage: function(args) {
return args.data.localstorageenabled != 'on';
}
},
@ -517,6 +494,10 @@
}
});
}
},
localstorageenabled: {
label: 'label.local.storage.enabled',
isBoolean: true
}
}
},
@ -1262,6 +1243,9 @@
array1.push("&name=" + todb(args.data.zone.name));
if (args.data.zone.localstorageenabled == 'on') {
array1.push("&localstorageenabled=true");
}
array1.push("&dns1=" + todb(args.data.zone.dns1));
var dns2 = args.data.zone.dns2;
@ -2801,8 +2785,8 @@
});
},
addPrimaryStorage: function(args) {
if(configurationUseLocalStorage == true) { //use local storage, don't need primary storage. So, skip this step.
addPrimaryStorage: function(args) {
if(args.data.zone.localstorageenabled == 'on') { //use local storage, don't need primary storage. So, skip this step.
stepFns.addSecondaryStorage({
data: args.data
});