mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 02:22:52 +01:00
Removed trailing whitespace from ui/scripts/*.js
This commit is contained in:
parent
a5e563aa85
commit
2bdbaf453e
@ -17,7 +17,7 @@
|
|||||||
(function(cloudStack) {
|
(function(cloudStack) {
|
||||||
|
|
||||||
var domainObjs;
|
var domainObjs;
|
||||||
|
|
||||||
cloudStack.sections.accounts = {
|
cloudStack.sections.accounts = {
|
||||||
title: 'label.accounts',
|
title: 'label.accounts',
|
||||||
id: 'accounts',
|
id: 'accounts',
|
||||||
@ -91,7 +91,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
addLdapAccount: {
|
addLdapAccount: {
|
||||||
label: 'label.add.ldap.account',
|
label: 'label.add.ldap.account',
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
@ -123,7 +123,7 @@
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
@ -422,11 +422,11 @@
|
|||||||
data: data,
|
data: data,
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var resourcecounts= json.updateresourcecountresponse.resourcecount;
|
var resourcecounts= json.updateresourcecountresponse.resourcecount;
|
||||||
//pop up API response in a dialog box since only updateResourceCount API returns resourcecount (listResourceLimits API does NOT return resourcecount)
|
//pop up API response in a dialog box since only updateResourceCount API returns resourcecount (listResourceLimits API does NOT return resourcecount)
|
||||||
var msg = '';
|
var msg = '';
|
||||||
if (resourcecounts != null) {
|
if (resourcecounts != null) {
|
||||||
for (var i = 0; i < resourcecounts.length; i++) {
|
for (var i = 0; i < resourcecounts.length; i++) {
|
||||||
switch (resourcecounts[i].resourcetype) {
|
switch (resourcecounts[i].resourcetype) {
|
||||||
case '0':
|
case '0':
|
||||||
msg += 'Instance'; //vmLimit
|
msg += 'Instance'; //vmLimit
|
||||||
@ -443,8 +443,8 @@
|
|||||||
case '4':
|
case '4':
|
||||||
msg += 'Template'; //templateLimit
|
msg += 'Template'; //templateLimit
|
||||||
break;
|
break;
|
||||||
case '5':
|
case '5':
|
||||||
continue; //resourcetype 5 is not in use. so, skip to next item.
|
continue; //resourcetype 5 is not in use. so, skip to next item.
|
||||||
break;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
msg += 'Network'; //networkLimit
|
msg += 'Network'; //networkLimit
|
||||||
@ -463,18 +463,18 @@
|
|||||||
break;
|
break;
|
||||||
case '11':
|
case '11':
|
||||||
msg += 'Secondary Storage'; //secondaryStorageLimit
|
msg += 'Secondary Storage'; //secondaryStorageLimit
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
msg += ' Count: ' + resourcecounts[i].resourcecount + ' <br> ';
|
msg += ' Count: ' + resourcecounts[i].resourcecount + ' <br> ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: msg
|
message: msg
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success();
|
args.response.success();
|
||||||
},
|
},
|
||||||
error: function(json) {
|
error: function(json) {
|
||||||
@ -653,12 +653,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
tabFilter: function(args) {
|
tabFilter: function(args) {
|
||||||
var hiddenTabs = [];
|
var hiddenTabs = [];
|
||||||
if(!isAdmin()) {
|
if(!isAdmin()) {
|
||||||
hiddenTabs.push('settings');
|
hiddenTabs.push('settings');
|
||||||
}
|
}
|
||||||
return hiddenTabs;
|
return hiddenTabs;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2011,13 +2011,13 @@
|
|||||||
if (jsonObj.state == "disabled")
|
if (jsonObj.state == "disabled")
|
||||||
allowedActions.push("enable");
|
allowedActions.push("enable");
|
||||||
allowedActions.push("remove");
|
allowedActions.push("remove");
|
||||||
|
|
||||||
allowedActions.push("changePassword");
|
allowedActions.push("changePassword");
|
||||||
allowedActions.push("generateKeys");
|
allowedActions.push("generateKeys");
|
||||||
if (g_idpList) {
|
if (g_idpList) {
|
||||||
allowedActions.push("configureSamlAuthorization");
|
allowedActions.push("configureSamlAuthorization");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return allowedActions;
|
return allowedActions;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,9 +78,9 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listDomains"),
|
url: createURL("listDomains"),
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var items = [];
|
var items = [];
|
||||||
domainObjs = json.listdomainsresponse.domain;
|
domainObjs = json.listdomainsresponse.domain;
|
||||||
@ -227,7 +227,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var accountType = args.data.accounttype;
|
var accountType = args.data.accounttype;
|
||||||
if (accountType == "1") { //if "admin" is selected in account type dropdown
|
if (accountType == "1") { //if "admin" is selected in account type dropdown
|
||||||
if (rootDomainId == undefined || args.data.domainid != rootDomainId ) { //but current login has no visibility to root domain object, or the selected domain is not root domain
|
if (rootDomainId == undefined || args.data.domainid != rootDomainId ) { //but current login has no visibility to root domain object, or the selected domain is not root domain
|
||||||
accountType = "2"; // change accountType from root-domain("1") to domain-admin("2")
|
accountType = "2"; // change accountType from root-domain("1") to domain-admin("2")
|
||||||
}
|
}
|
||||||
@ -313,6 +313,6 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}(cloudStack, jQuery));
|
}(cloudStack, jQuery));
|
||||||
|
|||||||
@ -206,14 +206,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var affinitygroupActionfilter = cloudStack.actionFilter.affinitygroupActionfilter = function(args) {
|
var affinitygroupActionfilter = cloudStack.actionFilter.affinitygroupActionfilter = function(args) {
|
||||||
var jsonObj = args.context.item;
|
var jsonObj = args.context.item;
|
||||||
var allowedActions = [];
|
var allowedActions = [];
|
||||||
if (jsonObj.type != 'ExplicitDedication' || isAdmin()) {
|
if (jsonObj.type != 'ExplicitDedication' || isAdmin()) {
|
||||||
allowedActions.push("remove");
|
allowedActions.push("remove");
|
||||||
}
|
}
|
||||||
return allowedActions;
|
return allowedActions;
|
||||||
}
|
}
|
||||||
|
|
||||||
})(cloudStack);
|
})(cloudStack);
|
||||||
|
|||||||
@ -1341,7 +1341,7 @@
|
|||||||
array1.push("&interval=" + args.data.interval);
|
array1.push("&interval=" + args.data.interval);
|
||||||
array1.push("&scaleuppolicyids=" + args.scaleUpPolicyResponse.id);
|
array1.push("&scaleuppolicyids=" + args.scaleUpPolicyResponse.id);
|
||||||
array1.push("&scaledownpolicyids=" + args.scaleDownPolicyResponse.id);
|
array1.push("&scaledownpolicyids=" + args.scaleDownPolicyResponse.id);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('createAutoScaleVmGroup' + array1.join("")),
|
url: createURL('createAutoScaleVmGroup' + array1.join("")),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
|||||||
@ -136,15 +136,15 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
g_capabilities = json.listcapabilitiesresponse.capability;
|
g_capabilities = json.listcapabilitiesresponse.capability;
|
||||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||||
}
|
}
|
||||||
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
||||||
|
|
||||||
|
|
||||||
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||||
|
|
||||||
@ -251,7 +251,7 @@
|
|||||||
});
|
});
|
||||||
$.cookie('role', g_role, {
|
$.cookie('role', g_role, {
|
||||||
expires: 1
|
expires: 1
|
||||||
});
|
});
|
||||||
$.cookie('timezone', g_timezone, {
|
$.cookie('timezone', g_timezone, {
|
||||||
expires: 1
|
expires: 1
|
||||||
});
|
});
|
||||||
@ -268,14 +268,14 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
g_capabilities = json.listcapabilitiesresponse.capability;
|
g_capabilities = json.listcapabilitiesresponse.capability;
|
||||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||||
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
if (json.listcapabilitiesresponse.capability.userpublictemplateenabled != null) {
|
||||||
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
g_userPublicTemplateEnabled = json.listcapabilitiesresponse.capability.userpublictemplateenabled.toString(); //convert boolean to string if it's boolean
|
||||||
}
|
}
|
||||||
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
g_userProjectsEnabled = json.listcapabilitiesresponse.capability.allowusercreateprojects;
|
||||||
|
|
||||||
|
|
||||||
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
g_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||||
|
|
||||||
@ -300,7 +300,7 @@
|
|||||||
args.response.error();
|
args.response.error();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get project configuration
|
// Get project configuration
|
||||||
// TEMPORARY -- replace w/ output of capability response, etc., once implemented
|
// TEMPORARY -- replace w/ output of capability response, etc., once implemented
|
||||||
window.g_projectsInviteRequired = false;
|
window.g_projectsInviteRequired = false;
|
||||||
@ -462,6 +462,6 @@
|
|||||||
|
|
||||||
cloudStack.uiCustom.login(loginArgs);
|
cloudStack.uiCustom.login(loginArgs);
|
||||||
|
|
||||||
document.title = _l('label.app.name');
|
document.title = _l('label.app.name');
|
||||||
});
|
});
|
||||||
})(cloudStack, jQuery);
|
})(cloudStack, jQuery);
|
||||||
|
|||||||
@ -137,7 +137,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
isCustomized: {
|
isCustomized: {
|
||||||
label: 'label.custom',
|
label: 'label.custom',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isReverse: true,
|
isReverse: true,
|
||||||
isChecked: false
|
isChecked: false
|
||||||
@ -360,7 +360,7 @@
|
|||||||
},
|
},
|
||||||
hostTags: { //Only one single host tag is supported at server-side. Multiple host tags are NOT supported at server-side.
|
hostTags: { //Only one single host tag is supported at server-side. Multiple host tags are NOT supported at server-side.
|
||||||
label: 'Host Tag',
|
label: 'Host Tag',
|
||||||
docID: 'helpComputeOfferingHostTags'
|
docID: 'helpComputeOfferingHostTags'
|
||||||
},
|
},
|
||||||
cpuCap: {
|
cpuCap: {
|
||||||
label: 'label.CPU.cap',
|
label: 'label.CPU.cap',
|
||||||
@ -410,7 +410,7 @@
|
|||||||
var $fields = $form.find('.field');
|
var $fields = $form.find('.field');
|
||||||
if ($(this).val() == "ImplicitDedicationPlanner") {
|
if ($(this).val() == "ImplicitDedicationPlanner") {
|
||||||
$form.find('[rel=plannerMode]').css('display', 'block');
|
$form.find('[rel=plannerMode]').css('display', 'block');
|
||||||
} else {
|
} else {
|
||||||
$form.find('[rel=plannerMode]').hide();
|
$form.find('[rel=plannerMode]').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -596,9 +596,9 @@
|
|||||||
provisioningType :args.data.provisioningType,
|
provisioningType :args.data.provisioningType,
|
||||||
customized: (args.data.isCustomized == "on")
|
customized: (args.data.isCustomized == "on")
|
||||||
};
|
};
|
||||||
|
|
||||||
//custom fields (begin)
|
//custom fields (begin)
|
||||||
if (args.data.isCustomized != "on") {
|
if (args.data.isCustomized != "on") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
cpuNumber: args.data.cpuNumber
|
cpuNumber: args.data.cpuNumber
|
||||||
});
|
});
|
||||||
@ -608,9 +608,9 @@
|
|||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
memory: args.data.memory
|
memory: args.data.memory
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//custom fields (end)
|
//custom fields (end)
|
||||||
|
|
||||||
if (args.data.deploymentPlanner != null && args.data.deploymentPlanner.length > 0) {
|
if (args.data.deploymentPlanner != null && args.data.deploymentPlanner.length > 0) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
deploymentplanner: args.data.deploymentPlanner
|
deploymentplanner: args.data.deploymentPlanner
|
||||||
@ -872,7 +872,7 @@
|
|||||||
converter: function(args) {
|
converter: function(args) {
|
||||||
if (args == undefined)
|
if (args == undefined)
|
||||||
return '';
|
return '';
|
||||||
else
|
else
|
||||||
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -936,10 +936,10 @@
|
|||||||
},
|
},
|
||||||
deploymentplanner: {
|
deploymentplanner: {
|
||||||
label: 'label.deployment.planner'
|
label: 'label.deployment.planner'
|
||||||
},
|
},
|
||||||
plannerMode: {
|
plannerMode: {
|
||||||
label: 'label.planner.mode'
|
label: 'label.planner.mode'
|
||||||
},
|
},
|
||||||
pciDevice: {
|
pciDevice: {
|
||||||
label: 'label.gpu'
|
label: 'label.gpu'
|
||||||
},
|
},
|
||||||
@ -972,13 +972,13 @@
|
|||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var item = json.listserviceofferingsresponse.serviceoffering[0];
|
var item = json.listserviceofferingsresponse.serviceoffering[0];
|
||||||
|
|
||||||
if (item.deploymentplanner != null && item.serviceofferingdetails != null) {
|
if (item.deploymentplanner != null && item.serviceofferingdetails != null) {
|
||||||
if (item.deploymentplanner == 'ImplicitDedicationPlanner' && item.serviceofferingdetails.ImplicitDedicationMode != null) {
|
if (item.deploymentplanner == 'ImplicitDedicationPlanner' && item.serviceofferingdetails.ImplicitDedicationMode != null) {
|
||||||
item.plannerMode = item.serviceofferingdetails.ImplicitDedicationMode;
|
item.plannerMode = item.serviceofferingdetails.ImplicitDedicationMode;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.serviceofferingdetails != null) {
|
if (item.serviceofferingdetails != null) {
|
||||||
item.pciDevice = item.serviceofferingdetails.pciDevice;
|
item.pciDevice = item.serviceofferingdetails.pciDevice;
|
||||||
item.vgpuType = item.serviceofferingdetails.vgpuType;
|
item.vgpuType = item.serviceofferingdetails.vgpuType;
|
||||||
@ -1469,7 +1469,7 @@
|
|||||||
converter: function(args) {
|
converter: function(args) {
|
||||||
if (args == undefined)
|
if (args == undefined)
|
||||||
return '';
|
return '';
|
||||||
else
|
else
|
||||||
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1924,7 +1924,7 @@
|
|||||||
customized: (args.data.isCustomized == "on")
|
customized: (args.data.isCustomized == "on")
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.data.isCustomized != "on") {
|
if (args.data.isCustomized != "on") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
disksize: args.data.disksize
|
disksize: args.data.disksize
|
||||||
});
|
});
|
||||||
@ -2556,7 +2556,7 @@
|
|||||||
args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').hide();
|
args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').hide();
|
||||||
args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').find('input[type=checkbox]').attr('checked', false);
|
args.$form.find('.form-item[rel=\"service.StaticNat.associatePublicIP\"]').find('input[type=checkbox]').attr('checked', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//StretchedL2Subnet checkbox should be displayed only when 'Connectivity' service is checked
|
//StretchedL2Subnet checkbox should be displayed only when 'Connectivity' service is checked
|
||||||
if (args.$form.find('.form-item[rel=\"service.Connectivity.isEnabled\"]').find('input[type=checkbox]').is(':checked')) {
|
if (args.$form.find('.form-item[rel=\"service.Connectivity.isEnabled\"]').find('input[type=checkbox]').is(':checked')) {
|
||||||
$supportsstrechedl2subnet.css('display', 'inline-block');
|
$supportsstrechedl2subnet.css('display', 'inline-block');
|
||||||
@ -3045,8 +3045,8 @@
|
|||||||
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'lbSchemes';
|
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'lbSchemes';
|
||||||
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
|
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
|
||||||
serviceCapabilityIndex++;
|
serviceCapabilityIndex++;
|
||||||
}
|
}
|
||||||
} else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egressdefaultpolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted)
|
} else if (value != '') { // normal data (serviceData.length ==1), e.g. "name", "displayText", "networkRate", "guestIpType", "lbType" (unwanted), "availability" (unwated when value is "Optional"), "egressdefaultpolicy", "state" (unwanted), "status" (unwanted), "allocationstate" (unwanted)
|
||||||
if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate" || key == "useVpc" )) {
|
if (!(key == "lbType" || (key == "availability" && value == "Optional") || key == "state" || key == "status" || key == "allocationstate" || key == "useVpc" )) {
|
||||||
inputData[key] = value;
|
inputData[key] = value;
|
||||||
}
|
}
|
||||||
@ -3097,21 +3097,21 @@
|
|||||||
if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
|
if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
|
||||||
inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
|
inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
|
||||||
inputData['specifyIpRanges'] = true;
|
inputData['specifyIpRanges'] = true;
|
||||||
delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)
|
delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)
|
||||||
} else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown
|
} else if (inputData['guestIpType'] == "Isolated") { //specifyVlan checkbox is shown
|
||||||
//inputData['specifyIpRanges'] = false;
|
//inputData['specifyIpRanges'] = false;
|
||||||
delete inputData.specifyIpRanges; //if specifyIpRanges should be false, do not pass specifyIpRanges parameter to API call since we need to keep API call's size as small as possible (p.s. specifyIpRanges is defaulted as false at server-side)
|
delete inputData.specifyIpRanges; //if specifyIpRanges should be false, do not pass specifyIpRanges parameter to API call since we need to keep API call's size as small as possible (p.s. specifyIpRanges is defaulted as false at server-side)
|
||||||
|
|
||||||
if (inputData['specifyVlan'] == 'on') { //specifyVlan checkbox is checked
|
if (inputData['specifyVlan'] == 'on') { //specifyVlan checkbox is checked
|
||||||
inputData['specifyVlan'] = true;
|
inputData['specifyVlan'] = true;
|
||||||
} else { //specifyVlan checkbox is unchecked
|
} else { //specifyVlan checkbox is unchecked
|
||||||
delete inputData.specifyVlan; //if specifyVlan checkbox is unchecked, do not pass specifyVlan parameter to API call since we need to keep API call's size as small as possible (p.s. specifyVlan is defaulted as false at server-side)
|
delete inputData.specifyVlan; //if specifyVlan checkbox is unchecked, do not pass specifyVlan parameter to API call since we need to keep API call's size as small as possible (p.s. specifyVlan is defaulted as false at server-side)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inputData['isPersistent'] == 'on') { //It is a persistent network
|
if (inputData['isPersistent'] == 'on') { //It is a persistent network
|
||||||
inputData['isPersistent'] = true;
|
inputData['isPersistent'] = true;
|
||||||
} else { //Isolated Network with Non-persistent network
|
} else { //Isolated Network with Non-persistent network
|
||||||
delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)
|
delete inputData.isPersistent; //if Persistent checkbox is unchecked, do not pass isPersistent parameter to API call since we need to keep API call's size as small as possible (p.s. isPersistent is defaulted as false at server-side)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4112,5 +4112,5 @@
|
|||||||
|
|
||||||
return allowedActions;
|
return allowedActions;
|
||||||
};
|
};
|
||||||
|
|
||||||
})(cloudStack, jQuery);
|
})(cloudStack, jQuery);
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
user: {
|
user: {
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var dataFns = {
|
var dataFns = {
|
||||||
instances: function(data) {
|
instances: function(data) {
|
||||||
var totalInstanceCount = 0;
|
var totalInstanceCount = 0;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listVirtualMachines"),
|
url: createURL("listVirtualMachines"),
|
||||||
@ -38,13 +38,13 @@
|
|||||||
pageSize: 1
|
pageSize: 1
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||||
totalInstanceCount = json.listvirtualmachinesresponse.count;
|
totalInstanceCount = json.listvirtualmachinesresponse.count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var RunningInstanceCount = 0;
|
var RunningInstanceCount = 0;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listVirtualMachines"),
|
url: createURL("listVirtualMachines"),
|
||||||
@ -55,13 +55,13 @@
|
|||||||
state: "Running"
|
state: "Running"
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||||
RunningInstanceCount = json.listvirtualmachinesresponse.count;
|
RunningInstanceCount = json.listvirtualmachinesresponse.count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var stoppedInstanceCount = 0;
|
var stoppedInstanceCount = 0;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listVirtualMachines"),
|
url: createURL("listVirtualMachines"),
|
||||||
@ -72,18 +72,18 @@
|
|||||||
state: "Stopped"
|
state: "Stopped"
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||||
stoppedInstanceCount = json.listvirtualmachinesresponse.count;
|
stoppedInstanceCount = json.listvirtualmachinesresponse.count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
dataFns.account($.extend(data, {
|
dataFns.account($.extend(data, {
|
||||||
runningInstances: RunningInstanceCount,
|
runningInstances: RunningInstanceCount,
|
||||||
stoppedInstances: stoppedInstanceCount,
|
stoppedInstances: stoppedInstanceCount,
|
||||||
totalInstances: totalInstanceCount
|
totalInstances: totalInstanceCount
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|
||||||
account: function(data) {
|
account: function(data) {
|
||||||
@ -103,7 +103,7 @@
|
|||||||
data: {
|
data: {
|
||||||
listAll: true,
|
listAll: true,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
||||||
//pageSize: 1 //for testing only
|
//pageSize: 1 //for testing only
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
@ -197,7 +197,7 @@
|
|||||||
url: createURL('listAlerts'),
|
url: createURL('listAlerts'),
|
||||||
data: {
|
data: {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var alerts = json.listalertsresponse.alert ?
|
var alerts = json.listalertsresponse.alert ?
|
||||||
@ -222,7 +222,7 @@
|
|||||||
data: {
|
data: {
|
||||||
state: 'Alert',
|
state: 'Alert',
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
pageSize: (pageSize > 4? 4: pageSize) //if default.page.size > 4, show 4 items only (since space on dashboard is limited)
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var hosts = json.listhostsresponse.host ?
|
var hosts = json.listhostsresponse.host ?
|
||||||
@ -247,7 +247,7 @@
|
|||||||
fetchLatest: data.fetchLatest,
|
fetchLatest: data.fetchLatest,
|
||||||
sortBy: 'usage',
|
sortBy: 'usage',
|
||||||
page: 0,
|
page: 0,
|
||||||
pageSize: (pageSize > 8? 8: pageSize)
|
pageSize: (pageSize > 8? 8: pageSize)
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var capacities = json.listcapacityresponse.capacity ?
|
var capacities = json.listcapacityresponse.capacity ?
|
||||||
|
|||||||
@ -100,7 +100,7 @@
|
|||||||
var domainObj;
|
var domainObj;
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.domains[0].id
|
id: args.context.domains[0].id
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.data.name != null) { //args.data.name == undefined means name field is not editable (when log in as normal user or domain admin)
|
if (args.data.name != null) { //args.data.name == undefined means name field is not editable (when log in as normal user or domain admin)
|
||||||
@ -108,14 +108,14 @@
|
|||||||
name: args.data.name
|
name: args.data.name
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.data.networkdomain != null) { //args.data.networkdomain == undefined means networkdomain field is not editable (when log in as normal user or domain admin)
|
if (args.data.networkdomain != null) { //args.data.networkdomain == undefined means networkdomain field is not editable (when log in as normal user or domain admin)
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
networkdomain: args.data.networkdomain
|
networkdomain: args.data.networkdomain
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if('name' in data || 'networkdomain' in data) {
|
if('name' in data || 'networkdomain' in data) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("updateDomain"),
|
url: createURL("updateDomain"),
|
||||||
async: false,
|
async: false,
|
||||||
@ -366,7 +366,7 @@
|
|||||||
networkdomain: {
|
networkdomain: {
|
||||||
label: 'label.network.domain',
|
label: 'label.network.domain',
|
||||||
isEditable: function(args) {
|
isEditable: function(args) {
|
||||||
if (isAdmin())
|
if (isAdmin())
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
@ -652,8 +652,8 @@
|
|||||||
if (jsonObj.level != 0) { //ROOT domain (whose level is 0) is not allowed to delete
|
if (jsonObj.level != 0) { //ROOT domain (whose level is 0) is not allowed to delete
|
||||||
allowedActions.push("delete");
|
allowedActions.push("delete");
|
||||||
}
|
}
|
||||||
} else if (isDomainAdmin()) {
|
} else if (isDomainAdmin()) {
|
||||||
if (args.context.domains[0].id != g_domainid) {
|
if (args.context.domains[0].id != g_domainid) {
|
||||||
allowedActions.push("edit"); //merge updateResourceLimit into edit
|
allowedActions.push("edit"); //merge updateResourceLimit into edit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var events = args.context.events;
|
var events = args.context.events;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("deleteEvents"),
|
url: createURL("deleteEvents"),
|
||||||
data: {
|
data: {
|
||||||
@ -90,7 +90,7 @@
|
|||||||
error:function(data) {
|
error:function(data) {
|
||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -154,7 +154,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
archive: {
|
archive: {
|
||||||
label: 'label.archive.events',
|
label: 'label.archive.events',
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
@ -215,7 +215,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Archive multiple events
|
// Archive multiple events
|
||||||
archiveMulti: {
|
archiveMulti: {
|
||||||
label: 'label.archive.events',
|
label: 'label.archive.events',
|
||||||
@ -232,7 +232,7 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var events = args.context.events;
|
var events = args.context.events;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("archiveEvents"),
|
url: createURL("archiveEvents"),
|
||||||
data: {
|
data: {
|
||||||
@ -247,7 +247,7 @@
|
|||||||
error:function(data) {
|
error:function(data) {
|
||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -494,7 +494,7 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var events = args.context.alerts;
|
var events = args.context.alerts;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("deleteAlerts"),
|
url: createURL("deleteAlerts"),
|
||||||
data: {
|
data: {
|
||||||
@ -509,10 +509,10 @@
|
|||||||
error:function(data) {
|
error:function(data) {
|
||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
remove: {
|
remove: {
|
||||||
label: 'label.delete.alerts',
|
label: 'label.delete.alerts',
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
@ -593,7 +593,7 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var events = args.context.alerts;
|
var events = args.context.alerts;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("archiveAlerts"),
|
url: createURL("archiveAlerts"),
|
||||||
data: {
|
data: {
|
||||||
@ -608,10 +608,10 @@
|
|||||||
error:function(data) {
|
error:function(data) {
|
||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
archive: {
|
archive: {
|
||||||
label: 'label.archive.alerts',
|
label: 'label.archive.alerts',
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
|
|||||||
@ -234,14 +234,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
baremetalRct: {
|
baremetalRct: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
title: 'label.baremetal.rack.configuration',
|
title: 'label.baremetal.rack.configuration',
|
||||||
listView: {
|
listView: {
|
||||||
id: 'baremetalRct',
|
id: 'baremetalRct',
|
||||||
label: 'label.baremetal.rack.configuration',
|
label: 'label.baremetal.rack.configuration',
|
||||||
fields: {
|
fields: {
|
||||||
id: {
|
id: {
|
||||||
label: 'label.id'
|
label: 'label.id'
|
||||||
},
|
},
|
||||||
@ -252,19 +252,19 @@
|
|||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var data = {};
|
var data = {};
|
||||||
listViewDataProvider(args, data);
|
listViewDataProvider(args, data);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listBaremetalRct"),
|
url: createURL("listBaremetalRct"),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct });
|
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
add: {
|
add: {
|
||||||
label: 'label.add.baremetal.rack.configuration',
|
label: 'label.add.baremetal.rack.configuration',
|
||||||
messages: {
|
messages: {
|
||||||
notification: function(args) {
|
notification: function(args) {
|
||||||
return 'label.add.baremetal.rack.configuration';
|
return 'label.add.baremetal.rack.configuration';
|
||||||
}
|
}
|
||||||
@ -280,18 +280,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("addBaremetalRct"),
|
url: createURL("addBaremetalRct"),
|
||||||
data: {
|
data: {
|
||||||
baremetalrcturl: args.data.url
|
baremetalrcturl: args.data.url
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.addbaremetalrctresponse.jobid
|
var jid = json.addbaremetalrctresponse.jobid
|
||||||
args.response.success({
|
args.response.success({
|
||||||
_custom: {
|
_custom: {
|
||||||
jobId: jid,
|
jobId: jid,
|
||||||
getUpdatedItem: function(json) {
|
getUpdatedItem: function(json) {
|
||||||
return json.queryasyncjobresultresponse.jobresult.baremetalrct;
|
return json.queryasyncjobresultresponse.jobresult.baremetalrct;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -303,8 +303,8 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
detailView: {
|
detailView: {
|
||||||
name: "details",
|
name: "details",
|
||||||
actions: {
|
actions: {
|
||||||
@ -318,7 +318,7 @@
|
|||||||
return 'label.delete.baremetal.rack.configuration';
|
return 'label.delete.baremetal.rack.configuration';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.baremetalRct[0].id
|
id: args.context.baremetalRct[0].id
|
||||||
};
|
};
|
||||||
@ -326,12 +326,12 @@
|
|||||||
url: createURL('deleteBaremetalRct'),
|
url: createURL('deleteBaremetalRct'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.deletebaremetalrctresponse.jobid;
|
var jid = json.deletebaremetalrctresponse.jobid;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
_custom: {
|
_custom: {
|
||||||
jobId: jid
|
jobId: jid
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -339,7 +339,7 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
tabs: {
|
tabs: {
|
||||||
details: {
|
details: {
|
||||||
title: 'label.details',
|
title: 'label.details',
|
||||||
@ -351,23 +351,23 @@
|
|||||||
label: 'label.url'
|
label: 'label.url'
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.baremetalRct[0].id
|
id: args.context.baremetalRct[0].id
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listBaremetalRct"),
|
url: createURL("listBaremetalRct"),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct[0] });
|
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct[0] });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
hypervisorCapabilities: {
|
hypervisorCapabilities: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
title: 'label.hypervisor.capabilities',
|
title: 'label.hypervisor.capabilities',
|
||||||
|
|||||||
@ -184,7 +184,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listTemplates&templatefilter=sharedexecutable&zoneid=" + args.currentData.zoneid),
|
url: createURL("listTemplates&templatefilter=sharedexecutable&zoneid=" + args.currentData.zoneid),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -199,7 +199,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (selectedTemplateOrIso == 'select-iso') {
|
} else if (selectedTemplateOrIso == 'select-iso') {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
||||||
@ -248,7 +248,7 @@
|
|||||||
sharedIsoObjs = json.listisosresponse.iso;
|
sharedIsoObjs = json.listisosresponse.iso;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//***** get templates/ISOs (end) *****
|
//***** get templates/ISOs (end) *****
|
||||||
|
|
||||||
@ -282,19 +282,19 @@
|
|||||||
////
|
////
|
||||||
return true; // Disabled -- not supported in backend right now
|
return true; // Disabled -- not supported in backend right now
|
||||||
////
|
////
|
||||||
|
|
||||||
if (selectedTemplateOrIso == 'select-template') {
|
if (selectedTemplateOrIso == 'select-template') {
|
||||||
return false; //show Root Disk Size field
|
return false; //show Root Disk Size field
|
||||||
} else { //selectedTemplateOrIso == 'select-iso'
|
} else { //selectedTemplateOrIso == 'select-iso'
|
||||||
return true; //hide Root Disk Size field
|
return true; //hide Root Disk Size field
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Step 3: Service offering
|
// Step 3: Service offering
|
||||||
function(args) {
|
function(args) {
|
||||||
selectedTemplateObj = null; //reset
|
selectedTemplateObj = null; //reset
|
||||||
if (args.currentData["select-template"] == "select-template") {
|
if (args.currentData["select-template"] == "select-template") {
|
||||||
if (featuredTemplateObjs != null && featuredTemplateObjs.length > 0) {
|
if (featuredTemplateObjs != null && featuredTemplateObjs.length > 0) {
|
||||||
for (var i = 0; i < featuredTemplateObjs.length; i++) {
|
for (var i = 0; i < featuredTemplateObjs.length; i++) {
|
||||||
@ -323,7 +323,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectedTemplateObj == null) {
|
if (selectedTemplateObj == null) {
|
||||||
if (sharedTemplateObjs != null && sharedTemplateObjs.length > 0) {
|
if (sharedTemplateObjs != null && sharedTemplateObjs.length > 0) {
|
||||||
for (var i = 0; i < sharedTemplateObjs.length; i++) {
|
for (var i = 0; i < sharedTemplateObjs.length; i++) {
|
||||||
@ -333,7 +333,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectedTemplateObj == null) {
|
if (selectedTemplateObj == null) {
|
||||||
alert("unable to find matched template object");
|
alert("unable to find matched template object");
|
||||||
} else {
|
} else {
|
||||||
@ -346,27 +346,27 @@
|
|||||||
// if the user is leveraging a template, then we can show custom IOPS, if applicable
|
// if the user is leveraging a template, then we can show custom IOPS, if applicable
|
||||||
var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false);
|
var canShowCustomIopsForServiceOffering = (args.currentData["select-template"] != "select-iso" ? true : false);
|
||||||
|
|
||||||
|
|
||||||
// get serviceOfferingObjs
|
// get serviceOfferingObjs
|
||||||
$(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
$(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||||
$(window).trigger("cloudStack.module.instanceWizard.serviceOffering.dataProvider", {
|
$(window).trigger("cloudStack.module.instanceWizard.serviceOffering.dataProvider", {
|
||||||
context: args.context,
|
context: args.context,
|
||||||
currentData: args.currentData
|
currentData: args.currentData
|
||||||
});
|
});
|
||||||
if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
|
if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listServiceOfferings&issystem=false"),
|
url: createURL("listServiceOfferings&issystem=false"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
canShowCustomIops: canShowCustomIopsForServiceOffering,
|
canShowCustomIops: canShowCustomIopsForServiceOffering,
|
||||||
customFlag: 'iscustomized',
|
customFlag: 'iscustomized',
|
||||||
@ -375,7 +375,7 @@
|
|||||||
data: {
|
data: {
|
||||||
serviceOfferings: serviceOfferingObjs
|
serviceOfferings: serviceOfferingObjs
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// Step 4: Data disk offering
|
// Step 4: Data disk offering
|
||||||
@ -409,9 +409,9 @@
|
|||||||
var data = {
|
var data = {
|
||||||
affinityGroups: affinitygroups
|
affinityGroups: affinitygroups
|
||||||
};
|
};
|
||||||
|
|
||||||
if(selectedZoneObj.domainid != null && selectedZoneObj.affinitygroupid != null) {
|
if(selectedZoneObj.domainid != null && selectedZoneObj.affinitygroupid != null) {
|
||||||
var defaultAffinityGroup;
|
var defaultAffinityGroup;
|
||||||
if(affinitygroups != null) {
|
if(affinitygroups != null) {
|
||||||
for(var i = 0; i < affinitygroups.length; i++) {
|
for(var i = 0; i < affinitygroups.length; i++) {
|
||||||
if(affinitygroups[i].id == selectedZoneObj.affinitygroupid) {
|
if(affinitygroups[i].id == selectedZoneObj.affinitygroupid) {
|
||||||
@ -419,13 +419,13 @@
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
selectedObj: defaultAffinityGroup,
|
selectedObj: defaultAffinityGroup,
|
||||||
selectedObjNonEditable: true
|
selectedObjNonEditable: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: data
|
data: data
|
||||||
});
|
});
|
||||||
@ -608,21 +608,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get networkObjsToPopulate
|
// get networkObjsToPopulate
|
||||||
$(window).removeData("cloudStack.module.instanceWizard.networkObjs");
|
$(window).removeData("cloudStack.module.instanceWizard.networkObjs");
|
||||||
$(window).trigger("cloudStack.module.instanceWizard.network.dataProvider", {
|
$(window).trigger("cloudStack.module.instanceWizard.network.dataProvider", {
|
||||||
context: args.context,
|
context: args.context,
|
||||||
currentData: args.currentData,
|
currentData: args.currentData,
|
||||||
networkObjsToPopulate: networkObjsToPopulate
|
networkObjsToPopulate: networkObjsToPopulate
|
||||||
});
|
});
|
||||||
if ($(window).data("cloudStack.module.instanceWizard.networkObjs") == undefined) {
|
if ($(window).data("cloudStack.module.instanceWizard.networkObjs") == undefined) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else {
|
} else {
|
||||||
networkObjsToPopulate = $(window).data("cloudStack.module.instanceWizard.networkObjs"); //override networkObjsToPopulate
|
networkObjsToPopulate = $(window).data("cloudStack.module.instanceWizard.networkObjs"); //override networkObjsToPopulate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listNetworkOfferings"),
|
url: createURL("listNetworkOfferings"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -729,49 +729,49 @@
|
|||||||
// Create a new VM!!!!
|
// Create a new VM!!!!
|
||||||
var deployVmData = {};
|
var deployVmData = {};
|
||||||
|
|
||||||
//step 1 : select zone
|
//step 1 : select zone
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
zoneid : args.data.zoneid
|
zoneid : args.data.zoneid
|
||||||
});
|
});
|
||||||
|
|
||||||
//step 2: select template
|
//step 2: select template
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
templateid : args.data.templateid
|
templateid : args.data.templateid
|
||||||
});
|
});
|
||||||
|
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
hypervisor : selectedHypervisor
|
hypervisor : selectedHypervisor
|
||||||
});
|
});
|
||||||
|
|
||||||
if (args.$wizard.find('input[name=rootDiskSize]').parent().css('display') != 'none') {
|
if (args.$wizard.find('input[name=rootDiskSize]').parent().css('display') != 'none') {
|
||||||
if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
|
if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
rootdisksize : args.$wizard.find('input[name=rootDiskSize]').val()
|
rootdisksize : args.$wizard.find('input[name=rootDiskSize]').val()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//step 3: select service offering
|
//step 3: select service offering
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
serviceofferingid : args.data.serviceofferingid
|
serviceofferingid : args.data.serviceofferingid
|
||||||
});
|
});
|
||||||
|
|
||||||
if (args.$wizard.find('input[name=compute-cpu-cores]').parent().parent().css('display') != 'none') {
|
if (args.$wizard.find('input[name=compute-cpu-cores]').parent().parent().css('display') != 'none') {
|
||||||
if (args.$wizard.find('input[name=compute-cpu-cores]').val().length > 0) {
|
if (args.$wizard.find('input[name=compute-cpu-cores]').val().length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
'details[0].cpuNumber' : args.$wizard.find('input[name=compute-cpu-cores]').val()
|
'details[0].cpuNumber' : args.$wizard.find('input[name=compute-cpu-cores]').val()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (args.$wizard.find('input[name=compute-cpu]').val().length > 0) {
|
if (args.$wizard.find('input[name=compute-cpu]').val().length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
'details[0].cpuSpeed' : args.$wizard.find('input[name=compute-cpu]').val()
|
'details[0].cpuSpeed' : args.$wizard.find('input[name=compute-cpu]').val()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (args.$wizard.find('input[name=compute-memory]').val().length > 0) {
|
if (args.$wizard.find('input[name=compute-memory]').val().length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
'details[0].memory' : args.$wizard.find('input[name=compute-memory]').val()
|
'details[0].memory' : args.$wizard.find('input[name=compute-memory]').val()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.$wizard.find('input[name=disk-min-iops]').parent().parent().css('display') != 'none') {
|
if (args.$wizard.find('input[name=disk-min-iops]').parent().parent().css('display') != 'none') {
|
||||||
@ -788,12 +788,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//step 4: select disk offering
|
//step 4: select disk offering
|
||||||
if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
|
if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
diskofferingid : args.data.diskofferingid
|
diskofferingid : args.data.diskofferingid
|
||||||
});
|
});
|
||||||
|
|
||||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
size : args.data.size
|
size : args.data.size
|
||||||
});
|
});
|
||||||
@ -825,7 +825,7 @@
|
|||||||
checkedAffinityGroupIdArray = [];
|
checkedAffinityGroupIdArray = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkedAffinityGroupIdArray.length > 0) {
|
if (checkedAffinityGroupIdArray.length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
affinitygroupids : checkedAffinityGroupIdArray.join(",")
|
affinitygroupids : checkedAffinityGroupIdArray.join(",")
|
||||||
});
|
});
|
||||||
@ -834,7 +834,7 @@
|
|||||||
//step 6: select network
|
//step 6: select network
|
||||||
if (step6ContainerType == 'select-network' || step6ContainerType == 'select-advanced-sg') {
|
if (step6ContainerType == 'select-network' || step6ContainerType == 'select-advanced-sg') {
|
||||||
var array2 = [];
|
var array2 = [];
|
||||||
var array3 = [];
|
var array3 = [];
|
||||||
var defaultNetworkId = args.data.defaultNetwork; //args.data.defaultNetwork might be equal to string "new-network" or a network ID
|
var defaultNetworkId = args.data.defaultNetwork; //args.data.defaultNetwork might be equal to string "new-network" or a network ID
|
||||||
|
|
||||||
var checkedNetworkIdArray;
|
var checkedNetworkIdArray;
|
||||||
@ -884,58 +884,58 @@
|
|||||||
if (defaultNetworkId == null) {
|
if (defaultNetworkId == null) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: "Please select a default network in Network step."
|
message: "Please select a default network in Network step."
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkedNetworkIdArray.length > 0) {
|
if (checkedNetworkIdArray.length > 0) {
|
||||||
for (var i = 0; i < checkedNetworkIdArray.length; i++) {
|
for (var i = 0; i < checkedNetworkIdArray.length; i++) {
|
||||||
if (checkedNetworkIdArray[i] == defaultNetworkId) {
|
if (checkedNetworkIdArray[i] == defaultNetworkId) {
|
||||||
array2.unshift(defaultNetworkId);
|
array2.unshift(defaultNetworkId);
|
||||||
|
|
||||||
var ipToNetwork = {
|
var ipToNetwork = {
|
||||||
networkid: defaultNetworkId
|
networkid: defaultNetworkId
|
||||||
};
|
};
|
||||||
if (args.data["new-network"] == "create-new-network") {
|
if (args.data["new-network"] == "create-new-network") {
|
||||||
if (args.data['new-network-ip'] != null && args.data['new-network-ip'].length > 0) {
|
if (args.data['new-network-ip'] != null && args.data['new-network-ip'].length > 0) {
|
||||||
$.extend(ipToNetwork, {
|
$.extend(ipToNetwork, {
|
||||||
ip: args.data['new-network-ip']
|
ip: args.data['new-network-ip']
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||||
$.extend(ipToNetwork, {
|
$.extend(ipToNetwork, {
|
||||||
ip: args.data["my-network-ips"][i]
|
ip: args.data["my-network-ips"][i]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
array3.unshift(ipToNetwork);
|
array3.unshift(ipToNetwork);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
array2.push(checkedNetworkIdArray[i]);
|
array2.push(checkedNetworkIdArray[i]);
|
||||||
|
|
||||||
var ipToNetwork = {
|
var ipToNetwork = {
|
||||||
networkid: checkedNetworkIdArray[i]
|
networkid: checkedNetworkIdArray[i]
|
||||||
};
|
};
|
||||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||||
$.extend(ipToNetwork, {
|
$.extend(ipToNetwork, {
|
||||||
ip: args.data["my-network-ips"][i]
|
ip: args.data["my-network-ips"][i]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
array3.push(ipToNetwork);
|
array3.push(ipToNetwork);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//deployVmData.push("&networkIds=" + array2.join(",")); //ipToNetworkMap can't be specified along with networkIds or ipAddress
|
//deployVmData.push("&networkIds=" + array2.join(",")); //ipToNetworkMap can't be specified along with networkIds or ipAddress
|
||||||
|
|
||||||
for (var k = 0; k < array3.length; k++) {
|
for (var k = 0; k < array3.length; k++) {
|
||||||
deployVmData["iptonetworklist[" + k + "].networkid"] = array3[k].networkid;
|
deployVmData["iptonetworklist[" + k + "].networkid"] = array3[k].networkid;
|
||||||
if (array3[k].ip != undefined && array3[k].ip.length > 0) {
|
if (array3[k].ip != undefined && array3[k].ip.length > 0) {
|
||||||
deployVmData["iptonetworklist[" + k + "].ip"] = array3[k].ip;
|
deployVmData["iptonetworklist[" + k + "].ip"] = array3[k].ip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (step6ContainerType == 'select-security-group') {
|
} else if (step6ContainerType == 'select-security-group') {
|
||||||
var checkedSecurityGroupIdArray;
|
var checkedSecurityGroupIdArray;
|
||||||
if (typeof(args.data["security-groups"]) == "object" && args.data["security-groups"].length != null) { //args.data["security-groups"] is an array of string, e.g. ["2375f8cc-8a73-4b8d-9b26-50885a25ffe0", "27c60d2a-de7f-4bb7-96e5-a602cec681df","c6301d77-99b5-4e8a-85e2-3ea2ab31c342"],
|
if (typeof(args.data["security-groups"]) == "object" && args.data["security-groups"].length != null) { //args.data["security-groups"] is an array of string, e.g. ["2375f8cc-8a73-4b8d-9b26-50885a25ffe0", "27c60d2a-de7f-4bb7-96e5-a602cec681df","c6301d77-99b5-4e8a-85e2-3ea2ab31c342"],
|
||||||
@ -947,7 +947,7 @@
|
|||||||
checkedSecurityGroupIdArray = [];
|
checkedSecurityGroupIdArray = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkedSecurityGroupIdArray.length > 0) {
|
if (checkedSecurityGroupIdArray.length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
securitygroupids : checkedSecurityGroupIdArray.join(",")
|
securitygroupids : checkedSecurityGroupIdArray.join(",")
|
||||||
});
|
});
|
||||||
@ -980,26 +980,26 @@
|
|||||||
array2.push(checkedNetworkIdArray[i]);
|
array2.push(checkedNetworkIdArray[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
networkids : array2.join(",")
|
networkids : array2.join(",")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else if (step6ContainerType == 'nothing-to-select') {
|
} else if (step6ContainerType == 'nothing-to-select') {
|
||||||
if ("vpc" in args.context) { //from VPC tier
|
if ("vpc" in args.context) { //from VPC tier
|
||||||
deployVmData["iptonetworklist[0].networkid"] = args.context.networks[0].id;
|
deployVmData["iptonetworklist[0].networkid"] = args.context.networks[0].id;
|
||||||
if (args.data["vpc-specify-ip"] != undefined && args.data["vpc-specify-ip"].length > 0) {
|
if (args.data["vpc-specify-ip"] != undefined && args.data["vpc-specify-ip"].length > 0) {
|
||||||
deployVmData["iptonetworklist[0].ip"] = args.data["vpc-specify-ip"];
|
deployVmData["iptonetworklist[0].ip"] = args.data["vpc-specify-ip"];
|
||||||
}
|
}
|
||||||
|
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
domainid : args.context.vpc[0].domainid
|
domainid : args.context.vpc[0].domainid
|
||||||
});
|
});
|
||||||
if (args.context.vpc[0].account != null) {
|
if (args.context.vpc[0].account != null) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
account : args.context.vpc[0].account
|
account : args.context.vpc[0].account
|
||||||
});
|
});
|
||||||
} else if (args.context.vpc[0].projectid != null) {
|
} else if (args.context.vpc[0].projectid != null) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
projectid : args.context.vpc[0].projectid
|
projectid : args.context.vpc[0].projectid
|
||||||
});
|
});
|
||||||
@ -1015,28 +1015,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var displayname = args.data.displayname;
|
var displayname = args.data.displayname;
|
||||||
if (displayname != null && displayname.length > 0) {
|
if (displayname != null && displayname.length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
displayname : displayname
|
displayname : displayname
|
||||||
});
|
});
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
name : displayname
|
name : displayname
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var group = args.data.groupname;
|
var group = args.data.groupname;
|
||||||
if (group != null && group.length > 0) {
|
if (group != null && group.length > 0) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
group : group
|
group : group
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var keyboard = args.data.keyboardLanguage;
|
var keyboard = args.data.keyboardLanguage;
|
||||||
if (keyboard != null && keyboard.length > 0) { //when blank option (default option) is selected => args.data.keyboardLanguage == ""
|
if (keyboard != null && keyboard.length > 0) { //when blank option (default option) is selected => args.data.keyboardLanguage == ""
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
keyboard : keyboard
|
keyboard : keyboard
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_hostid != null) {
|
if (g_hostid != null) {
|
||||||
$.extend(deployVmData, {
|
$.extend(deployVmData, {
|
||||||
@ -1050,7 +1050,7 @@
|
|||||||
userdata : todb(btoa(userdata))
|
userdata : todb(btoa(userdata))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).trigger('cloudStack.deployVirtualMachine', {
|
$(window).trigger('cloudStack.deployVirtualMachine', {
|
||||||
deployVmData: deployVmData,
|
deployVmData: deployVmData,
|
||||||
formData: args.data
|
formData: args.data
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
args.form.fields.quiescevm.isChecked = true;
|
args.form.fields.quiescevm.isChecked = true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -69,7 +69,7 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var instances = args.context.instances;
|
var instances = args.context.instances;
|
||||||
|
|
||||||
$(instances).map(function(index, instance) {
|
$(instances).map(function(index, instance) {
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
array1.push("&snapshotmemory=" + (args.data.snapshotMemory == "on"));
|
array1.push("&snapshotmemory=" + (args.data.snapshotMemory == "on"));
|
||||||
@ -103,7 +103,7 @@
|
|||||||
error: function(json) {
|
error: function(json) {
|
||||||
args.response.error(parseXMLHttpResponse(json));
|
args.response.error(parseXMLHttpResponse(json));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -118,10 +118,10 @@
|
|||||||
isMultiSelectAction: true
|
isMultiSelectAction: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
};
|
};
|
||||||
|
|
||||||
cloudStack.sections.instances = {
|
cloudStack.sections.instances = {
|
||||||
title: 'label.instances',
|
title: 'label.instances',
|
||||||
id: 'instances',
|
id: 'instances',
|
||||||
@ -616,7 +616,7 @@
|
|||||||
label: 'label.action.destroy.instance',
|
label: 'label.action.destroy.instance',
|
||||||
compactLabel: 'label.destroy',
|
compactLabel: 'label.destroy',
|
||||||
createForm: {
|
createForm: {
|
||||||
title: 'label.action.destroy.instance',
|
title: 'label.action.destroy.instance',
|
||||||
desc: 'label.action.destroy.instance',
|
desc: 'label.action.destroy.instance',
|
||||||
isWarning: true,
|
isWarning: true,
|
||||||
preFilter: function(args) {
|
preFilter: function(args) {
|
||||||
@ -633,31 +633,31 @@
|
|||||||
isChecked: false
|
isChecked: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
notification: function(args) {
|
notification: function(args) {
|
||||||
return 'label.action.destroy.instance';
|
return 'label.action.destroy.instance';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.instances[0].id
|
id: args.context.instances[0].id
|
||||||
};
|
};
|
||||||
if (args.data.expunge == 'on') {
|
if (args.data.expunge == 'on') {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
expunge: true
|
expunge: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('destroyVirtualMachine'),
|
url: createURL('destroyVirtualMachine'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.destroyvirtualmachineresponse.jobid;
|
var jid = json.destroyvirtualmachineresponse.jobid;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
_custom: {
|
_custom: {
|
||||||
jobId: jid,
|
jobId: jid,
|
||||||
getUpdatedItem: function(json) {
|
getUpdatedItem: function(json) {
|
||||||
if ('virtualmachine' in json.queryasyncjobresultresponse.jobresult) //destroy without expunge
|
if ('virtualmachine' in json.queryasyncjobresultresponse.jobresult) //destroy without expunge
|
||||||
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
||||||
else //destroy with expunge
|
else //destroy with expunge
|
||||||
return { 'toRemove': true };
|
return { 'toRemove': true };
|
||||||
@ -765,19 +765,19 @@
|
|||||||
url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
|
url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.restorevmresponse.jobid;
|
var jid = json.restorevmresponse.jobid;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
_custom: {
|
_custom: {
|
||||||
jobId: jid,
|
jobId: jid,
|
||||||
getUpdatedItem: function(json) {
|
getUpdatedItem: function(json) {
|
||||||
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
||||||
},
|
},
|
||||||
getActionFilter: function() {
|
getActionFilter: function() {
|
||||||
return vmActionfilter;
|
return vmActionfilter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -951,11 +951,11 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//***** addResourceDetail *****
|
//***** addResourceDetail *****
|
||||||
//XenServer only (starts here)
|
//XenServer only (starts here)
|
||||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('addResourceDetail'),
|
url: createURL('addResourceDetail'),
|
||||||
data: {
|
data: {
|
||||||
@ -964,7 +964,7 @@
|
|||||||
'details[0].key': 'hypervisortoolsversion',
|
'details[0].key': 'hypervisortoolsversion',
|
||||||
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jobId = json.addResourceDetailresponse.jobid;
|
var jobId = json.addResourceDetailresponse.jobid;
|
||||||
var addResourceDetailIntervalID = setInterval(function() {
|
var addResourceDetailIntervalID = setInterval(function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -972,33 +972,33 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var result = json.queryasyncjobresultresponse;
|
var result = json.queryasyncjobresultresponse;
|
||||||
|
|
||||||
if (result.jobstatus == 0) {
|
if (result.jobstatus == 0) {
|
||||||
return; //Job has not completed
|
return; //Job has not completed
|
||||||
} else {
|
} else {
|
||||||
clearInterval(addResourceDetailIntervalID);
|
clearInterval(addResourceDetailIntervalID);
|
||||||
|
|
||||||
if (result.jobstatus == 1) {
|
if (result.jobstatus == 1) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else if (result.jobstatus == 2) {
|
} else if (result.jobstatus == 2) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: _s(result.jobresult.errortext)
|
message: _s(result.jobresult.errortext)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: parseXMLHttpResponse(XMLHttpResponse)
|
message: parseXMLHttpResponse(XMLHttpResponse)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, g_queryAsyncJobResultInterval);
|
}, g_queryAsyncJobResultInterval);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//XenServer only (ends here)
|
//XenServer only (ends here)
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1233,17 +1233,17 @@
|
|||||||
},
|
},
|
||||||
osTypeId: {
|
osTypeId: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
if (ostypeObjs == undefined) {
|
if (ostypeObjs == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var items = [];
|
var items = [];
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
@ -1253,7 +1253,7 @@
|
|||||||
});
|
});
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isPublic: {
|
isPublic: {
|
||||||
@ -1493,12 +1493,12 @@
|
|||||||
createForm: {
|
createForm: {
|
||||||
title: 'label.change.service.offering',
|
title: 'label.change.service.offering',
|
||||||
desc: function(args) {
|
desc: function(args) {
|
||||||
var description = '';
|
var description = '';
|
||||||
var vmObj = args.jsonObj;
|
var vmObj = args.jsonObj;
|
||||||
if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') {
|
if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') {
|
||||||
description = 'message.read.admin.guide.scaling.up';
|
description = 'message.read.admin.guide.scaling.up';
|
||||||
}
|
}
|
||||||
return description;
|
return description;
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
serviceofferingid: {
|
serviceofferingid: {
|
||||||
@ -1511,7 +1511,7 @@
|
|||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
serviceofferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
serviceofferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||||
var items = [];
|
var items = [];
|
||||||
if (serviceofferingObjs != null) {
|
if (serviceofferingObjs != null) {
|
||||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||||
items.push({
|
items.push({
|
||||||
@ -1519,33 +1519,33 @@
|
|||||||
description: serviceofferingObjs[i].name
|
description: serviceofferingObjs[i].name
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
args.$select.change(function(){
|
args.$select.change(function(){
|
||||||
var $form = $(this).closest('form');
|
var $form = $(this).closest('form');
|
||||||
|
|
||||||
var serviceofferingid = $(this).val();
|
var serviceofferingid = $(this).val();
|
||||||
if (serviceofferingid == null || serviceofferingid.length == 0)
|
if (serviceofferingid == null || serviceofferingid.length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
var selectedServiceofferingObj;
|
var selectedServiceofferingObj;
|
||||||
if (serviceofferingObjs != null) {
|
if (serviceofferingObjs != null) {
|
||||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||||
if (serviceofferingObjs[i].id == serviceofferingid) {
|
if (serviceofferingObjs[i].id == serviceofferingid) {
|
||||||
selectedServiceofferingObj = serviceofferingObjs[i];
|
selectedServiceofferingObj = serviceofferingObjs[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (selectedServiceofferingObj == undefined)
|
if (selectedServiceofferingObj == undefined)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (selectedServiceofferingObj.iscustomized == true) {
|
if (selectedServiceofferingObj.iscustomized == true) {
|
||||||
$form.find('.form-item[rel=cpuSpeed]').css('display', 'inline-block');
|
$form.find('.form-item[rel=cpuSpeed]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=cpuNumber]').css('display', 'inline-block');
|
$form.find('.form-item[rel=cpuNumber]').css('display', 'inline-block');
|
||||||
@ -1557,9 +1557,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
cpuSpeed: {
|
cpuSpeed: {
|
||||||
label: 'label.cpu.mhz',
|
label: 'label.cpu.mhz',
|
||||||
validation: {
|
validation: {
|
||||||
required: true,
|
required: true,
|
||||||
number: true
|
number: true
|
||||||
@ -1567,7 +1567,7 @@
|
|||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
cpuNumber: {
|
cpuNumber: {
|
||||||
label: 'label.num.cpu.cores',
|
label: 'label.num.cpu.cores',
|
||||||
validation: {
|
validation: {
|
||||||
required: true,
|
required: true,
|
||||||
number: true
|
number: true
|
||||||
@ -1575,13 +1575,13 @@
|
|||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
memory: {
|
memory: {
|
||||||
label: 'label.memory.mb',
|
label: 'label.memory.mb',
|
||||||
validation: {
|
validation: {
|
||||||
required: true,
|
required: true,
|
||||||
number: true
|
number: true
|
||||||
},
|
},
|
||||||
isHidden: true
|
isHidden: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1589,24 +1589,24 @@
|
|||||||
var data = {
|
var data = {
|
||||||
id: args.context.instances[0].id,
|
id: args.context.instances[0].id,
|
||||||
serviceofferingid: args.data.serviceofferingid
|
serviceofferingid: args.data.serviceofferingid
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.$form.find('.form-item[rel=cpuSpeed]').is(':visible')) {
|
if (args.$form.find('.form-item[rel=cpuSpeed]').is(':visible')) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
'details[0].cpuSpeed': args.data.cpuSpeed
|
'details[0].cpuSpeed': args.data.cpuSpeed
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (args.$form.find('.form-item[rel=cpuNumber]').is(':visible')) {
|
if (args.$form.find('.form-item[rel=cpuNumber]').is(':visible')) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
'details[0].cpuNumber': args.data.cpuNumber
|
'details[0].cpuNumber': args.data.cpuNumber
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (args.$form.find('.form-item[rel=memory]').is(':visible')) {
|
if (args.$form.find('.form-item[rel=memory]').is(':visible')) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
'details[0].memory': args.data.memory
|
'details[0].memory': args.data.memory
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('scaleVirtualMachine'),
|
url: createURL('scaleVirtualMachine'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -1640,7 +1640,7 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
resetSSHKeyForVirtualMachine: {
|
resetSSHKeyForVirtualMachine: {
|
||||||
label: 'Reset SSH Key Pair',
|
label: 'Reset SSH Key Pair',
|
||||||
createForm: {
|
createForm: {
|
||||||
@ -1732,18 +1732,18 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
assignVmToAnotherAccount: {
|
assignVmToAnotherAccount: {
|
||||||
label: 'label.assign.instance.another',
|
label: 'label.assign.instance.another',
|
||||||
createForm: {
|
createForm: {
|
||||||
title: 'label.assign.instance.another',
|
title: 'label.assign.instance.another',
|
||||||
fields: {
|
fields: {
|
||||||
domainid: {
|
domainid: {
|
||||||
label: 'label.domain',
|
label: 'label.domain',
|
||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listDomains'),
|
url: createURL('listDomains'),
|
||||||
data: {
|
data: {
|
||||||
@ -1768,7 +1768,7 @@
|
|||||||
data: array1
|
data: array1
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
account: {
|
account: {
|
||||||
@ -1776,22 +1776,22 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('assignVirtualMachine'),
|
url: createURL('assignVirtualMachine'),
|
||||||
data: {
|
data: {
|
||||||
virtualmachineid: args.context.instances[0].id,
|
virtualmachineid: args.context.instances[0].id,
|
||||||
domainid: args.data.domainid,
|
domainid: args.data.domainid,
|
||||||
account: args.data.account
|
account: args.data.account
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var item = json.assignvirtualmachineresponse.virtualmachine;
|
var item = json.assignvirtualmachineresponse.virtualmachine;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: item
|
data: item
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -1805,8 +1805,8 @@
|
|||||||
args.complete();
|
args.complete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
viewConsole: {
|
viewConsole: {
|
||||||
label: 'label.view.console',
|
label: 'label.view.console',
|
||||||
action: {
|
action: {
|
||||||
@ -1835,36 +1835,36 @@
|
|||||||
} else {
|
} else {
|
||||||
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('instances' in args.context && args.context.instances[0].hypervisor != 'XenServer') {
|
if ('instances' in args.context && args.context.instances[0].hypervisor != 'XenServer') {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('instances' in args.context && args.context.instances[0].guestosid != undefined) {
|
if ('instances' in args.context && args.context.instances[0].guestosid != undefined) {
|
||||||
if (ostypeObjs == undefined) {
|
if (ostypeObjs == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (ostypeObjs != undefined) {
|
if (ostypeObjs != undefined) {
|
||||||
var ostypeName;
|
var ostypeName;
|
||||||
for (var i = 0; i < ostypeObjs.length; i++) {
|
for (var i = 0; i < ostypeObjs.length; i++) {
|
||||||
if (ostypeObjs[i].id == args.context.instances[0].guestosid) {
|
if (ostypeObjs[i].id == args.context.instances[0].guestosid) {
|
||||||
ostypeName = ostypeObjs[i].description;
|
ostypeName = ostypeObjs[i].description;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!args.context.instances[0].publicip) {
|
if (!args.context.instances[0].publicip) {
|
||||||
hiddenFields.push('publicip');
|
hiddenFields.push('publicip');
|
||||||
}
|
}
|
||||||
@ -1920,17 +1920,17 @@
|
|||||||
guestosid: {
|
guestosid: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
if (ostypeObjs == undefined) {
|
if (ostypeObjs == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
var items = [];
|
var items = [];
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
@ -1959,7 +1959,7 @@
|
|||||||
},
|
},
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
/*
|
||||||
isoid: {
|
isoid: {
|
||||||
label: 'label.attached.iso',
|
label: 'label.attached.iso',
|
||||||
@ -2045,7 +2045,7 @@
|
|||||||
var jsonObj;
|
var jsonObj;
|
||||||
if (json.listvirtualmachinesresponse.virtualmachine != null && json.listvirtualmachinesresponse.virtualmachine.length > 0)
|
if (json.listvirtualmachinesresponse.virtualmachine != null && json.listvirtualmachinesresponse.virtualmachine.length > 0)
|
||||||
jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||||
else if (isAdmin())
|
else if (isAdmin())
|
||||||
jsonObj = $.extend(args.context.instances[0], {
|
jsonObj = $.extend(args.context.instances[0], {
|
||||||
state: "Expunged"
|
state: "Expunged"
|
||||||
}); //after root/domain admin expunge a VM, listVirtualMachines API will no longer returns this expunged VM to all users.
|
}); //after root/domain admin expunge a VM, listVirtualMachines API will no longer returns this expunged VM to all users.
|
||||||
@ -2060,12 +2060,12 @@
|
|||||||
else
|
else
|
||||||
jsonObj.xenserverToolsVersion61plus = false;
|
jsonObj.xenserverToolsVersion61plus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
||||||
obj: jsonObj,
|
obj: jsonObj,
|
||||||
objType: "UserVM"
|
objType: "UserVM"
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: vmActionfilter,
|
actionFilter: vmActionfilter,
|
||||||
data: jsonObj
|
data: jsonObj
|
||||||
@ -2100,7 +2100,7 @@
|
|||||||
label: 'label.network',
|
label: 'label.network',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
var data1 = {
|
var data1 = {
|
||||||
zoneid: args.context.instances[0].zoneid
|
zoneid: args.context.instances[0].zoneid
|
||||||
};
|
};
|
||||||
if (isAdmin()) {
|
if (isAdmin()) {
|
||||||
$.extend(data1, {
|
$.extend(data1, {
|
||||||
@ -2111,7 +2111,7 @@
|
|||||||
account: args.context.instances[0].account,
|
account: args.context.instances[0].account,
|
||||||
domainid: args.context.instances[0].domainid
|
domainid: args.context.instances[0].domainid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworks'),
|
url: createURL('listNetworks'),
|
||||||
data: data1,
|
data: data1,
|
||||||
@ -2322,7 +2322,7 @@
|
|||||||
secondaryips: secondaryips
|
secondaryips: secondaryips
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = 'NIC ' + (index + 1);
|
var name = 'NIC ' + (index + 1);
|
||||||
if (nic.isdefault) {
|
if (nic.isdefault) {
|
||||||
name += ' (' + _l('label.default') + ')';
|
name += ' (' + _l('label.default') + ')';
|
||||||
@ -2442,19 +2442,19 @@
|
|||||||
} else if (jsonObj.state == 'Running') {
|
} else if (jsonObj.state == 'Running') {
|
||||||
allowedActions.push("stop");
|
allowedActions.push("stop");
|
||||||
allowedActions.push("restart");
|
allowedActions.push("restart");
|
||||||
|
|
||||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||||
&& (jsonObj.hypervisor != 'LXC')) {
|
&& (jsonObj.hypervisor != 'LXC')) {
|
||||||
allowedActions.push("snapshot");
|
allowedActions.push("snapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
allowedActions.push("destroy");
|
allowedActions.push("destroy");
|
||||||
allowedActions.push("reinstall");
|
allowedActions.push("reinstall");
|
||||||
|
|
||||||
//when userVm is running, scaleUp is not supported for KVM, LXC
|
//when userVm is running, scaleUp is not supported for KVM, LXC
|
||||||
if (jsonObj.hypervisor != 'KVM' && jsonObj.hypervisor != 'LXC') {
|
if (jsonObj.hypervisor != 'KVM' && jsonObj.hypervisor != 'LXC') {
|
||||||
allowedActions.push("scaleUp");
|
allowedActions.push("scaleUp");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAdmin())
|
if (isAdmin())
|
||||||
allowedActions.push("migrate");
|
allowedActions.push("migrate");
|
||||||
@ -2476,13 +2476,13 @@
|
|||||||
allowedActions.push("start");
|
allowedActions.push("start");
|
||||||
allowedActions.push("destroy");
|
allowedActions.push("destroy");
|
||||||
allowedActions.push("reinstall");
|
allowedActions.push("reinstall");
|
||||||
|
|
||||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||||
&& (jsonObj.hypervisor != 'LXC')) {
|
&& (jsonObj.hypervisor != 'LXC')) {
|
||||||
allowedActions.push("snapshot");
|
allowedActions.push("snapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
allowedActions.push("scaleUp"); //when vm is stopped, scaleUp is supported for all hypervisors
|
allowedActions.push("scaleUp"); //when vm is stopped, scaleUp is supported for all hypervisors
|
||||||
allowedActions.push("changeAffinity");
|
allowedActions.push("changeAffinity");
|
||||||
|
|
||||||
if (isAdmin())
|
if (isAdmin())
|
||||||
@ -2493,11 +2493,11 @@
|
|||||||
} else {
|
} else {
|
||||||
allowedActions.push("detachISO");
|
allowedActions.push("detachISO");
|
||||||
}
|
}
|
||||||
allowedActions.push("resetPassword");
|
allowedActions.push("resetPassword");
|
||||||
if (jsonObj.hypervisor == "BareMetal") {
|
if (jsonObj.hypervisor == "BareMetal") {
|
||||||
allowedActions.push("createTemplate");
|
allowedActions.push("createTemplate");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isAdmin() || isDomainAdmin()) {
|
if (isAdmin() || isDomainAdmin()) {
|
||||||
allowedActions.push("assignVmToAnotherAccount");
|
allowedActions.push("assignVmToAnotherAccount");
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -621,7 +621,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
// Project listing data provider
|
// Project listing data provider
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var user = args.context.users[0];
|
var user = args.context.users[0];
|
||||||
var data1 = {
|
var data1 = {
|
||||||
accountId: user.userid,
|
accountId: user.userid,
|
||||||
@ -632,20 +632,20 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
var page = 1;
|
var page = 1;
|
||||||
var getNextPage = function() {
|
var getNextPage = function() {
|
||||||
var data2 = $.extend({}, data1, {
|
var data2 = $.extend({}, data1, {
|
||||||
page: page,
|
page: page,
|
||||||
pageSize: 500
|
pageSize: 500
|
||||||
});
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listProjects', {
|
url: createURL('listProjects', {
|
||||||
ignoreProject: true
|
ignoreProject: true
|
||||||
}),
|
}),
|
||||||
data: data2,
|
data: data2,
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var projects = json.listprojectsresponse.project;
|
var projects = json.listprojectsresponse.project;
|
||||||
if (projects != undefined) {
|
if (projects != undefined) {
|
||||||
for(var i = 0; i < projects.length; i++) {
|
for(var i = 0; i < projects.length; i++) {
|
||||||
@ -653,16 +653,16 @@
|
|||||||
displayText: projects[i].displaytext
|
displayText: projects[i].displaytext
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (array1.length < json.listprojectsresponse.count) {
|
if (array1.length < json.listprojectsresponse.count) {
|
||||||
page++;
|
page++;
|
||||||
getNextPage();
|
getNextPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
getNextPage();
|
getNextPage();
|
||||||
args.response.success({ data: array1 });
|
args.response.success({ data: array1 });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -481,32 +481,32 @@
|
|||||||
path: 'regions.lbUnderGSLB',
|
path: 'regions.lbUnderGSLB',
|
||||||
label: 'label.gslb.assigned.lb'
|
label: 'label.gslb.assigned.lb'
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
edit: {
|
edit: {
|
||||||
label: 'label.edit',
|
label: 'label.edit',
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.GSLB[0].id,
|
id: args.context.GSLB[0].id,
|
||||||
description: args.data.description,
|
description: args.data.description,
|
||||||
gslblbmethod: args.data.gslblbmethod
|
gslblbmethod: args.data.gslblbmethod
|
||||||
};
|
};
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('updateGlobalLoadBalancerRule'),
|
url: createURL('updateGlobalLoadBalancerRule'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.updategloballoadbalancerruleresponse.jobid;
|
var jid = json.updategloballoadbalancerruleresponse.jobid;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
_custom: {
|
_custom: {
|
||||||
jobId: jid
|
jobId: jid
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
notification: {
|
notification: {
|
||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
remove: {
|
remove: {
|
||||||
label: 'label.gslb.delete',
|
label: 'label.gslb.delete',
|
||||||
messages: {
|
messages: {
|
||||||
|
|||||||
@ -268,7 +268,7 @@ var addGuestNetworkDialog = {
|
|||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if (items[i].networktype == 'Advanced') {
|
if (items[i].networktype == 'Advanced') {
|
||||||
addGuestNetworkDialog.zoneObjs.push(items[i]);
|
addGuestNetworkDialog.zoneObjs.push(items[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -294,7 +294,7 @@ var addGuestNetworkDialog = {
|
|||||||
if ('physicalNetworks' in args.context) { //Infrastructure menu > zone detail > guest traffic type > network tab (only shown in advanced zone) > add guest network dialog
|
if ('physicalNetworks' in args.context) { //Infrastructure menu > zone detail > guest traffic type > network tab (only shown in advanced zone) > add guest network dialog
|
||||||
addGuestNetworkDialog.physicalNetworkObjs = args.context.physicalNetworks;
|
addGuestNetworkDialog.physicalNetworkObjs = args.context.physicalNetworks;
|
||||||
} else { //Network menu > guest network section > add guest network dialog
|
} else { //Network menu > guest network section > add guest network dialog
|
||||||
var selectedZoneId = args.$form.find('.form-item[rel=zoneId]').find('select').val();
|
var selectedZoneId = args.$form.find('.form-item[rel=zoneId]').find('select').val();
|
||||||
if (selectedZoneId != undefined && selectedZoneId.length > 0) {
|
if (selectedZoneId != undefined && selectedZoneId.length > 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listPhysicalNetworks'),
|
url: createURL('listPhysicalNetworks'),
|
||||||
@ -302,7 +302,7 @@ var addGuestNetworkDialog = {
|
|||||||
zoneid: selectedZoneId
|
zoneid: selectedZoneId
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var items = [];
|
var items = [];
|
||||||
var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
|
var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
|
||||||
if (physicalnetworks != null) {
|
if (physicalnetworks != null) {
|
||||||
@ -313,7 +313,7 @@ var addGuestNetworkDialog = {
|
|||||||
physicalnetworkid: physicalnetworks[i].id
|
physicalnetworkid: physicalnetworks[i].id
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var traffictypes = json.listtraffictypesresponse.traffictype;
|
var traffictypes = json.listtraffictypesresponse.traffictype;
|
||||||
if (traffictypes != null) {
|
if (traffictypes != null) {
|
||||||
for (var k = 0; k < traffictypes.length; k++) {
|
for (var k = 0; k < traffictypes.length; k++) {
|
||||||
@ -322,13 +322,13 @@ var addGuestNetworkDialog = {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addGuestNetworkDialog.physicalNetworkObjs = items;
|
addGuestNetworkDialog.physicalNetworkObjs = items;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -536,14 +536,14 @@ var addGuestNetworkDialog = {
|
|||||||
label: 'label.network.offering',
|
label: 'label.network.offering',
|
||||||
docID: 'helpGuestNetworkZoneNetworkOffering',
|
docID: 'helpGuestNetworkZoneNetworkOffering',
|
||||||
dependsOn: ['zoneId', 'physicalNetworkId', 'scope'],
|
dependsOn: ['zoneId', 'physicalNetworkId', 'scope'],
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
if(args.$form.find('.form-item[rel=zoneId]').find('select').val() == null || args.$form.find('.form-item[rel=zoneId]').find('select').val().length == 0) {
|
if(args.$form.find('.form-item[rel=zoneId]').find('select').val() == null || args.$form.find('.form-item[rel=zoneId]').find('select').val().length == 0) {
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: null
|
data: null
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
state: 'Enabled',
|
state: 'Enabled',
|
||||||
zoneid: args.$form.find('.form-item[rel=zoneId]').find('select').val()
|
zoneid: args.$form.find('.form-item[rel=zoneId]').find('select').val()
|
||||||
@ -977,7 +977,7 @@ cloudStack.converters = {
|
|||||||
convertBytes: function(bytes) {
|
convertBytes: function(bytes) {
|
||||||
if (bytes == undefined)
|
if (bytes == undefined)
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
if (bytes < 1024 * 1024) {
|
if (bytes < 1024 * 1024) {
|
||||||
return (bytes / 1024).toFixed(2) + " KB";
|
return (bytes / 1024).toFixed(2) + " KB";
|
||||||
} else if (bytes < 1024 * 1024 * 1024) {
|
} else if (bytes < 1024 * 1024 * 1024) {
|
||||||
@ -1030,20 +1030,20 @@ cloudStack.converters = {
|
|||||||
|
|
||||||
if (g_timezoneoffset != null) {
|
if (g_timezoneoffset != null) {
|
||||||
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
||||||
} else {
|
} else {
|
||||||
var browserDate = new Date();
|
var browserDate = new Date();
|
||||||
var browserTimezoneoffset = browserDate.getTimezoneOffset();
|
var browserTimezoneoffset = browserDate.getTimezoneOffset();
|
||||||
if (browserTimezoneoffset == undefined || isNaN(browserTimezoneoffset) ) {
|
if (browserTimezoneoffset == undefined || isNaN(browserTimezoneoffset) ) {
|
||||||
localDate = disconnected.toUTCString();
|
localDate = disconnected.toUTCString();
|
||||||
} else {
|
} else {
|
||||||
g_timezoneoffset = (browserTimezoneoffset/60) * (-1);
|
g_timezoneoffset = (browserTimezoneoffset/60) * (-1);
|
||||||
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return localDate;
|
return localDate;
|
||||||
},
|
},
|
||||||
toBooleanText: function(booleanValue) {
|
toBooleanText: function(booleanValue) {
|
||||||
var text1;
|
var text1;
|
||||||
if (booleanValue == true) {
|
if (booleanValue == true) {
|
||||||
text1 = "Yes";
|
text1 = "Yes";
|
||||||
@ -1052,7 +1052,7 @@ cloudStack.converters = {
|
|||||||
} else { //booleanValue == undefined
|
} else { //booleanValue == undefined
|
||||||
text1 = "";
|
text1 = "";
|
||||||
}
|
}
|
||||||
return text1;
|
return text1;
|
||||||
},
|
},
|
||||||
convertHz: function(hz) {
|
convertHz: function(hz) {
|
||||||
if (hz == null)
|
if (hz == null)
|
||||||
@ -1239,13 +1239,13 @@ cloudStack.converters = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function isModuleIncluded(moduleName) {
|
function isModuleIncluded(moduleName) {
|
||||||
for(var moduleIndex = 0; moduleIndex < cloudStack.modules.length; moduleIndex++) {
|
for(var moduleIndex = 0; moduleIndex < cloudStack.modules.length; moduleIndex++) {
|
||||||
if (cloudStack.modules[moduleIndex] == moduleName) {
|
if (cloudStack.modules[moduleIndex] == moduleName) {
|
||||||
return true;
|
return true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1313,7 +1313,7 @@ var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
|
|||||||
jsonObj.vlan = jsonObj.broadcasturi.replace("vlan://", "");
|
jsonObj.vlan = jsonObj.broadcasturi.replace("vlan://", "");
|
||||||
}
|
}
|
||||||
if(jsonObj.vxlan == null && jsonObj.broadcasturi != null && jsonObj.broadcasturi.substring(0,8) == "vxlan://") {
|
if(jsonObj.vxlan == null && jsonObj.broadcasturi != null && jsonObj.broadcasturi.substring(0,8) == "vxlan://") {
|
||||||
jsonObj.vxlan = jsonObj.broadcasturi.replace("vxlan://", "");
|
jsonObj.vxlan = jsonObj.broadcasturi.replace("vxlan://", "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1324,7 +1324,7 @@ var addExtraPropertiesToUcsBladeObject = function(jsonObj) {
|
|||||||
jsonObj.bladeid = array1[2];
|
jsonObj.bladeid = array1[2];
|
||||||
}
|
}
|
||||||
|
|
||||||
var processPropertiesInImagestoreObject = function(jsonObj) {
|
var processPropertiesInImagestoreObject = function(jsonObj) {
|
||||||
if (jsonObj.url != undefined) {
|
if (jsonObj.url != undefined) {
|
||||||
var url = jsonObj.url; //e.g. 'cifs://10.1.1.1/aaa/aaa2/aaa3?user=bbb&password=ccc&domain=ddd'
|
var url = jsonObj.url; //e.g. 'cifs://10.1.1.1/aaa/aaa2/aaa3?user=bbb&password=ccc&domain=ddd'
|
||||||
var passwordIndex = url.indexOf('&password='); //38
|
var passwordIndex = url.indexOf('&password='); //38
|
||||||
@ -1332,7 +1332,7 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||||||
if (passwordIndex >= 0) {
|
if (passwordIndex >= 0) {
|
||||||
jsonObj.url = url.substring(0, passwordIndex) + url.substring(domainIndex); //remove '&password=ccc' from jsonObj.url
|
jsonObj.url = url.substring(0, passwordIndex) + url.substring(domainIndex); //remove '&password=ccc' from jsonObj.url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//find service object in network object
|
//find service object in network object
|
||||||
@ -1390,12 +1390,12 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||||||
if (server.indexOf('://') == -1) {
|
if (server.indexOf('://') == -1) {
|
||||||
url += 'cifs://';
|
url += 'cifs://';
|
||||||
}
|
}
|
||||||
|
|
||||||
url += (server + path);
|
url += (server + path);
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
||||||
function presetupURL(server, path) {
|
function presetupURL(server, path) {
|
||||||
var url;
|
var url;
|
||||||
if (server.indexOf("://") == -1)
|
if (server.indexOf("://") == -1)
|
||||||
@ -1499,11 +1499,11 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||||||
}
|
}
|
||||||
return vmName;
|
return vmName;
|
||||||
}
|
}
|
||||||
|
|
||||||
var timezoneMap = new Object();
|
var timezoneMap = new Object();
|
||||||
timezoneMap["Etc/GMT+12"] = "Etc/GMT+12 [GMT-12:00]";
|
timezoneMap["Etc/GMT+12"] = "Etc/GMT+12 [GMT-12:00]";
|
||||||
timezoneMap["Etc/GMT+11"] = "Etc/GMT+11 [GMT-11:00]";
|
timezoneMap["Etc/GMT+11"] = "Etc/GMT+11 [GMT-11:00]";
|
||||||
timezoneMap["Pacific/Midway"] = "Pacific/Midway [Samoa Standard Time]";
|
timezoneMap["Pacific/Midway"] = "Pacific/Midway [Samoa Standard Time]";
|
||||||
timezoneMap["Pacific/Niue"] = "Pacific/Niue [Niue Time]";
|
timezoneMap["Pacific/Niue"] = "Pacific/Niue [Niue Time]";
|
||||||
timezoneMap["Pacific/Pago_Pago"] = "Pacific/Pago_Pago [Samoa Standard Time]";
|
timezoneMap["Pacific/Pago_Pago"] = "Pacific/Pago_Pago [Samoa Standard Time]";
|
||||||
timezoneMap["Pacific/Samoa"] = "Pacific/Samoa [Samoa Standard Time]";
|
timezoneMap["Pacific/Samoa"] = "Pacific/Samoa [Samoa Standard Time]";
|
||||||
@ -2256,7 +2256,7 @@ cloudStack.api = {
|
|||||||
args.response.error(parseXMLHttpResponse(json));
|
args.response.error(parseXMLHttpResponse(json));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -330,7 +330,7 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
diskOffering: {
|
diskOffering: {
|
||||||
label: 'Custom Disk Offering',
|
label: 'Custom Disk Offering',
|
||||||
docID: 'helpVolumeDiskOffering',
|
docID: 'helpVolumeDiskOffering',
|
||||||
@ -347,7 +347,7 @@
|
|||||||
description: ''
|
description: ''
|
||||||
}];
|
}];
|
||||||
$(diskofferingObjs).each(function() {
|
$(diskofferingObjs).each(function() {
|
||||||
if (this.iscustomized == true) {
|
if (this.iscustomized == true) {
|
||||||
items.push({
|
items.push({
|
||||||
id: this.id,
|
id: this.id,
|
||||||
description: this.displaytext
|
description: this.displaytext
|
||||||
@ -360,7 +360,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
diskOffering: {
|
diskOffering: {
|
||||||
label: 'Custom Disk Offering',
|
label: 'Custom Disk Offering',
|
||||||
docID: 'helpVolumeDiskOffering',
|
docID: 'helpVolumeDiskOffering',
|
||||||
@ -377,7 +377,7 @@
|
|||||||
description: ''
|
description: ''
|
||||||
}];
|
}];
|
||||||
$(diskofferingObjs).each(function() {
|
$(diskofferingObjs).each(function() {
|
||||||
if (this.iscustomized == true) {
|
if (this.iscustomized == true) {
|
||||||
items.push({
|
items.push({
|
||||||
id: this.id,
|
id: this.id,
|
||||||
description: this.displaytext
|
description: this.displaytext
|
||||||
@ -390,7 +390,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
checksum: {
|
checksum: {
|
||||||
docID: 'helpUploadVolumeChecksum',
|
docID: 'helpUploadVolumeChecksum',
|
||||||
label: 'label.md5.checksum'
|
label: 'label.md5.checksum'
|
||||||
@ -406,12 +406,12 @@
|
|||||||
url: args.data.url
|
url: args.data.url
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
|
if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
diskofferingid: args.data.diskOffering
|
diskofferingid: args.data.diskOffering
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.data.checksum != null && args.data.checksum.length > 0) {
|
if (args.data.checksum != null && args.data.checksum.length > 0) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
checksum: args.data.checksum
|
checksum: args.data.checksum
|
||||||
@ -445,7 +445,7 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadVolumefromLocal: {
|
uploadVolumefromLocal: {
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
label: 'Upload from Local',
|
label: 'Upload from Local',
|
||||||
@ -462,7 +462,7 @@
|
|||||||
fileUpload: {
|
fileUpload: {
|
||||||
getURL: function(args) {
|
getURL: function(args) {
|
||||||
args.data = args.formData;
|
args.data = args.formData;
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
name: args.data.name,
|
name: args.data.name,
|
||||||
zoneId: args.data.availabilityZone,
|
zoneId: args.data.availabilityZone,
|
||||||
@ -475,7 +475,7 @@
|
|||||||
checksum: args.data.checksum
|
checksum: args.data.checksum
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('getUploadParamsForVolume'),
|
url: createURL('getUploadParamsForVolume'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -506,7 +506,7 @@
|
|||||||
args.response.success();
|
args.response.success();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
volumeFileUpload: {
|
volumeFileUpload: {
|
||||||
label: 'local file',
|
label: 'local file',
|
||||||
@ -584,7 +584,7 @@
|
|||||||
notification: {
|
notification: {
|
||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
advSearchFields: {
|
advSearchFields: {
|
||||||
@ -686,12 +686,12 @@
|
|||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
virtualMachineId: args.context.instances[0].id
|
virtualMachineId: args.context.instances[0].id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if ("primarystorages" in args.context) {
|
if ("primarystorages" in args.context) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
storageid: args.context.primarystorages[0].id
|
storageid: args.context.primarystorages[0].id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -804,7 +804,7 @@
|
|||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isHidden: function(args) {
|
isHidden: function(args) {
|
||||||
if (args.context.volumes[0].quiescevm == true)
|
if (args.context.volumes[0].quiescevm == true)
|
||||||
return false;
|
return false;
|
||||||
else
|
else
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -1137,7 +1137,7 @@
|
|||||||
hypervisor: args.context.volumes[0].hypervisor
|
hypervisor: args.context.volumes[0].hypervisor
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$(['Running', 'Stopped']).each(function() {
|
$(['Running', 'Stopped']).each(function() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listVirtualMachines'),
|
url: createURL('listVirtualMachines'),
|
||||||
@ -1147,11 +1147,11 @@
|
|||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
|
var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
|
||||||
$(instanceObjs).each(function() {
|
$(instanceObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
id: this.id,
|
id: this.id,
|
||||||
description: this.displayname ? this.displayname : this.name
|
description: this.displayname ? this.displayname : this.name
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1285,12 +1285,12 @@
|
|||||||
title: 'label.create.template',
|
title: 'label.create.template',
|
||||||
preFilter: cloudStack.preFilter.createTemplate,
|
preFilter: cloudStack.preFilter.createTemplate,
|
||||||
desc: '',
|
desc: '',
|
||||||
preFilter: function(args) {
|
preFilter: function(args) {
|
||||||
if (args.context.volumes[0].hypervisor == "XenServer") {
|
if (args.context.volumes[0].hypervisor == "XenServer") {
|
||||||
if (isAdmin()) {
|
if (isAdmin()) {
|
||||||
args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fields: {
|
fields: {
|
||||||
name: {
|
name: {
|
||||||
@ -1304,24 +1304,24 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
xenserverToolsVersion61plus: {
|
xenserverToolsVersion61plus: {
|
||||||
label: 'label.xenserver.tools.version.61.plus',
|
label: 'label.xenserver.tools.version.61.plus',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isChecked: function (args) {
|
isChecked: function (args) {
|
||||||
var b = false;
|
var b = false;
|
||||||
var vmObj;
|
var vmObj;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listVirtualMachines"),
|
url: createURL("listVirtualMachines"),
|
||||||
data: {
|
data: {
|
||||||
id: args.context.volumes[0].virtualmachineid
|
id: args.context.volumes[0].virtualmachineid
|
||||||
},
|
},
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (vmObj == undefined) { //e.g. VM has failed over
|
if (vmObj == undefined) { //e.g. VM has failed over
|
||||||
if (isAdmin()) {
|
if (isAdmin()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
@ -1336,18 +1336,18 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ('details' in vmObj && 'hypervisortoolsversion' in vmObj.details) {
|
if ('details' in vmObj && 'hypervisortoolsversion' in vmObj.details) {
|
||||||
if (vmObj.details.hypervisortoolsversion == 'xenserver61')
|
if (vmObj.details.hypervisortoolsversion == 'xenserver61')
|
||||||
b = true;
|
b = true;
|
||||||
else
|
else
|
||||||
b = false;
|
b = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return b;
|
return b;
|
||||||
},
|
},
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
osTypeId: {
|
osTypeId: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
@ -1406,17 +1406,17 @@
|
|||||||
isfeatured: (args.data.isFeatured == "on")
|
isfeatured: (args.data.isFeatured == "on")
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//XenServer only (starts here)
|
//XenServer only (starts here)
|
||||||
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').length > 0) {
|
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').length > 0) {
|
||||||
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
|
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//XenServer only (ends here)
|
//XenServer only (ends here)
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('createTemplate'),
|
url: createURL('createTemplate'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -1580,8 +1580,8 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var $form = $(this).closest('form');
|
var $form = $(this).closest('form');
|
||||||
|
|
||||||
var $shrinkok = $form.find('.form-item[rel=shrinkok]');
|
var $shrinkok = $form.find('.form-item[rel=shrinkok]');
|
||||||
//unit of args.context.volumes[0].size is "byte"
|
//unit of args.context.volumes[0].size is "byte"
|
||||||
//unit of selectedDiskOfferingObj.disksize is "gigabyte" ("GB"), so transfer it into "byte" by multiply (1024 * 1024 * 1024)
|
//unit of selectedDiskOfferingObj.disksize is "gigabyte" ("GB"), so transfer it into "byte" by multiply (1024 * 1024 * 1024)
|
||||||
if (args.context.volumes[0].size > selectedDiskOfferingObj.disksize * (1024 * 1024 * 1024)) { //if original disk size > new disk size
|
if (args.context.volumes[0].size > selectedDiskOfferingObj.disksize * (1024 * 1024 * 1024)) { //if original disk size > new disk size
|
||||||
@ -1589,7 +1589,7 @@
|
|||||||
} else {
|
} else {
|
||||||
$shrinkok.hide();
|
$shrinkok.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
var $newsize = $form.find('.form-item[rel=newsize]');
|
var $newsize = $form.find('.form-item[rel=newsize]');
|
||||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||||
$newsize.css('display', 'inline-block');
|
$newsize.css('display', 'inline-block');
|
||||||
@ -1642,11 +1642,11 @@
|
|||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var array1 = [];
|
var array1 = [];
|
||||||
|
|
||||||
if(args.$form.find('.form-item[rel=shrinkok]').css("display") != "none") {
|
if(args.$form.find('.form-item[rel=shrinkok]').css("display") != "none") {
|
||||||
array1.push("&shrinkok=" + (args.data.shrinkok == "on"));
|
array1.push("&shrinkok=" + (args.data.shrinkok == "on"));
|
||||||
}
|
}
|
||||||
|
|
||||||
var newDiskOffering = args.data.newdiskoffering;
|
var newDiskOffering = args.data.newdiskoffering;
|
||||||
var newSize;
|
var newSize;
|
||||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||||
@ -1838,13 +1838,13 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jsonObj = json.listvolumesresponse.volume[0];
|
var jsonObj = json.listvolumesresponse.volume[0];
|
||||||
|
|
||||||
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
||||||
obj: jsonObj,
|
obj: jsonObj,
|
||||||
objType: "Volume"
|
objType: "Volume"
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: volumeActionfilter,
|
actionFilter: volumeActionfilter,
|
||||||
data: jsonObj
|
data: jsonObj
|
||||||
@ -2129,9 +2129,9 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
zoneid: {
|
zoneid: {
|
||||||
label: 'label.availability.zone',
|
label: 'label.availability.zone',
|
||||||
isHidden: true,
|
isHidden: true,
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -2139,11 +2139,11 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var zoneObjs = json.listzonesresponse.zone;
|
var zoneObjs = json.listzonesresponse.zone;
|
||||||
var items = [{
|
var items = [{
|
||||||
id: '',
|
id: '',
|
||||||
description: ''
|
description: ''
|
||||||
}];
|
}];
|
||||||
if (zoneObjs != null) {
|
if (zoneObjs != null) {
|
||||||
for (i = 0; i < zoneObjs.length; i++) {
|
for (i = 0; i < zoneObjs.length; i++) {
|
||||||
items.push({
|
items.push({
|
||||||
@ -2151,14 +2151,14 @@
|
|||||||
description: zoneObjs[i].name
|
description: zoneObjs[i].name
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
@ -2166,13 +2166,13 @@
|
|||||||
snapshotid: args.context.snapshots[0].id,
|
snapshotid: args.context.snapshots[0].id,
|
||||||
name: args.data.name
|
name: args.data.name
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.$form.find('.form-item[rel=zoneid]').css("display") != "none" && args.data.zoneid != '') {
|
if (args.$form.find('.form-item[rel=zoneid]').css("display") != "none" && args.data.zoneid != '') {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
zoneId: args.data.zoneid
|
zoneId: args.data.zoneid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('createVolume'),
|
url: createURL('createVolume'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -2329,22 +2329,22 @@
|
|||||||
return ["remove"];
|
return ["remove"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
||||||
if (jsonObj.hypervisor == 'KVM') {
|
if (jsonObj.hypervisor == 'KVM') {
|
||||||
if (jsonObj.vmstate == 'Running') {
|
if (jsonObj.vmstate == 'Running') {
|
||||||
if (g_kvmsnapshotenabled == true) { //"kvm.snapshot.enabled" flag should be taken to account only when snapshot is being created for Running vm (CLOUDSTACK-4428)
|
if (g_kvmsnapshotenabled == true) { //"kvm.snapshot.enabled" flag should be taken to account only when snapshot is being created for Running vm (CLOUDSTACK-4428)
|
||||||
allowedActions.push("takeSnapshot");
|
allowedActions.push("takeSnapshot");
|
||||||
allowedActions.push("recurringSnapshot");
|
allowedActions.push("recurringSnapshot");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
allowedActions.push("takeSnapshot");
|
allowedActions.push("takeSnapshot");
|
||||||
allowedActions.push("recurringSnapshot");
|
allowedActions.push("recurringSnapshot");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
allowedActions.push("takeSnapshot");
|
allowedActions.push("takeSnapshot");
|
||||||
allowedActions.push("recurringSnapshot");
|
allowedActions.push("recurringSnapshot");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (jsonObj.type == "DATADISK") {
|
if (jsonObj.type == "DATADISK") {
|
||||||
allowedActions.push("resize");
|
allowedActions.push("resize");
|
||||||
}
|
}
|
||||||
|
|||||||
2050
ui/scripts/system.js
2050
ui/scripts/system.js
File diff suppressed because it is too large
Load Diff
@ -16,7 +16,7 @@
|
|||||||
// under the License.
|
// under the License.
|
||||||
(function(cloudStack, $) {
|
(function(cloudStack, $) {
|
||||||
var ostypeObjs;
|
var ostypeObjs;
|
||||||
|
|
||||||
cloudStack.sections.templates = {
|
cloudStack.sections.templates = {
|
||||||
title: 'label.menu.templates',
|
title: 'label.menu.templates',
|
||||||
id: 'templates',
|
id: 'templates',
|
||||||
@ -131,19 +131,19 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
zone: {
|
zone: {
|
||||||
label: 'label.zone',
|
label: 'label.zone',
|
||||||
docID: 'helpRegisterTemplateZone',
|
docID: 'helpRegisterTemplateZone',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
if(g_regionsecondaryenabled == true) {
|
if(g_regionsecondaryenabled == true) {
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: [{
|
data: [{
|
||||||
id: -1,
|
id: -1,
|
||||||
description: "All Zones"
|
description: "All Zones"
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listZones&available=true"),
|
url: createURL("listZones&available=true"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -184,7 +184,7 @@
|
|||||||
var apiCmd;
|
var apiCmd;
|
||||||
if (args.zone == -1) { //All Zones
|
if (args.zone == -1) { //All Zones
|
||||||
//apiCmd = "listHypervisors&zoneid=-1"; //"listHypervisors&zoneid=-1" has been changed to return only hypervisors available in all zones (bug 8809)
|
//apiCmd = "listHypervisors&zoneid=-1"; //"listHypervisors&zoneid=-1" has been changed to return only hypervisors available in all zones (bug 8809)
|
||||||
apiCmd = "listHypervisors";
|
apiCmd = "listHypervisors";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
apiCmd = "listHypervisors&zoneid=" + args.zone;
|
apiCmd = "listHypervisors&zoneid=" + args.zone;
|
||||||
@ -215,20 +215,20 @@
|
|||||||
$form.find('.form-item[rel=rootDiskControllerType]').css('display', 'inline-block');
|
$form.find('.form-item[rel=rootDiskControllerType]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=nicAdapterType]').css('display', 'inline-block');
|
$form.find('.form-item[rel=nicAdapterType]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=keyboardType]').css('display', 'inline-block');
|
$form.find('.form-item[rel=keyboardType]').css('display', 'inline-block');
|
||||||
|
|
||||||
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
|
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
|
||||||
} else if ($(this).val() == "XenServer") {
|
} else if ($(this).val() == "XenServer") {
|
||||||
$form.find('.form-item[rel=rootDiskControllerType]').hide();
|
$form.find('.form-item[rel=rootDiskControllerType]').hide();
|
||||||
$form.find('.form-item[rel=nicAdapterType]').hide();
|
$form.find('.form-item[rel=nicAdapterType]').hide();
|
||||||
$form.find('.form-item[rel=keyboardType]').hide();
|
$form.find('.form-item[rel=keyboardType]').hide();
|
||||||
|
|
||||||
if (isAdmin())
|
if (isAdmin())
|
||||||
$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
||||||
} else {
|
} else {
|
||||||
$form.find('.form-item[rel=rootDiskControllerType]').hide();
|
$form.find('.form-item[rel=rootDiskControllerType]').hide();
|
||||||
$form.find('.form-item[rel=nicAdapterType]').hide();
|
$form.find('.form-item[rel=nicAdapterType]').hide();
|
||||||
$form.find('.form-item[rel=keyboardType]').hide();
|
$form.find('.form-item[rel=keyboardType]').hide();
|
||||||
|
|
||||||
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
|
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -260,7 +260,7 @@
|
|||||||
},
|
},
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
//fields for hypervisor == "VMware" (starts here)
|
//fields for hypervisor == "VMware" (starts here)
|
||||||
rootDiskControllerType: {
|
rootDiskControllerType: {
|
||||||
label: 'label.root.disk.controller',
|
label: 'label.root.disk.controller',
|
||||||
@ -419,18 +419,18 @@
|
|||||||
osTypeId: {
|
osTypeId: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
docID: 'helpRegisterTemplateOSType',
|
docID: 'helpRegisterTemplateOSType',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var ostypeObjs = json.listostypesresponse.ostype;
|
var ostypeObjs = json.listostypesresponse.ostype;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: ostypeObjs
|
data: ostypeObjs
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -519,16 +519,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//XenServer only (starts here)
|
//XenServer only (starts here)
|
||||||
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
|
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//XenServer only (ends here)
|
//XenServer only (ends here)
|
||||||
|
|
||||||
|
|
||||||
//VMware only (starts here)
|
//VMware only (starts here)
|
||||||
if (args.$form.find('.form-item[rel=rootDiskControllerType]').css("display") != "none" && args.data.rootDiskControllerType != "") {
|
if (args.$form.find('.form-item[rel=rootDiskControllerType]').css("display") != "none" && args.data.rootDiskControllerType != "") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
@ -579,7 +579,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
uploadTemplateFromLocal: {
|
uploadTemplateFromLocal: {
|
||||||
isHeader: true,
|
isHeader: true,
|
||||||
label: 'Upload from Local',
|
label: 'Upload from Local',
|
||||||
@ -592,9 +592,9 @@
|
|||||||
title: 'Upload Template from Local',
|
title: 'Upload Template from Local',
|
||||||
preFilter: cloudStack.preFilter.createTemplate,
|
preFilter: cloudStack.preFilter.createTemplate,
|
||||||
fileUpload: {
|
fileUpload: {
|
||||||
getURL: function(args) {
|
getURL: function(args) {
|
||||||
args.data = args.formData;
|
args.data = args.formData;
|
||||||
|
|
||||||
var data = {
|
var data = {
|
||||||
name: args.data.name,
|
name: args.data.name,
|
||||||
displayText: args.data.description,
|
displayText: args.data.description,
|
||||||
@ -606,7 +606,7 @@
|
|||||||
osTypeId: args.data.osTypeId,
|
osTypeId: args.data.osTypeId,
|
||||||
hypervisor: args.data.hypervisor
|
hypervisor: args.data.hypervisor
|
||||||
};
|
};
|
||||||
|
|
||||||
if (args.$form.find('.form-item[rel=isPublic]').css("display") != "none") {
|
if (args.$form.find('.form-item[rel=isPublic]').css("display") != "none") {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
ispublic: (args.data.isPublic == "on")
|
ispublic: (args.data.isPublic == "on")
|
||||||
@ -630,15 +630,15 @@
|
|||||||
isrouting: (args.data.isrouting === 'on')
|
isrouting: (args.data.isrouting === 'on')
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('getUploadParamsForTemplate'),
|
url: createURL('getUploadParamsForTemplate'),
|
||||||
data: data,
|
data: data,
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var uploadparams = json.postuploadtemplateresponse.getuploadparams;
|
var uploadparams = json.postuploadtemplateresponse.getuploadparams;
|
||||||
var templateId = uploadparams.id;
|
var templateId = uploadparams.id;
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
url: uploadparams.postURL,
|
url: uploadparams.postURL,
|
||||||
ajaxPost: true,
|
ajaxPost: true,
|
||||||
@ -647,9 +647,9 @@
|
|||||||
'X-expires': uploadparams.expires,
|
'X-expires': uploadparams.expires,
|
||||||
'X-metadata': uploadparams.metadata
|
'X-metadata': uploadparams.metadata
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
postUpload: function(args) {
|
postUpload: function(args) {
|
||||||
if(args.error) {
|
if(args.error) {
|
||||||
@ -685,7 +685,7 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
zone: {
|
zone: {
|
||||||
label: 'label.zone',
|
label: 'label.zone',
|
||||||
@ -742,24 +742,24 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
format: {
|
format: {
|
||||||
label: 'label.format',
|
label: 'label.format',
|
||||||
docID: 'helpRegisterTemplateFormat',
|
docID: 'helpRegisterTemplateFormat',
|
||||||
dependsOn: 'hypervisor',
|
dependsOn: 'hypervisor',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
var items = [];
|
var items = [];
|
||||||
if (args.hypervisor == "XenServer") {
|
if (args.hypervisor == "XenServer") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'VHD',
|
id: 'VHD',
|
||||||
description: 'VHD'
|
description: 'VHD'
|
||||||
});
|
});
|
||||||
} else if (args.hypervisor == "VMware") {
|
} else if (args.hypervisor == "VMware") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'OVA',
|
id: 'OVA',
|
||||||
description: 'OVA'
|
description: 'OVA'
|
||||||
});
|
});
|
||||||
} else if (args.hypervisor == "KVM") {
|
} else if (args.hypervisor == "KVM") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'QCOW2',
|
id: 'QCOW2',
|
||||||
description: 'QCOW2'
|
description: 'QCOW2'
|
||||||
@ -776,17 +776,17 @@
|
|||||||
id: 'VMDK',
|
id: 'VMDK',
|
||||||
description: 'VMDK'
|
description: 'VMDK'
|
||||||
});
|
});
|
||||||
} else if (args.hypervisor == "BareMetal") {
|
} else if (args.hypervisor == "BareMetal") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'BareMetal',
|
id: 'BareMetal',
|
||||||
description: 'BareMetal'
|
description: 'BareMetal'
|
||||||
});
|
});
|
||||||
} else if (args.hypervisor == "Ovm") {
|
} else if (args.hypervisor == "Ovm") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'RAW',
|
id: 'RAW',
|
||||||
description: 'RAW'
|
description: 'RAW'
|
||||||
});
|
});
|
||||||
} else if (args.hypervisor == "LXC") {
|
} else if (args.hypervisor == "LXC") {
|
||||||
items.push({
|
items.push({
|
||||||
id: 'TAR',
|
id: 'TAR',
|
||||||
description: 'TAR'
|
description: 'TAR'
|
||||||
@ -805,23 +805,23 @@
|
|||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
osTypeId: {
|
osTypeId: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
docID: 'helpRegisterTemplateOSType',
|
docID: 'helpRegisterTemplateOSType',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var ostypeObjs = json.listostypesresponse.ostype;
|
var ostypeObjs = json.listostypesresponse.ostype;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: ostypeObjs
|
data: ostypeObjs
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -830,40 +830,40 @@
|
|||||||
docID: 'helpRegisterTemplateExtractable',
|
docID: 'helpRegisterTemplateExtractable',
|
||||||
isBoolean: true
|
isBoolean: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isPasswordEnabled: {
|
isPasswordEnabled: {
|
||||||
label: "label.password.enabled",
|
label: "label.password.enabled",
|
||||||
docID: 'helpRegisterTemplatePasswordEnabled',
|
docID: 'helpRegisterTemplatePasswordEnabled',
|
||||||
isBoolean: true
|
isBoolean: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isdynamicallyscalable: {
|
isdynamicallyscalable: {
|
||||||
label: "label.dynamically.scalable",
|
label: "label.dynamically.scalable",
|
||||||
docID: 'helpRegisterTemplateDynamicallyScalable',
|
docID: 'helpRegisterTemplateDynamicallyScalable',
|
||||||
isBoolean: true
|
isBoolean: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isPublic: {
|
isPublic: {
|
||||||
label: "label.public",
|
label: "label.public",
|
||||||
docID: 'helpRegisterTemplatePublic',
|
docID: 'helpRegisterTemplatePublic',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isFeatured: {
|
isFeatured: {
|
||||||
label: "label.featured",
|
label: "label.featured",
|
||||||
docID: 'helpRegisterTemplateFeatured',
|
docID: 'helpRegisterTemplateFeatured',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
isrouting: {
|
isrouting: {
|
||||||
label: 'label.routing',
|
label: 'label.routing',
|
||||||
docID: 'helpRegisterTemplateRouting',
|
docID: 'helpRegisterTemplateRouting',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
requireshvm: {
|
requireshvm: {
|
||||||
label: 'label.hvm',
|
label: 'label.hvm',
|
||||||
docID: 'helpRegisterTemplateHvm',
|
docID: 'helpRegisterTemplateHvm',
|
||||||
@ -934,14 +934,14 @@
|
|||||||
success: function(json) {
|
success: function(json) {
|
||||||
var items = json.listtemplatesresponse.template;
|
var items = json.listtemplatesresponse.template;
|
||||||
var itemsView = [];
|
var itemsView = [];
|
||||||
|
|
||||||
$(items).each(function(index, item) {
|
$(items).each(function(index, item) {
|
||||||
var existing = $.grep(itemsView, function(it){
|
var existing = $.grep(itemsView, function(it){
|
||||||
return it != null && it.id !=null && it.id == item.id;
|
return it != null && it.id !=null && it.id == item.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (existing.length == 0) {
|
if (existing.length == 0) {
|
||||||
itemsView.push($.extend(item, {
|
itemsView.push($.extend(item, {
|
||||||
zones: item.zonename,
|
zones: item.zonename,
|
||||||
zoneids: [item.zoneid]
|
zoneids: [item.zoneid]
|
||||||
}));
|
}));
|
||||||
@ -950,7 +950,7 @@
|
|||||||
existing[0].zones = 'label.multiplezones';
|
existing[0].zones = 'label.multiplezones';
|
||||||
existing[0].zoneids.push(item.zoneid);
|
existing[0].zoneids.push(item.zoneid);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: templateActionfilter,
|
actionFilter: templateActionfilter,
|
||||||
@ -1035,10 +1035,10 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//***** addResourceDetail *****
|
//***** addResourceDetail *****
|
||||||
//XenServer only (starts here)
|
//XenServer only (starts here)
|
||||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('addResourceDetail'),
|
url: createURL('addResourceDetail'),
|
||||||
data: {
|
data: {
|
||||||
@ -1055,33 +1055,33 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var result = json.queryasyncjobresultresponse;
|
var result = json.queryasyncjobresultresponse;
|
||||||
|
|
||||||
if (result.jobstatus == 0) {
|
if (result.jobstatus == 0) {
|
||||||
return; //Job has not completed
|
return; //Job has not completed
|
||||||
} else {
|
} else {
|
||||||
clearInterval(addResourceDetailIntervalID);
|
clearInterval(addResourceDetailIntervalID);
|
||||||
|
|
||||||
if (result.jobstatus == 1) {
|
if (result.jobstatus == 1) {
|
||||||
//do nothing
|
//do nothing
|
||||||
} else if (result.jobstatus == 2) {
|
} else if (result.jobstatus == 2) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: "message.XSTools61plus.update.failed" + " " + _s(result.jobresult.errortext)
|
message: "message.XSTools61plus.update.failed" + " " + _s(result.jobresult.errortext)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: "message.XSTools61plus.update.failed" + " " + parseXMLHttpResponse(XMLHttpResponse)
|
message: "message.XSTools61plus.update.failed" + " " + parseXMLHttpResponse(XMLHttpResponse)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, g_queryAsyncJobResultInterval);
|
}, g_queryAsyncJobResultInterval);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//XenServer only (ends here)
|
//XenServer only (ends here)
|
||||||
|
|
||||||
|
|
||||||
//***** listTemplates *****
|
//***** listTemplates *****
|
||||||
//So, we call listTemplates API to get a complete template object
|
//So, we call listTemplates API to get a complete template object
|
||||||
@ -1162,36 +1162,36 @@
|
|||||||
} else {
|
} else {
|
||||||
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
|
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
|
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
|
||||||
var ostypeObjs;
|
var ostypeObjs;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var ostypeObjs = json.listostypesresponse.ostype;
|
var ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ostypeObjs != undefined) {
|
if (ostypeObjs != undefined) {
|
||||||
var ostypeName;
|
var ostypeName;
|
||||||
for (var i = 0; i < ostypeObjs.length; i++) {
|
for (var i = 0; i < ostypeObjs.length; i++) {
|
||||||
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
|
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
|
||||||
ostypeName = ostypeObjs[i].description;
|
ostypeName = ostypeObjs[i].description;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hiddenFields;
|
return hiddenFields;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1203,7 +1203,7 @@
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
hypervisor: {
|
hypervisor: {
|
||||||
label: 'label.hypervisor'
|
label: 'label.hypervisor'
|
||||||
},
|
},
|
||||||
@ -1217,8 +1217,8 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
|
|
||||||
size: {
|
size: {
|
||||||
label: 'label.size',
|
label: 'label.size',
|
||||||
converter: function(args) {
|
converter: function(args) {
|
||||||
@ -1276,8 +1276,8 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
|
|
||||||
ostypeid: {
|
ostypeid: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
@ -1287,11 +1287,11 @@
|
|||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
@ -1315,8 +1315,8 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domain: {
|
domain: {
|
||||||
label: 'label.domain'
|
label: 'label.domain'
|
||||||
},
|
},
|
||||||
@ -1327,11 +1327,11 @@
|
|||||||
label: 'label.created',
|
label: 'label.created',
|
||||||
converter: cloudStack.converters.toLocalDate
|
converter: cloudStack.converters.toLocalDate
|
||||||
},
|
},
|
||||||
|
|
||||||
templatetype: {
|
templatetype: {
|
||||||
label: 'label.type'
|
label: 'label.type'
|
||||||
},
|
},
|
||||||
|
|
||||||
id: {
|
id: {
|
||||||
label: 'label.id'
|
label: 'label.id'
|
||||||
}
|
}
|
||||||
@ -1343,7 +1343,7 @@
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab
|
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listTemplates"),
|
url: createURL("listTemplates"),
|
||||||
data: {
|
data: {
|
||||||
@ -1352,14 +1352,14 @@
|
|||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jsonObj = json.listtemplatesresponse.template[0];
|
var jsonObj = json.listtemplatesresponse.template[0];
|
||||||
|
|
||||||
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
|
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
|
||||||
if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
|
if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
|
||||||
jsonObj.xenserverToolsVersion61plus = true;
|
jsonObj.xenserverToolsVersion61plus = true;
|
||||||
else
|
else
|
||||||
jsonObj.xenserverToolsVersion61plus = false;
|
jsonObj.xenserverToolsVersion61plus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: templateActionfilter,
|
actionFilter: templateActionfilter,
|
||||||
data: jsonObj
|
data: jsonObj
|
||||||
@ -1388,7 +1388,7 @@
|
|||||||
hideSearchBar: true,
|
hideSearchBar: true,
|
||||||
|
|
||||||
|
|
||||||
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing)
|
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing)
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listTemplates"),
|
url: createURL("listTemplates"),
|
||||||
data: {
|
data: {
|
||||||
@ -1397,7 +1397,7 @@
|
|||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jsonObjs = json.listtemplatesresponse.template;
|
var jsonObjs = json.listtemplatesresponse.template;
|
||||||
|
|
||||||
if (jsonObjs != undefined) {
|
if (jsonObjs != undefined) {
|
||||||
for (var i = 0; i < jsonObjs.length; i++) {
|
for (var i = 0; i < jsonObjs.length; i++) {
|
||||||
var jsonObj = jsonObjs[i];
|
var jsonObj = jsonObjs[i];
|
||||||
@ -1408,16 +1408,16 @@
|
|||||||
jsonObj.xenserverToolsVersion61plus = false;
|
jsonObj.xenserverToolsVersion61plus = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: templateActionfilter,
|
actionFilter: templateActionfilter,
|
||||||
data: jsonObjs
|
data: jsonObjs
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
detailView: {
|
detailView: {
|
||||||
noCompact: true,
|
noCompact: true,
|
||||||
actions: {
|
actions: {
|
||||||
@ -1500,18 +1500,18 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.templates[0].id,
|
id: args.context.templates[0].id,
|
||||||
destzoneid: args.data.destinationZoneId
|
destzoneid: args.data.destinationZoneId
|
||||||
};
|
};
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
sourcezoneid: args.context.zones[0].zoneid
|
sourcezoneid: args.context.zones[0].zoneid
|
||||||
});
|
});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('copyTemplate'),
|
url: createURL('copyTemplate'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var jid = json.copytemplateresponse.jobid;
|
var jid = json.copytemplateresponse.jobid;
|
||||||
args.response.success({
|
args.response.success({
|
||||||
@ -1532,7 +1532,7 @@
|
|||||||
poll: pollAsyncJobResult
|
poll: pollAsyncJobResult
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
tabs: {
|
tabs: {
|
||||||
details: {
|
details: {
|
||||||
@ -1544,36 +1544,36 @@
|
|||||||
} else {
|
} else {
|
||||||
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
|
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
|
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
|
||||||
var ostypeObjs;
|
var ostypeObjs;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (ostypeObjs != undefined) {
|
if (ostypeObjs != undefined) {
|
||||||
var ostypeName;
|
var ostypeName;
|
||||||
for (var i = 0; i < ostypeObjs.length; i++) {
|
for (var i = 0; i < ostypeObjs.length; i++) {
|
||||||
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
|
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
|
||||||
ostypeName = ostypeObjs[i].description;
|
ostypeName = ostypeObjs[i].description;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
||||||
hiddenFields.push('xenserverToolsVersion61plus');
|
hiddenFields.push('xenserverToolsVersion61plus');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hiddenFields;
|
return hiddenFields;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1585,13 +1585,13 @@
|
|||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
id: {
|
id: {
|
||||||
label: 'label.id'
|
label: 'label.id'
|
||||||
},
|
},
|
||||||
zonename: {
|
zonename: {
|
||||||
label: 'label.zone.name'
|
label: 'label.zone.name'
|
||||||
},
|
},
|
||||||
zoneid: {
|
zoneid: {
|
||||||
label: 'label.zone.id'
|
label: 'label.zone.id'
|
||||||
},
|
},
|
||||||
@ -1616,8 +1616,8 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
|
|
||||||
size: {
|
size: {
|
||||||
label: 'label.size',
|
label: 'label.size',
|
||||||
converter: function(args) {
|
converter: function(args) {
|
||||||
@ -1675,22 +1675,22 @@
|
|||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
|
|
||||||
ostypeid: {
|
ostypeid: {
|
||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
var ostypeObjs;
|
var ostypeObjs;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
@ -1711,8 +1711,8 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
domain: {
|
domain: {
|
||||||
label: 'label.domain'
|
label: 'label.domain'
|
||||||
},
|
},
|
||||||
@ -1723,7 +1723,7 @@
|
|||||||
label: 'label.created',
|
label: 'label.created',
|
||||||
converter: cloudStack.converters.toLocalDate
|
converter: cloudStack.converters.toLocalDate
|
||||||
},
|
},
|
||||||
|
|
||||||
templatetype: {
|
templatetype: {
|
||||||
label: 'label.type'
|
label: 'label.type'
|
||||||
}
|
}
|
||||||
@ -1736,7 +1736,7 @@
|
|||||||
}),
|
}),
|
||||||
|
|
||||||
|
|
||||||
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing) > select a zone from listing > Details tab
|
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing) > select a zone from listing > Details tab
|
||||||
var jsonObj = args.context.zones[0];
|
var jsonObj = args.context.zones[0];
|
||||||
|
|
||||||
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
|
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
|
||||||
@ -1749,11 +1749,11 @@
|
|||||||
args.response.success({
|
args.response.success({
|
||||||
actionFilter: templateActionfilter,
|
actionFilter: templateActionfilter,
|
||||||
data: jsonObj
|
data: jsonObj
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1838,8 +1838,8 @@
|
|||||||
id: -1,
|
id: -1,
|
||||||
description: "All Zones"
|
description: "All Zones"
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listZones&available=true"),
|
url: createURL("listZones&available=true"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -1891,7 +1891,7 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var ostypeObjs = json.listostypesresponse.ostype;
|
var ostypeObjs = json.listostypesresponse.ostype;
|
||||||
var items = [];
|
var items = [];
|
||||||
//items.push({id: "", description: "None"}); //shouldn't have None option when bootable is checked
|
//items.push({id: "", description: "None"}); //shouldn't have None option when bootable is checked
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
@ -1904,7 +1904,7 @@
|
|||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2316,13 +2316,13 @@
|
|||||||
label: 'label.os.type',
|
label: 'label.os.type',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
if (ostypeObjs == undefined) {
|
if (ostypeObjs == undefined) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listOsTypes"),
|
url: createURL("listOsTypes"),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2412,7 +2412,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
detailView: {
|
detailView: {
|
||||||
actions: {
|
actions: {
|
||||||
copyISO: {
|
copyISO: {
|
||||||
@ -2458,17 +2458,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
id: args.context.isos[0].id,
|
id: args.context.isos[0].id,
|
||||||
destzoneid: args.data.destinationZoneId
|
destzoneid: args.data.destinationZoneId
|
||||||
};
|
};
|
||||||
if (args.context.zones[0].zoneid != undefined) {
|
if (args.context.zones[0].zoneid != undefined) {
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
sourcezoneid: args.context.zones[0].zoneid
|
sourcezoneid: args.context.zones[0].zoneid
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('copyIso'),
|
url: createURL('copyIso'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -2616,10 +2616,10 @@
|
|||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
ostypeObjs = json.listostypesresponse.ostype;
|
ostypeObjs = json.listostypesresponse.ostype;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var items = [];
|
var items = [];
|
||||||
$(ostypeObjs).each(function() {
|
$(ostypeObjs).each(function() {
|
||||||
items.push({
|
items.push({
|
||||||
@ -2629,7 +2629,7 @@
|
|||||||
});
|
});
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2689,14 +2689,14 @@
|
|||||||
//do nothing
|
//do nothing
|
||||||
} else {
|
} else {
|
||||||
allowedActions.push("edit");
|
allowedActions.push("edit");
|
||||||
|
|
||||||
allowedActions.push("copyTemplate");
|
allowedActions.push("copyTemplate");
|
||||||
/*
|
/*
|
||||||
if(g_regionsecondaryenabled != true) {
|
if(g_regionsecondaryenabled != true) {
|
||||||
allowedActions.push("copyTemplate");
|
allowedActions.push("copyTemplate");
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//allowedActions.push("createVm"); // For Beta2, this simply doesn't work without a network.
|
//allowedActions.push("createVm"); // For Beta2, this simply doesn't work without a network.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -209,10 +209,10 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
//for testing only (end)
|
//for testing only (end)
|
||||||
|
|
||||||
if (json.ldapuserresponse.count > 0) {
|
if (json.ldapuserresponse.count > 0) {
|
||||||
$(json.ldapuserresponse.LdapUser).each(function() {
|
$(json.ldapuserresponse.LdapUser).each(function() {
|
||||||
var $result = $('<tr>');
|
var $result = $('<tr>');
|
||||||
@ -334,4 +334,4 @@
|
|||||||
accountsWizard(args);
|
accountsWizard(args);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
})(jQuery, cloudStack);
|
})(jQuery, cloudStack);
|
||||||
|
|||||||
@ -301,7 +301,7 @@
|
|||||||
|
|
||||||
'select-iso': function($step, formData) {
|
'select-iso': function($step, formData) {
|
||||||
$step.find('.section.custom-size').hide();
|
$step.find('.section.custom-size').hide();
|
||||||
|
|
||||||
var originalValues = function(formData) {
|
var originalValues = function(formData) {
|
||||||
var $inputs = $step.find('.wizard-step-conditional:visible')
|
var $inputs = $step.find('.wizard-step-conditional:visible')
|
||||||
.find('input[type=radio]');
|
.find('input[type=radio]');
|
||||||
@ -323,7 +323,7 @@
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
response: {
|
response: {
|
||||||
success: function(args) {
|
success: function(args) {
|
||||||
if (formData['select-template']) {
|
if (formData['select-template']) {
|
||||||
$step.find('.wizard-step-conditional').filter(function() {
|
$step.find('.wizard-step-conditional').filter(function() {
|
||||||
return $(this).hasClass(formData['select-template']);
|
return $(this).hasClass(formData['select-template']);
|
||||||
@ -462,7 +462,7 @@
|
|||||||
}, {
|
}, {
|
||||||
'wizard-field': 'service-offering'
|
'wizard-field': 'service-offering'
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
$step.find('input[type=radio]').bind('change', function() {
|
$step.find('input[type=radio]').bind('change', function() {
|
||||||
var $target = $(this);
|
var $target = $(this);
|
||||||
@ -576,7 +576,7 @@
|
|||||||
$selectContainer.hide();
|
$selectContainer.hide();
|
||||||
|
|
||||||
// Fix issue with containers always showing after reload
|
// Fix issue with containers always showing after reload
|
||||||
$multiDiskSelect.find('.select-container').attr('style', null);
|
$multiDiskSelect.find('.select-container').attr('style', null);
|
||||||
} else {
|
} else {
|
||||||
$selectContainer.show();
|
$selectContainer.show();
|
||||||
$step.find('.content .select-container').append(
|
$step.find('.content .select-container').append(
|
||||||
@ -618,7 +618,7 @@
|
|||||||
// handle removal of custom IOPS controls
|
// handle removal of custom IOPS controls
|
||||||
$step.removeClass('custom-iops-do');
|
$step.removeClass('custom-iops-do');
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1137,19 +1137,19 @@
|
|||||||
// Next button
|
// Next button
|
||||||
if ($target.closest('div.button.next').size()) {
|
if ($target.closest('div.button.next').size()) {
|
||||||
//step 2 - select template/ISO
|
//step 2 - select template/ISO
|
||||||
if($activeStep.hasClass('select-iso')) {
|
if($activeStep.hasClass('select-iso')) {
|
||||||
if ($activeStep.find('.content:visible input:checked').size() == 0) {
|
if ($activeStep.find('.content:visible input:checked').size() == 0) {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: 'message.step.1.continue'
|
message: 'message.step.1.continue'
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
|
$(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
|
||||||
$form: $form,
|
$form: $form,
|
||||||
currentStep: 2
|
currentStep: 2
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//step 6 - select network
|
//step 6 - select network
|
||||||
if ($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
if ($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
||||||
var data = $activeStep.data('my-networks');
|
var data = $activeStep.data('my-networks');
|
||||||
@ -1277,7 +1277,7 @@
|
|||||||
$wizard.find('.tab-view').tabs();
|
$wizard.find('.tab-view').tabs();
|
||||||
$wizard.find('.slider').each(function() {
|
$wizard.find('.slider').each(function() {
|
||||||
var $slider = $(this);
|
var $slider = $(this);
|
||||||
|
|
||||||
$slider.slider({
|
$slider.slider({
|
||||||
min: minCustomDiskSize,
|
min: minCustomDiskSize,
|
||||||
max: maxCustomDiskSize,
|
max: maxCustomDiskSize,
|
||||||
|
|||||||
@ -61,7 +61,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
$li.appendTo($socketInfo);
|
$li.appendTo($socketInfo);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -53,13 +53,13 @@
|
|||||||
|
|
||||||
$plugin.click(function() {
|
$plugin.click(function() {
|
||||||
var $mainSection = $('#navigation ul li').filter('.' + plugin.id);
|
var $mainSection = $('#navigation ul li').filter('.' + plugin.id);
|
||||||
|
|
||||||
if ($mainSection.size()) {
|
if ($mainSection.size()) {
|
||||||
$mainSection.click();
|
$mainSection.click();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$browser.cloudBrowser('addPanel', {
|
$browser.cloudBrowser('addPanel', {
|
||||||
title: plugin.title,
|
title: plugin.title,
|
||||||
$parent: $('.panel:first'),
|
$parent: $('.panel:first'),
|
||||||
|
|||||||
@ -296,21 +296,21 @@
|
|||||||
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
|
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
|
||||||
var zoneType = getData($trafficType.closest('.zone-wizard')).zone.networkType;
|
var zoneType = getData($trafficType.closest('.zone-wizard')).zone.networkType;
|
||||||
var fields;
|
var fields;
|
||||||
|
|
||||||
if (hypervisor == 'VMware') {
|
if (hypervisor == 'VMware') {
|
||||||
fields = {
|
fields = {
|
||||||
vSwitchName: {
|
vSwitchName: {
|
||||||
label: 'label.vswitch.name' ,
|
label: 'label.vswitch.name' ,
|
||||||
defaultValue: trafficData.vSwitchName
|
defaultValue: trafficData.vSwitchName
|
||||||
},
|
},
|
||||||
vlanId: {
|
vlanId: {
|
||||||
label: 'label.vlan.id',
|
label: 'label.vlan.id',
|
||||||
defaultValue: trafficData.vlanId
|
defaultValue: trafficData.vlanId
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if(zoneType == 'Advanced') {
|
if(zoneType == 'Advanced') {
|
||||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||||
if(trafficData.vSwitchType == null) {
|
if(trafficData.vSwitchType == null) {
|
||||||
var useDvs = false;
|
var useDvs = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -324,9 +324,9 @@
|
|||||||
useDvs = true;
|
useDvs = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (useDvs == true) {
|
if (useDvs == true) {
|
||||||
var useNexusDvs = false;
|
var useNexusDvs = false;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listConfigurations'),
|
url: createURL('listConfigurations'),
|
||||||
data: {
|
data: {
|
||||||
@ -345,17 +345,17 @@
|
|||||||
} else {
|
} else {
|
||||||
trafficData.vSwitchType = 'vmwaredvs';
|
trafficData.vSwitchType = 'vmwaredvs';
|
||||||
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||||
}
|
}
|
||||||
} else { //useDvs == false
|
} else { //useDvs == false
|
||||||
trafficData.vSwitchType = 'vmwaresvs';
|
trafficData.vSwitchType = 'vmwaresvs';
|
||||||
fields.vSwitchName.defaultValue = 'vSwitch0';
|
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.extend(fields, {
|
$.extend(fields, {
|
||||||
vSwitchType: {
|
vSwitchType: {
|
||||||
label: 'label.vSwitch.type',
|
label: 'label.vSwitch.type',
|
||||||
select: function (args) {
|
select: function (args) {
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: [{
|
data: [{
|
||||||
id: 'nexusdvs',
|
id: 'nexusdvs',
|
||||||
@ -371,10 +371,10 @@
|
|||||||
},
|
},
|
||||||
defaultValue: trafficData.vSwitchType
|
defaultValue: trafficData.vSwitchType
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
fields = {
|
fields = {
|
||||||
label: {
|
label: {
|
||||||
label: hypervisor + ' ' + _l('label.traffic.label'),
|
label: hypervisor + ' ' + _l('label.traffic.label'),
|
||||||
@ -390,7 +390,7 @@
|
|||||||
fields: fields
|
fields: fields
|
||||||
},
|
},
|
||||||
|
|
||||||
after: function(args) {
|
after: function(args) {
|
||||||
$trafficType.data('traffic-type-data', args.data);
|
$trafficType.data('traffic-type-data', args.data);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@ -98,7 +98,7 @@
|
|||||||
$navItem.addClass('active');
|
$navItem.addClass('active');
|
||||||
$browser.cloudBrowser('removeAllPanels');
|
$browser.cloudBrowser('removeAllPanels');
|
||||||
}
|
}
|
||||||
|
|
||||||
$browser.cloudBrowser('addPanel', {
|
$browser.cloudBrowser('addPanel', {
|
||||||
title: '<span class="section">' + _l(data.title) + '</span>' + '<span class="subsection"></span>',
|
title: '<span class="section">' + _l(data.title) + '</span>' + '<span class="subsection"></span>',
|
||||||
data: '',
|
data: '',
|
||||||
@ -106,7 +106,7 @@
|
|||||||
if(!isPlugin) {
|
if(!isPlugin) {
|
||||||
$breadcrumb.attr('title', _l(data.title));
|
$breadcrumb.attr('title', _l(data.title));
|
||||||
}
|
}
|
||||||
|
|
||||||
data.$breadcrumb = $breadcrumb;
|
data.$breadcrumb = $breadcrumb;
|
||||||
|
|
||||||
// Hide breadcrumb if this is the home section
|
// Hide breadcrumb if this is the home section
|
||||||
|
|||||||
@ -48,11 +48,11 @@
|
|||||||
|
|
||||||
// Description text
|
// Description text
|
||||||
var formDesc;
|
var formDesc;
|
||||||
if (typeof(args.form.desc) == 'function') {
|
if (typeof(args.form.desc) == 'function') {
|
||||||
formDesc = args.form.desc(args);
|
formDesc = args.form.desc(args);
|
||||||
} else { //typeof(args.form.desc) == 'string' or 'undefined'
|
} else { //typeof(args.form.desc) == 'string' or 'undefined'
|
||||||
formDesc = args.form.desc;
|
formDesc = args.form.desc;
|
||||||
}
|
}
|
||||||
$('<span>').addClass('message').prependTo($formContainer).html(
|
$('<span>').addClass('message').prependTo($formContainer).html(
|
||||||
_l(formDesc)
|
_l(formDesc)
|
||||||
);
|
);
|
||||||
@ -225,7 +225,7 @@
|
|||||||
|
|
||||||
if ($dependsOn.is('[type=checkbox]')) {
|
if ($dependsOn.is('[type=checkbox]')) {
|
||||||
var isReverse = false;
|
var isReverse = false;
|
||||||
|
|
||||||
if (args.form.fields[dependsOn]) {
|
if (args.form.fields[dependsOn]) {
|
||||||
isReverse = args.form.fields[dependsOn].isReverse;
|
isReverse = args.form.fields[dependsOn].isReverse;
|
||||||
isChecked = args.form.fields[dependsOn].isChecked;
|
isChecked = args.form.fields[dependsOn].isChecked;
|
||||||
@ -238,10 +238,10 @@
|
|||||||
|
|
||||||
if (($target.is(':checked') && !isReverse) ||
|
if (($target.is(':checked') && !isReverse) ||
|
||||||
($target.is(':unchecked') && isReverse)) {
|
($target.is(':unchecked') && isReverse)) {
|
||||||
|
|
||||||
$dependent.css('display', 'inline-block'); //show dependent dropdown field
|
$dependent.css('display', 'inline-block'); //show dependent dropdown field
|
||||||
$dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826)
|
$dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826)
|
||||||
|
|
||||||
$dependent.each(function() {
|
$dependent.each(function() {
|
||||||
if ($(this).data('dialog-select-fn')) {
|
if ($(this).data('dialog-select-fn')) {
|
||||||
$(this).data('dialog-select-fn')();
|
$(this).data('dialog-select-fn')();
|
||||||
@ -283,7 +283,7 @@
|
|||||||
success: function(args) {
|
success: function(args) {
|
||||||
if (args.data == undefined || args.data.length == 0) {
|
if (args.data == undefined || args.data.length == 0) {
|
||||||
var $option = $('<option>')
|
var $option = $('<option>')
|
||||||
.appendTo($input)
|
.appendTo($input)
|
||||||
.html("");
|
.html("");
|
||||||
} else {
|
} else {
|
||||||
$(args.data).each(function() {
|
$(args.data).each(function() {
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var sanitized = value
|
var sanitized = value
|
||||||
.replace(/</g, "<")
|
.replace(/</g, "<")
|
||||||
.replace(/>/g, ">");
|
.replace(/>/g, ">");
|
||||||
|
|
||||||
|
|||||||
@ -239,7 +239,7 @@
|
|||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: messages.complete(args2.data)
|
message: messages.complete(args2.data)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (additional && additional.complete) additional.complete($.extend(true, args, {
|
if (additional && additional.complete) additional.complete($.extend(true, args, {
|
||||||
$detailView: $detailView
|
$detailView: $detailView
|
||||||
@ -387,31 +387,31 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function($detailView, args) {
|
destroy: function($detailView, args) {
|
||||||
var tab = args.tabs[args.activeTab];
|
var tab = args.tabs[args.activeTab];
|
||||||
var isMultiple = tab.multiple;
|
var isMultiple = tab.multiple;
|
||||||
|
|
||||||
uiActions.standard($detailView, args, {
|
uiActions.standard($detailView, args, {
|
||||||
noRefresh: true,
|
noRefresh: true,
|
||||||
complete: function(args, args2) {
|
complete: function(args, args2) {
|
||||||
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
|
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
|
||||||
if (isMultiple && $detailView.is(':visible')) {
|
if (isMultiple && $detailView.is(':visible')) {
|
||||||
$detailView.find('.refresh').click(); // Reload tab
|
$detailView.find('.refresh').click(); // Reload tab
|
||||||
} else {
|
} else {
|
||||||
var $browser = $('#browser .container');
|
var $browser = $('#browser .container');
|
||||||
var $panel = $detailView.closest('.panel');
|
var $panel = $detailView.closest('.panel');
|
||||||
|
|
||||||
if ($detailView.is(':visible')) {
|
if ($detailView.is(':visible')) {
|
||||||
$browser.cloudBrowser('selectPanel', {
|
$browser.cloudBrowser('selectPanel', {
|
||||||
panel: $panel.prev()
|
panel: $panel.prev()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($detailView.data("list-view-row") != null) {
|
if ($detailView.data("list-view-row") != null) {
|
||||||
var $row = $detailView.data('list-view-row');
|
var $row = $detailView.data('list-view-row');
|
||||||
var $tbody = $row.closest('tbody');
|
var $tbody = $row.closest('tbody');
|
||||||
|
|
||||||
$row.remove();
|
$row.remove();
|
||||||
if (!$tbody.find('tr').size()) {
|
if (!$tbody.find('tr').size()) {
|
||||||
$("<tr>").addClass('empty').append(
|
$("<tr>").addClass('empty').append(
|
||||||
@ -427,8 +427,8 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert editable fields to text boxes; clicking again saves data
|
* Convert editable fields to text boxes; clicking again saves data
|
||||||
*
|
*
|
||||||
|
|||||||
@ -21,7 +21,7 @@
|
|||||||
var uiActions = {
|
var uiActions = {
|
||||||
standard: function($instanceRow, args, additional) {
|
standard: function($instanceRow, args, additional) {
|
||||||
var isAddAction = args.action.isAdd;
|
var isAddAction = args.action.isAdd;
|
||||||
|
|
||||||
var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
|
var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
|
||||||
var notification = args.action.notification ? args.action.notification : {};
|
var notification = args.action.notification ? args.action.notification : {};
|
||||||
var messages = args.action ? args.action.messages : {};
|
var messages = args.action ? args.action.messages : {};
|
||||||
@ -366,7 +366,7 @@
|
|||||||
error: function(message) {
|
error: function(message) {
|
||||||
$instanceRow.removeClass('loading');
|
$instanceRow.removeClass('loading');
|
||||||
$instanceRow.find('td.quick-view').removeClass('loading-overlay');
|
$instanceRow.find('td.quick-view').removeClass('loading-overlay');
|
||||||
|
|
||||||
if (!isHeader) {
|
if (!isHeader) {
|
||||||
if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') ||
|
if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') ||
|
||||||
(!args.action.createForm && args.action.addRow == 'true')) {
|
(!args.action.createForm && args.action.addRow == 'true')) {
|
||||||
@ -629,10 +629,10 @@
|
|||||||
showEditField();
|
showEditField();
|
||||||
} else if ($editInput.val() != $label.html()) { //click Save button with changed value
|
} else if ($editInput.val() != $label.html()) { //click Save button with changed value
|
||||||
if ($editInput.val().match(/<|>/)) {
|
if ($editInput.val().match(/<|>/)) {
|
||||||
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
|
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$edit.animate({
|
$edit.animate({
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
});
|
});
|
||||||
@ -1148,7 +1148,7 @@
|
|||||||
|
|
||||||
$td.attr('title', _s(content));
|
$td.attr('title', _s(content));
|
||||||
});
|
});
|
||||||
|
|
||||||
var $first = $tr.find('td:first');
|
var $first = $tr.find('td:first');
|
||||||
if (multiSelect)
|
if (multiSelect)
|
||||||
$first = $first.next();
|
$first = $first.next();
|
||||||
@ -1208,15 +1208,15 @@
|
|||||||
rowActions[actionName]($tr);
|
rowActions[actionName]($tr);
|
||||||
var map1 = {};
|
var map1 = {};
|
||||||
$tr.closest('tbody').find('tr').each(function() {
|
$tr.closest('tbody').find('tr').each(function() {
|
||||||
/*
|
/*
|
||||||
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
|
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
|
||||||
* e.g. An Template/ISO of multiple zones have the same UUID.
|
* e.g. An Template/ISO of multiple zones have the same UUID.
|
||||||
*/
|
*/
|
||||||
var objId = $(this).data('json-obj').id;
|
var objId = $(this).data('json-obj').id;
|
||||||
if(!(objId in map1)) {
|
if(!(objId in map1)) {
|
||||||
sort($(this), action);
|
sort($(this), action);
|
||||||
map1[objId] = 1;
|
map1[objId] = 1;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$tr.closest('.data-table').dataTable('selectRow', $tr.index());
|
$tr.closest('.data-table').dataTable('selectRow', $tr.index());
|
||||||
|
|
||||||
@ -1238,12 +1238,12 @@
|
|||||||
rowActions._std($tr, function() {});
|
rowActions._std($tr, function() {});
|
||||||
var map1 = {};
|
var map1 = {};
|
||||||
$tr.closest('tbody').find('tr').each(function() {
|
$tr.closest('tbody').find('tr').each(function() {
|
||||||
/*
|
/*
|
||||||
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
|
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
|
||||||
* e.g. An Template/ISO of multiple zones have the same UUID.
|
* e.g. An Template/ISO of multiple zones have the same UUID.
|
||||||
*/
|
*/
|
||||||
var objId = $(this).data('json-obj').id;
|
var objId = $(this).data('json-obj').id;
|
||||||
if(!(objId in map1)) {
|
if(!(objId in map1)) {
|
||||||
sort($(this), reorder.moveDrag);
|
sort($(this), reorder.moveDrag);
|
||||||
map1[objId] = 1;
|
map1[objId] = 1;
|
||||||
}
|
}
|
||||||
@ -1355,7 +1355,7 @@
|
|||||||
$select.hide();
|
$select.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
$select.find('option:first').attr('selected', 'selected');
|
$select.find('option:first').attr('selected', 'selected');
|
||||||
$listView.find('.data-table').dataTable('refresh');
|
$listView.find('.data-table').dataTable('refresh');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1801,7 +1801,7 @@
|
|||||||
noActionCol: listViewData.noActionCol
|
noActionCol: listViewData.noActionCol
|
||||||
});
|
});
|
||||||
createFilters($toolbar, listViewData.filters);
|
createFilters($toolbar, listViewData.filters);
|
||||||
|
|
||||||
if (listViewData.hideSearchBar != true) {
|
if (listViewData.hideSearchBar != true) {
|
||||||
createSearchBar($toolbar, listViewData);
|
createSearchBar($toolbar, listViewData);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -90,7 +90,7 @@
|
|||||||
if (isHidden) {
|
if (isHidden) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $td = $('<td>').addClass(fieldName).appendTo($tr);
|
var $td = $('<td>').addClass(fieldName).appendTo($tr);
|
||||||
var $input, val;
|
var $input, val;
|
||||||
var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone();
|
var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone();
|
||||||
@ -280,7 +280,7 @@
|
|||||||
|
|
||||||
// Align width to main header
|
// Align width to main header
|
||||||
_medit.refreshItemWidths($multi);
|
_medit.refreshItemWidths($multi);
|
||||||
|
|
||||||
if (data._hideFields &&
|
if (data._hideFields &&
|
||||||
$.inArray(fieldName, data._hideFields) > -1) {
|
$.inArray(fieldName, data._hideFields) > -1) {
|
||||||
$td.addClass('disabled');
|
$td.addClass('disabled');
|
||||||
@ -712,7 +712,7 @@
|
|||||||
|
|
||||||
itemRow: function(item, itemActions, multiRule, $tbody) {
|
itemRow: function(item, itemActions, multiRule, $tbody) {
|
||||||
var $tr = $('<tr>');
|
var $tr = $('<tr>');
|
||||||
|
|
||||||
var itemName = multiRule._itemName ? item[multiRule._itemName] : item.name;
|
var itemName = multiRule._itemName ? item[multiRule._itemName] : item.name;
|
||||||
var $itemName = $('<span>').html(_s(itemName));
|
var $itemName = $('<span>').html(_s(itemName));
|
||||||
|
|
||||||
@ -727,14 +727,14 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var itemIp = multiRule._itemIp ? item[multiRule._itemIp] : null;
|
var itemIp = multiRule._itemIp ? item[multiRule._itemIp] : null;
|
||||||
if (itemIp != null) {
|
if (itemIp != null) {
|
||||||
var $itemIp = $('<span>').html(_s(itemIp));
|
var $itemIp = $('<span>').html(_s(itemIp));
|
||||||
$tr.append($('<td>').addClass('state').appendTo($tr).append($itemIp));
|
$tr.append($('<td>').addClass('state').appendTo($tr).append($itemIp));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
var itemState = item._itemState ? item._itemState : item.state;
|
var itemState = item._itemState ? item._itemState : item.state;
|
||||||
|
|
||||||
$tr.append($('<td>').addClass('state').appendTo($tr).append(
|
$tr.append($('<td>').addClass('state').appendTo($tr).append(
|
||||||
@ -993,7 +993,7 @@
|
|||||||
.appendTo($td);
|
.appendTo($td);
|
||||||
|
|
||||||
if (field.validation) {
|
if (field.validation) {
|
||||||
$td.find('input').first().data("validation-settings", field.validation );
|
$td.find('input').first().data("validation-settings", field.validation );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.isDisabled) $input.hide();
|
if (field.isDisabled) $input.hide();
|
||||||
|
|||||||
@ -31,7 +31,7 @@
|
|||||||
subselect: {
|
subselect: {
|
||||||
isMultiple: true,
|
isMultiple: true,
|
||||||
label: 'label.use.vm.ip',
|
label: 'label.use.vm.ip',
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var instance = args.context.instances[0];
|
var instance = args.context.instances[0];
|
||||||
var network = args.context.networks[0];
|
var network = args.context.networks[0];
|
||||||
|
|
||||||
@ -41,7 +41,7 @@
|
|||||||
virtualmachineid: instance.id,
|
virtualmachineid: instance.id,
|
||||||
nicId: instance.nic[0].id
|
nicId: instance.nic[0].id
|
||||||
},
|
},
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var nic = json.listnicsresponse.nic[0];
|
var nic = json.listnicsresponse.nic[0];
|
||||||
var primaryIp = nic.ipaddress;
|
var primaryIp = nic.ipaddress;
|
||||||
var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
|
var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
|
||||||
@ -126,14 +126,14 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
/*
|
/*
|
||||||
* path 1: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > click on a grid row (Details tab) > click "Assign VMs" tab > click Assign VMs" button on top of list
|
* path 1: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > click on a grid row (Details tab) > click "Assign VMs" tab > click Assign VMs" button on top of list
|
||||||
* path 2: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > "QuickView" on a grid row > click "Assign VMs" button in QuickView
|
* path 2: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > "QuickView" on a grid row > click "Assign VMs" button in QuickView
|
||||||
*/
|
*/
|
||||||
var $rows = $(':ui-dialog .list-view tbody tr');
|
var $rows = $(':ui-dialog .list-view tbody tr');
|
||||||
var vms = args.context.instances;
|
var vms = args.context.instances;
|
||||||
|
|
||||||
// Assign subselect values
|
// Assign subselect values
|
||||||
$(vms).each(function() {
|
$(vms).each(function() {
|
||||||
var vm = this;
|
var vm = this;
|
||||||
@ -155,41 +155,41 @@
|
|||||||
};
|
};
|
||||||
*/
|
*/
|
||||||
//virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the lines above.
|
//virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the lines above.
|
||||||
|
|
||||||
|
|
||||||
var inputData = {
|
var inputData = {
|
||||||
id: args.context.internalLoadBalancers[0].id
|
id: args.context.internalLoadBalancers[0].id
|
||||||
};
|
};
|
||||||
/*
|
/*
|
||||||
* e.g. first VM(xxx) has two IPs(10.1.1.~), second VM(yyy) has three IPs(10.2.2.~):
|
* e.g. first VM(xxx) has two IPs(10.1.1.~), second VM(yyy) has three IPs(10.2.2.~):
|
||||||
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
|
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
|
||||||
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
|
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
|
||||||
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
|
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
|
||||||
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
|
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
|
||||||
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
|
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
|
||||||
*/
|
*/
|
||||||
var selectedVMs = vms;
|
var selectedVMs = vms;
|
||||||
if (selectedVMs != null) {
|
if (selectedVMs != null) {
|
||||||
var vmidipmapIndex = 0;
|
var vmidipmapIndex = 0;
|
||||||
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
|
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
|
||||||
var selectedIPs = selectedVMs[vmIndex]._subselect;
|
var selectedIPs = selectedVMs[vmIndex]._subselect;
|
||||||
for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
|
for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
|
||||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
|
inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
|
||||||
|
|
||||||
//"ipAddresses" is not in args.context since this LB rule is under a VPC, not an address.
|
//"ipAddresses" is not in args.context since this LB rule is under a VPC, not an address.
|
||||||
/*
|
/*
|
||||||
if (args.context.ipAddresses[0].isportable) {
|
if (args.context.ipAddresses[0].isportable) {
|
||||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
|
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
|
||||||
} else {
|
} else {
|
||||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
||||||
|
|
||||||
vmidipmapIndex++;
|
vmidipmapIndex++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('assignToLoadBalancerRule'),
|
url: createURL('assignToLoadBalancerRule'),
|
||||||
@ -211,10 +211,10 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
var aclMultiEdit = {
|
var aclMultiEdit = {
|
||||||
noSelect: true,
|
noSelect: true,
|
||||||
|
|
||||||
reorder: {
|
reorder: {
|
||||||
moveDrag: {
|
moveDrag: {
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
@ -1192,12 +1192,12 @@
|
|||||||
label: 'label.id'
|
label: 'label.id'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dataProvider: function(args) {
|
dataProvider: function(args) {
|
||||||
var data = {
|
var data = {
|
||||||
vpcid: args.context.vpc[0].id
|
vpcid: args.context.vpc[0].id
|
||||||
};
|
};
|
||||||
listViewDataProvider(args, data);
|
listViewDataProvider(args, data);
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listNetworkACLLists'),
|
url: createURL('listNetworkACLLists'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -2281,7 +2281,7 @@
|
|||||||
if (this.id == args.context.vpcGateways[0].aclid) {
|
if (this.id == args.context.vpcGateways[0].aclid) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
items.push({
|
items.push({
|
||||||
id: this.id,
|
id: this.id,
|
||||||
description: this.name
|
description: this.name
|
||||||
@ -2289,7 +2289,7 @@
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
@ -2412,13 +2412,13 @@
|
|||||||
success: function(json) {
|
success: function(json) {
|
||||||
var objs = json.listnetworkacllistsresponse.networkacllist;
|
var objs = json.listnetworkacllistsresponse.networkacllist;
|
||||||
var acl = $.grep(objs, function(obj) {
|
var acl = $.grep(objs, function(obj) {
|
||||||
return obj.id === args.context.vpcGateways[0].aclid;
|
return obj.id === args.context.vpcGateways[0].aclid;
|
||||||
});
|
});
|
||||||
|
|
||||||
item.aclName = acl[0] ? acl[0].name : 'None';
|
item.aclName = acl[0] ? acl[0].name : 'None';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: item,
|
data: item,
|
||||||
actionFilter: function(args) {
|
actionFilter: function(args) {
|
||||||
@ -2813,12 +2813,12 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
passive: {
|
passive: {
|
||||||
label: 'label.passive',
|
label: 'label.passive',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isChecked: false
|
isChecked: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
@ -2882,10 +2882,10 @@
|
|||||||
passive: {
|
passive: {
|
||||||
label: 'label.passive',
|
label: 'label.passive',
|
||||||
converter: cloudStack.converters.toBooleanText
|
converter: cloudStack.converters.toBooleanText
|
||||||
},
|
},
|
||||||
publicip: {
|
publicip: {
|
||||||
label: 'label.ip.address'
|
label: 'label.ip.address'
|
||||||
},
|
},
|
||||||
gateway: {
|
gateway: {
|
||||||
label: 'label.gateway'
|
label: 'label.gateway'
|
||||||
},
|
},
|
||||||
@ -3353,29 +3353,29 @@
|
|||||||
|
|
||||||
tabFilter: function(args) {
|
tabFilter: function(args) {
|
||||||
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
|
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
|
||||||
|
|
||||||
var networkOfferingHavingELB = false;
|
var networkOfferingHavingELB = false;
|
||||||
var services = args.context.networks[0].service;
|
var services = args.context.networks[0].service;
|
||||||
if(services != null) {
|
if(services != null) {
|
||||||
for(var i = 0; i < services.length; i++) {
|
for(var i = 0; i < services.length; i++) {
|
||||||
if (services[i].name == "Lb") {
|
if (services[i].name == "Lb") {
|
||||||
var capabilities = services[i].capability;
|
var capabilities = services[i].capability;
|
||||||
if(capabilities != null) {
|
if(capabilities != null) {
|
||||||
for(var k = 0; k < capabilities.length; k++) {
|
for(var k = 0; k < capabilities.length; k++) {
|
||||||
if(capabilities[k].name == "ElasticLb") {
|
if(capabilities[k].name == "ElasticLb") {
|
||||||
networkOfferingHavingELB = true;
|
networkOfferingHavingELB = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (networkOfferingHavingELB == false) {
|
if (networkOfferingHavingELB == false) {
|
||||||
hiddenTabs.push("addloadBalancer");
|
hiddenTabs.push("addloadBalancer");
|
||||||
}
|
}
|
||||||
|
|
||||||
return hiddenTabs;
|
return hiddenTabs;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -3490,13 +3490,13 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//include currently selected network offeirng to dropdown
|
//include currently selected network offeirng to dropdown
|
||||||
items.push({
|
items.push({
|
||||||
id: args.context.networks[0].networkofferingid,
|
id: args.context.networks[0].networkofferingid,
|
||||||
description: args.context.networks[0].networkofferingdisplaytext
|
description: args.context.networks[0].networkofferingdisplaytext
|
||||||
});
|
});
|
||||||
|
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
@ -3975,7 +3975,7 @@
|
|||||||
zoneid: {
|
zoneid: {
|
||||||
label: 'label.zone',
|
label: 'label.zone',
|
||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
isHidden: true,
|
isHidden: true,
|
||||||
|
|
||||||
|
|||||||
@ -34,15 +34,15 @@
|
|||||||
physicalNetworkID = zoneType == 'Advanced' ? physicalNetworkID : 0;
|
physicalNetworkID = zoneType == 'Advanced' ? physicalNetworkID : 0;
|
||||||
var physicalNetwork = data.physicalNetworks ? data.physicalNetworks[physicalNetworkID] : null;
|
var physicalNetwork = data.physicalNetworks ? data.physicalNetworks[physicalNetworkID] : null;
|
||||||
var trafficConfig = physicalNetwork ? physicalNetwork.trafficTypeConfiguration[trafficTypeID] : null;
|
var trafficConfig = physicalNetwork ? physicalNetwork.trafficTypeConfiguration[trafficTypeID] : null;
|
||||||
|
|
||||||
var trafficLabel;
|
var trafficLabel;
|
||||||
if (trafficConfig != null) {
|
if (trafficConfig != null) {
|
||||||
if ('label' in trafficConfig) {
|
if ('label' in trafficConfig) {
|
||||||
trafficLabel = trafficConfig.label;
|
trafficLabel = trafficConfig.label;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
trafficLabel = '';
|
trafficLabel = '';
|
||||||
|
|
||||||
if ('vSwitchName' in trafficConfig) {
|
if ('vSwitchName' in trafficConfig) {
|
||||||
trafficLabel += trafficConfig.vSwitchName;
|
trafficLabel += trafficConfig.vSwitchName;
|
||||||
}
|
}
|
||||||
@ -56,17 +56,17 @@
|
|||||||
trafficLabel += ',';
|
trafficLabel += ',';
|
||||||
trafficLabel += trafficConfig.vSwitchType;
|
trafficLabel += trafficConfig.vSwitchType;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trafficLabel.length == 0) { //trafficLabel == ''
|
if (trafficLabel.length == 0) { //trafficLabel == ''
|
||||||
trafficLabel = null;
|
trafficLabel = null;
|
||||||
} else if (trafficLabel.length >= 1) {
|
} else if (trafficLabel.length >= 1) {
|
||||||
if (trafficLabel.charAt(trafficLabel.length-1) == ',') { //if last character is comma
|
if (trafficLabel.charAt(trafficLabel.length-1) == ',') { //if last character is comma
|
||||||
trafficLabel = trafficLabel.substring(0, trafficLabel.length - 1); //remove the last character (which is comma)
|
trafficLabel = trafficLabel.substring(0, trafficLabel.length - 1); //remove the last character (which is comma)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var hypervisorAttr, trafficLabelStr;
|
var hypervisorAttr, trafficLabelStr;
|
||||||
|
|
||||||
switch (hypervisor) {
|
switch (hypervisor) {
|
||||||
@ -503,10 +503,10 @@
|
|||||||
nonSupportedHypervisors["Ovm3"] = 1;
|
nonSupportedHypervisors["Ovm3"] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.context.zones[0]['network-model'] == "Advanced") { //CLOUDSTACK-7681: UI > zone wizard > Advanced zone > hypervisor => do not support BareMetal
|
if (args.context.zones[0]['network-model'] == "Advanced") { //CLOUDSTACK-7681: UI > zone wizard > Advanced zone > hypervisor => do not support BareMetal
|
||||||
nonSupportedHypervisors["BareMetal"] = 1;
|
nonSupportedHypervisors["BareMetal"] = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (items != null) {
|
if (items != null) {
|
||||||
for (var i = 0; i < items.length; i++) {
|
for (var i = 0; i < items.length; i++) {
|
||||||
if (items[i].name in nonSupportedHypervisors)
|
if (items[i].name in nonSupportedHypervisors)
|
||||||
@ -645,10 +645,10 @@
|
|||||||
required: false
|
required: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isdedicated: {
|
isdedicated: {
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
label: 'label.dedicated',
|
label: 'label.dedicated',
|
||||||
isChecked: false
|
isChecked: false
|
||||||
},
|
},
|
||||||
domain: {
|
domain: {
|
||||||
label: 'label.domain',
|
label: 'label.domain',
|
||||||
@ -963,7 +963,7 @@
|
|||||||
if ($(this).val() == "VMware") {
|
if ($(this).val() == "VMware") {
|
||||||
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
|
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
|
||||||
if (dvSwitchEnabled) {
|
if (dvSwitchEnabled) {
|
||||||
/*
|
/*
|
||||||
$fields.filter('[rel=vSwitchPublicType]').css('display', 'inline-block');
|
$fields.filter('[rel=vSwitchPublicType]').css('display', 'inline-block');
|
||||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
|
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
|
||||||
|
|
||||||
@ -983,7 +983,7 @@
|
|||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
|
||||||
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
|
||||||
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
|
||||||
@ -1139,7 +1139,7 @@
|
|||||||
dependsOn: 'overridepublictraffic'
|
dependsOn: 'overridepublictraffic'
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vSwitchPublicName: {
|
vSwitchPublicName: {
|
||||||
label: 'Public Traffic vSwitch Name',
|
label: 'Public Traffic vSwitch Name',
|
||||||
@ -1147,7 +1147,7 @@
|
|||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
overrideguesttraffic: {
|
overrideguesttraffic: {
|
||||||
label: 'label.override.guest.traffic',
|
label: 'label.override.guest.traffic',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
@ -1221,7 +1221,7 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
vSwitchGuestName: {
|
vSwitchGuestName: {
|
||||||
label: 'Guest Traffic vSwitch Name',
|
label: 'Guest Traffic vSwitch Name',
|
||||||
@ -1569,7 +1569,7 @@
|
|||||||
items.push({
|
items.push({
|
||||||
id: "nfs",
|
id: "nfs",
|
||||||
description: "nfs"
|
description: "nfs"
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
id: "SharedMountPoint",
|
id: "SharedMountPoint",
|
||||||
description: "SharedMountPoint"
|
description: "SharedMountPoint"
|
||||||
@ -1590,7 +1590,7 @@
|
|||||||
items.push({
|
items.push({
|
||||||
id: "nfs",
|
id: "nfs",
|
||||||
description: "nfs"
|
description: "nfs"
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
id: "PreSetup",
|
id: "PreSetup",
|
||||||
description: "PreSetup"
|
description: "PreSetup"
|
||||||
@ -1607,7 +1607,7 @@
|
|||||||
items.push({
|
items.push({
|
||||||
id: "nfs",
|
id: "nfs",
|
||||||
description: "nfs"
|
description: "nfs"
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
id: "vmfs",
|
id: "vmfs",
|
||||||
description: "vmfs"
|
description: "vmfs"
|
||||||
@ -1615,8 +1615,8 @@
|
|||||||
args.response.success({
|
args.response.success({
|
||||||
data: items
|
data: items
|
||||||
});
|
});
|
||||||
} else if (selectedClusterObj.hypervisortype == "Hyperv") {
|
} else if (selectedClusterObj.hypervisortype == "Hyperv") {
|
||||||
var items = [];
|
var items = [];
|
||||||
items.push({
|
items.push({
|
||||||
id: "SMB",
|
id: "SMB",
|
||||||
description: "SMB/CIFS"
|
description: "SMB/CIFS"
|
||||||
@ -1629,7 +1629,7 @@
|
|||||||
items.push({
|
items.push({
|
||||||
id: "nfs",
|
id: "nfs",
|
||||||
description: "nfs"
|
description: "nfs"
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
id: "ocfs2",
|
id: "ocfs2",
|
||||||
description: "ocfs2"
|
description: "ocfs2"
|
||||||
@ -1642,7 +1642,7 @@
|
|||||||
items.push({
|
items.push({
|
||||||
id: "nfs",
|
id: "nfs",
|
||||||
description: "nfs"
|
description: "nfs"
|
||||||
});
|
});
|
||||||
items.push({
|
items.push({
|
||||||
id: "SharedMountPoint",
|
id: "SharedMountPoint",
|
||||||
description: "SharedMountPoint"
|
description: "SharedMountPoint"
|
||||||
@ -1675,154 +1675,154 @@
|
|||||||
if (protocol == null)
|
if (protocol == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (protocol == "nfs") {
|
if (protocol == "nfs") {
|
||||||
$form.find('[rel=server]').css('display', 'block');
|
$form.find('[rel=server]').css('display', 'block');
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
$form.find('[rel=path]').css('display', 'block');
|
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
|
||||||
$form.find('[rel=smbPassword]').hide();
|
|
||||||
$form.find('[rel=smbDomain]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
|
||||||
$form.find('[rel=lun]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
|
||||||
} else if (protocol == "SMB") { //"SMB" show almost the same fields as "nfs" does, except 3 more SMB-specific fields.
|
|
||||||
$form.find('[rel=server]').css('display', 'block');
|
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
|
||||||
|
|
||||||
$form.find('[rel=path]').css('display', 'block');
|
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').css('display', 'block');
|
|
||||||
$form.find('[rel=smbPassword]').css('display', 'block');
|
|
||||||
$form.find('[rel=smbDomain]').css('display', 'block');
|
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
|
||||||
$form.find('[rel=lun]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
|
||||||
} else if (protocol == "ocfs2") { //ocfs2 is the same as nfs, except no server field.
|
|
||||||
$form.find('[rel=server]').hide();
|
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
|
||||||
|
|
||||||
$form.find('[rel=path]').css('display', 'block');
|
$form.find('[rel=path]').css('display', 'block');
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
$form.find('[rel=iqn]').hide();
|
||||||
$form.find('[rel=lun]').hide();
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
$form.find('[rel=glustervolume]').hide();
|
||||||
} else if (protocol == "PreSetup") {
|
} else if (protocol == "SMB") { //"SMB" show almost the same fields as "nfs" does, except 3 more SMB-specific fields.
|
||||||
$form.find('[rel=server]').hide();
|
$form.find('[rel=server]').css('display', 'block');
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
|
||||||
|
|
||||||
$form.find('[rel=path]').css('display', 'block');
|
|
||||||
$form.find('[rel=path]').find(".name").find("label").html('<span class=\"field-required\">*</span>'+_l('label.SR.name')+':');
|
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
|
||||||
$form.find('[rel=smbPassword]').hide();
|
|
||||||
$form.find('[rel=smbDomain]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
|
||||||
$form.find('[rel=lun]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
|
||||||
} else if (protocol == "iscsi") {
|
|
||||||
$form.find('[rel=server]').css('display', 'block');
|
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
$form.find('[rel=path]').hide();
|
$form.find('[rel=path]').css('display', 'block');
|
||||||
|
|
||||||
|
$form.find('[rel=smbUsername]').css('display', 'block');
|
||||||
|
$form.find('[rel=smbPassword]').css('display', 'block');
|
||||||
|
$form.find('[rel=smbDomain]').css('display', 'block');
|
||||||
|
|
||||||
|
$form.find('[rel=iqn]').hide();
|
||||||
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=glustervolume]').hide();
|
||||||
|
} else if (protocol == "ocfs2") { //ocfs2 is the same as nfs, except no server field.
|
||||||
|
$form.find('[rel=server]').hide();
|
||||||
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
|
$form.find('[rel=path]').css('display', 'block');
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=iqn]').hide();
|
||||||
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=glustervolume]').hide();
|
||||||
|
} else if (protocol == "PreSetup") {
|
||||||
|
$form.find('[rel=server]').hide();
|
||||||
|
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
||||||
|
|
||||||
|
$form.find('[rel=path]').css('display', 'block');
|
||||||
|
$form.find('[rel=path]').find(".name").find("label").html('<span class=\"field-required\">*</span>'+_l('label.SR.name')+':');
|
||||||
|
|
||||||
|
$form.find('[rel=smbUsername]').hide();
|
||||||
|
$form.find('[rel=smbPassword]').hide();
|
||||||
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=iqn]').hide();
|
||||||
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=glustervolume]').hide();
|
||||||
|
} else if (protocol == "iscsi") {
|
||||||
|
$form.find('[rel=server]').css('display', 'block');
|
||||||
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
|
$form.find('[rel=path]').hide();
|
||||||
|
|
||||||
|
$form.find('[rel=smbUsername]').hide();
|
||||||
|
$form.find('[rel=smbPassword]').hide();
|
||||||
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').css('display', 'block');
|
$form.find('[rel=iqn]').css('display', 'block');
|
||||||
$form.find('[rel=lun]').css('display', 'block');
|
$form.find('[rel=lun]').css('display', 'block');
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
$form.find('[rel=glustervolume]').hide();
|
||||||
} else if ($(this).val() == "clvm") {
|
} else if ($(this).val() == "clvm") {
|
||||||
$form.find('[rel=server]').hide();
|
$form.find('[rel=server]').hide();
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
||||||
|
|
||||||
$form.find('[rel=path]').hide();
|
$form.find('[rel=path]').hide();
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
$form.find('[rel=iqn]').hide();
|
||||||
$form.find('[rel=lun]').hide();
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').css('display', 'inline-block');
|
$form.find('[rel=volumegroup]').css('display', 'inline-block');
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
$form.find('[rel=glustervolume]').hide();
|
||||||
} else if (protocol == "vmfs") {
|
} else if (protocol == "vmfs") {
|
||||||
$form.find('[rel=server]').css('display', 'block');
|
$form.find('[rel=server]').css('display', 'block');
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
$form.find('[rel=path]').hide();
|
$form.find('[rel=path]').hide();
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
$form.find('[rel=iqn]').hide();
|
||||||
$form.find('[rel=lun]').hide();
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').css('display', 'block');
|
$form.find('[rel=vCenterDataCenter]').css('display', 'block');
|
||||||
$form.find('[rel=vCenterDataStore]').css('display', 'block');
|
$form.find('[rel=vCenterDataStore]').css('display', 'block');
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').hide();
|
$form.find('[rel=glustervolume]').hide();
|
||||||
} else if (protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does.
|
} else if (protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does.
|
||||||
$form.find('[rel=server]').hide();
|
$form.find('[rel=server]').hide();
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
$form.find('[rel=server]').find(".value").find("input").val("localhost");
|
||||||
|
|
||||||
$form.find('[rel=path]').css('display', 'block');
|
$form.find('[rel=path]').css('display', 'block');
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
$form.find('[rel=iqn]').hide();
|
||||||
$form.find('[rel=lun]').hide();
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
@ -1832,7 +1832,7 @@
|
|||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
$form.find('[rel=path]').hide();
|
$form.find('[rel=path]').hide();
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
@ -1846,19 +1846,19 @@
|
|||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
$form.find('[rel=glustervolume]').css('display', 'block');
|
$form.find('[rel=glustervolume]').css('display', 'block');
|
||||||
} else {
|
} else {
|
||||||
$form.find('[rel=server]').css('display', 'block');
|
$form.find('[rel=server]').css('display', 'block');
|
||||||
$form.find('[rel=server]').find(".value").find("input").val("");
|
$form.find('[rel=server]').find(".value").find("input").val("");
|
||||||
|
|
||||||
$form.find('[rel=smbUsername]').hide();
|
$form.find('[rel=smbUsername]').hide();
|
||||||
$form.find('[rel=smbPassword]').hide();
|
$form.find('[rel=smbPassword]').hide();
|
||||||
$form.find('[rel=smbDomain]').hide();
|
$form.find('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
$form.find('[rel=iqn]').hide();
|
$form.find('[rel=iqn]').hide();
|
||||||
$form.find('[rel=lun]').hide();
|
$form.find('[rel=lun]').hide();
|
||||||
|
|
||||||
$form.find('[rel=volumegroup]').hide();
|
$form.find('[rel=volumegroup]').hide();
|
||||||
|
|
||||||
$form.find('[rel=vCenterDataCenter]').hide();
|
$form.find('[rel=vCenterDataCenter]').hide();
|
||||||
$form.find('[rel=vCenterDataStore]').hide();
|
$form.find('[rel=vCenterDataStore]').hide();
|
||||||
|
|
||||||
@ -1893,7 +1893,7 @@
|
|||||||
required: true
|
required: true
|
||||||
},
|
},
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
smbUsername: {
|
smbUsername: {
|
||||||
label: 'label.smb.username',
|
label: 'label.smb.username',
|
||||||
validation: {
|
validation: {
|
||||||
@ -1909,8 +1909,8 @@
|
|||||||
},
|
},
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
//iscsi
|
//iscsi
|
||||||
iqn: {
|
iqn: {
|
||||||
label: 'label.target.iqn',
|
label: 'label.target.iqn',
|
||||||
@ -1972,45 +1972,45 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
secondaryStorage: {
|
secondaryStorage: {
|
||||||
fields: {
|
fields: {
|
||||||
provider: {
|
provider: {
|
||||||
label: 'label.provider',
|
label: 'label.provider',
|
||||||
select: function(args) {
|
select: function(args) {
|
||||||
var storageproviders = [];
|
var storageproviders = [];
|
||||||
storageproviders.push({ id: '', description: ''});
|
storageproviders.push({ id: '', description: ''});
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listImageStores'),
|
url: createURL('listImageStores'),
|
||||||
data: {
|
data: {
|
||||||
provider: 'S3'
|
provider: 'S3'
|
||||||
},
|
},
|
||||||
async: true,
|
async: true,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var s3stores = json.listimagestoresresponse.imagestore;
|
var s3stores = json.listimagestoresresponse.imagestore;
|
||||||
if(s3stores != null && s3stores.length > 0) {
|
if(s3stores != null && s3stores.length > 0) {
|
||||||
storageproviders.push({ id: 'S3', description: 'S3'}); //if (region-wide) S3 store exists already, only "S3" option should be included here. Any other type of store is not allowed to be created since cloudstack doesn't support multiple types of store at this point.
|
storageproviders.push({ id: 'S3', description: 'S3'}); //if (region-wide) S3 store exists already, only "S3" option should be included here. Any other type of store is not allowed to be created since cloudstack doesn't support multiple types of store at this point.
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
UI no longer gets providers from "listStorageProviders&type=image" because:
|
UI no longer gets providers from "listStorageProviders&type=image" because:
|
||||||
(1) Not all of returned values are handled by UI (e.g. Provider "NetApp" is not handled by UI).
|
(1) Not all of returned values are handled by UI (e.g. Provider "NetApp" is not handled by UI).
|
||||||
(2) Provider "SMB" which is handled by UI is not returned from "listStorageProviders&type=image"
|
(2) Provider "SMB" which is handled by UI is not returned from "listStorageProviders&type=image"
|
||||||
*/
|
*/
|
||||||
storageproviders.push({ id: 'NFS', description: 'NFS'});
|
storageproviders.push({ id: 'NFS', description: 'NFS'});
|
||||||
storageproviders.push({ id: 'SMB', description: 'SMB/CIFS'});
|
storageproviders.push({ id: 'SMB', description: 'SMB/CIFS'});
|
||||||
storageproviders.push({ id: 'S3', description: 'S3'});
|
storageproviders.push({ id: 'S3', description: 'S3'});
|
||||||
storageproviders.push({ id: 'Swift', description: 'Swift'});
|
storageproviders.push({ id: 'Swift', description: 'Swift'});
|
||||||
}
|
}
|
||||||
args.response.success({
|
args.response.success({
|
||||||
data: storageproviders
|
data: storageproviders
|
||||||
});
|
});
|
||||||
|
|
||||||
args.$select.change(function() {
|
args.$select.change(function() {
|
||||||
var $form = $(this).closest('form');
|
var $form = $(this).closest('form');
|
||||||
var $fields = $form.find('.field');
|
var $fields = $form.find('.field');
|
||||||
|
|
||||||
if ($(this).val() == "") {
|
if ($(this).val() == "") {
|
||||||
$fields.filter('[rel=name]').hide();
|
$fields.filter('[rel=name]').hide();
|
||||||
|
|
||||||
//NFS
|
//NFS
|
||||||
$fields.filter('[rel=zoneid]').hide();
|
$fields.filter('[rel=zoneid]').hide();
|
||||||
$fields.filter('[rel=nfsServer]').hide();
|
$fields.filter('[rel=nfsServer]').hide();
|
||||||
@ -2020,7 +2020,7 @@
|
|||||||
$fields.filter('[rel=smbUsername]').hide();
|
$fields.filter('[rel=smbUsername]').hide();
|
||||||
$fields.filter('[rel=smbPassword]').hide();
|
$fields.filter('[rel=smbPassword]').hide();
|
||||||
$fields.filter('[rel=smbDomain]').hide();
|
$fields.filter('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
//S3
|
//S3
|
||||||
$fields.filter('[rel=accesskey]').hide();
|
$fields.filter('[rel=accesskey]').hide();
|
||||||
$fields.filter('[rel=secretkey]').hide();
|
$fields.filter('[rel=secretkey]').hide();
|
||||||
@ -2043,7 +2043,7 @@
|
|||||||
$fields.filter('[rel=key]').hide();
|
$fields.filter('[rel=key]').hide();
|
||||||
} else if ($(this).val() == "NFS") {
|
} else if ($(this).val() == "NFS") {
|
||||||
$fields.filter('[rel=name]').css('display', 'inline-block');
|
$fields.filter('[rel=name]').css('display', 'inline-block');
|
||||||
|
|
||||||
//NFS
|
//NFS
|
||||||
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
|
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
|
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
|
||||||
@ -2053,7 +2053,7 @@
|
|||||||
$fields.filter('[rel=smbUsername]').hide();
|
$fields.filter('[rel=smbUsername]').hide();
|
||||||
$fields.filter('[rel=smbPassword]').hide();
|
$fields.filter('[rel=smbPassword]').hide();
|
||||||
$fields.filter('[rel=smbDomain]').hide();
|
$fields.filter('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
//S3
|
//S3
|
||||||
$fields.filter('[rel=accesskey]').hide();
|
$fields.filter('[rel=accesskey]').hide();
|
||||||
$fields.filter('[rel=secretkey]').hide();
|
$fields.filter('[rel=secretkey]').hide();
|
||||||
@ -2076,7 +2076,7 @@
|
|||||||
$fields.filter('[rel=key]').hide();
|
$fields.filter('[rel=key]').hide();
|
||||||
} else if ($(this).val() == "SMB") {
|
} else if ($(this).val() == "SMB") {
|
||||||
$fields.filter('[rel=name]').css('display', 'inline-block');
|
$fields.filter('[rel=name]').css('display', 'inline-block');
|
||||||
|
|
||||||
//NFS
|
//NFS
|
||||||
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
|
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
|
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
|
||||||
@ -2086,7 +2086,7 @@
|
|||||||
$fields.filter('[rel=smbUsername]').css('display', 'inline-block');
|
$fields.filter('[rel=smbUsername]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=smbPassword]').css('display', 'inline-block');
|
$fields.filter('[rel=smbPassword]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=smbDomain]').css('display', 'inline-block');
|
$fields.filter('[rel=smbDomain]').css('display', 'inline-block');
|
||||||
|
|
||||||
//S3
|
//S3
|
||||||
$fields.filter('[rel=accesskey]').hide();
|
$fields.filter('[rel=accesskey]').hide();
|
||||||
$fields.filter('[rel=secretkey]').hide();
|
$fields.filter('[rel=secretkey]').hide();
|
||||||
@ -2109,15 +2109,15 @@
|
|||||||
$fields.filter('[rel=key]').hide();
|
$fields.filter('[rel=key]').hide();
|
||||||
} else if ($(this).val() == "S3") {
|
} else if ($(this).val() == "S3") {
|
||||||
$fields.filter('[rel=name]').css('display', 'inline-block');
|
$fields.filter('[rel=name]').css('display', 'inline-block');
|
||||||
|
|
||||||
if(s3stores != null && s3stores.length > 0) {
|
if(s3stores != null && s3stores.length > 0) {
|
||||||
$fields.filter('[rel=name]').find('input').val(s3stores[0].name);
|
$fields.filter('[rel=name]').find('input').val(s3stores[0].name);
|
||||||
$fields.filter('[rel=name]').find('input').attr("disabled", "disabled");
|
$fields.filter('[rel=name]').find('input').attr("disabled", "disabled");
|
||||||
} else {
|
} else {
|
||||||
//$fields.filter('[rel=name]').find('input').val("");
|
//$fields.filter('[rel=name]').find('input').val("");
|
||||||
$fields.filter('[rel=name]').find('input').removeAttr("disabled");
|
$fields.filter('[rel=name]').find('input').removeAttr("disabled");
|
||||||
}
|
}
|
||||||
|
|
||||||
//NFS
|
//NFS
|
||||||
$fields.filter('[rel=zoneid]').hide();
|
$fields.filter('[rel=zoneid]').hide();
|
||||||
$fields.filter('[rel=nfsServer]').hide();
|
$fields.filter('[rel=nfsServer]').hide();
|
||||||
@ -2127,7 +2127,7 @@
|
|||||||
$fields.filter('[rel=smbUsername]').hide();
|
$fields.filter('[rel=smbUsername]').hide();
|
||||||
$fields.filter('[rel=smbPassword]').hide();
|
$fields.filter('[rel=smbPassword]').hide();
|
||||||
$fields.filter('[rel=smbDomain]').hide();
|
$fields.filter('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
//S3
|
//S3
|
||||||
if(s3stores != null && s3stores.length > 0) {
|
if(s3stores != null && s3stores.length > 0) {
|
||||||
$fields.filter('[rel=accesskey]').hide();
|
$fields.filter('[rel=accesskey]').hide();
|
||||||
@ -2137,7 +2137,7 @@
|
|||||||
$fields.filter('[rel=usehttps]').hide();
|
$fields.filter('[rel=usehttps]').hide();
|
||||||
$fields.filter('[rel=connectiontimeout]').hide();
|
$fields.filter('[rel=connectiontimeout]').hide();
|
||||||
$fields.filter('[rel=maxerrorretry]').hide();
|
$fields.filter('[rel=maxerrorretry]').hide();
|
||||||
$fields.filter('[rel=sockettimeout]').hide();
|
$fields.filter('[rel=sockettimeout]').hide();
|
||||||
} else {
|
} else {
|
||||||
$fields.filter('[rel=accesskey]').css('display', 'inline-block');
|
$fields.filter('[rel=accesskey]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=secretkey]').css('display', 'inline-block');
|
$fields.filter('[rel=secretkey]').css('display', 'inline-block');
|
||||||
@ -2147,13 +2147,13 @@
|
|||||||
$fields.filter('[rel=connectiontimeout]').css('display', 'inline-block');
|
$fields.filter('[rel=connectiontimeout]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=maxerrorretry]').css('display', 'inline-block');
|
$fields.filter('[rel=maxerrorretry]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=sockettimeout]').css('display', 'inline-block');
|
$fields.filter('[rel=sockettimeout]').css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
$fields.filter('[rel=createNfsCache]').find('input').attr('checked', 'checked');
|
$fields.filter('[rel=createNfsCache]').find('input').attr('checked', 'checked');
|
||||||
$fields.filter('[rel=createNfsCache]').find('input').attr("disabled", "disabled"); //Create NFS staging is required for S3 at this moment. So, disallow user to uncheck "Create NFS Secondary Staging" checkbox
|
$fields.filter('[rel=createNfsCache]').find('input').attr("disabled", "disabled"); //Create NFS staging is required for S3 at this moment. So, disallow user to uncheck "Create NFS Secondary Staging" checkbox
|
||||||
$fields.filter('[rel=createNfsCache]').css('display', 'inline-block');
|
$fields.filter('[rel=createNfsCache]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=nfsCacheNfsServer]').css('display', 'inline-block');
|
$fields.filter('[rel=nfsCacheNfsServer]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=nfsCachePath]').css('display', 'inline-block');
|
$fields.filter('[rel=nfsCachePath]').css('display', 'inline-block');
|
||||||
|
|
||||||
//Swift
|
//Swift
|
||||||
$fields.filter('[rel=url]').hide();
|
$fields.filter('[rel=url]').hide();
|
||||||
$fields.filter('[rel=account]').hide();
|
$fields.filter('[rel=account]').hide();
|
||||||
@ -2161,7 +2161,7 @@
|
|||||||
$fields.filter('[rel=key]').hide();
|
$fields.filter('[rel=key]').hide();
|
||||||
} else if ($(this).val() == "Swift") {
|
} else if ($(this).val() == "Swift") {
|
||||||
$fields.filter('[rel=name]').css('display', 'inline-block');
|
$fields.filter('[rel=name]').css('display', 'inline-block');
|
||||||
|
|
||||||
//NFS
|
//NFS
|
||||||
$fields.filter('[rel=zoneid]').hide();
|
$fields.filter('[rel=zoneid]').hide();
|
||||||
$fields.filter('[rel=nfsServer]').hide();
|
$fields.filter('[rel=nfsServer]').hide();
|
||||||
@ -2171,7 +2171,7 @@
|
|||||||
$fields.filter('[rel=smbUsername]').hide();
|
$fields.filter('[rel=smbUsername]').hide();
|
||||||
$fields.filter('[rel=smbPassword]').hide();
|
$fields.filter('[rel=smbPassword]').hide();
|
||||||
$fields.filter('[rel=smbDomain]').hide();
|
$fields.filter('[rel=smbDomain]').hide();
|
||||||
|
|
||||||
//S3
|
//S3
|
||||||
$fields.filter('[rel=accesskey]').hide();
|
$fields.filter('[rel=accesskey]').hide();
|
||||||
$fields.filter('[rel=secretkey]').hide();
|
$fields.filter('[rel=secretkey]').hide();
|
||||||
@ -2193,10 +2193,10 @@
|
|||||||
$fields.filter('[rel=username]').css('display', 'inline-block');
|
$fields.filter('[rel=username]').css('display', 'inline-block');
|
||||||
$fields.filter('[rel=key]').css('display', 'inline-block');
|
$fields.filter('[rel=key]').css('display', 'inline-block');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
args.$select.change();
|
args.$select.change();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -2204,7 +2204,7 @@
|
|||||||
label: 'label.name',
|
label: 'label.name',
|
||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
|
|
||||||
//NFS, SMB (begin)
|
//NFS, SMB (begin)
|
||||||
nfsServer: {
|
nfsServer: {
|
||||||
label: 'label.server', //change label from "NFS Server" to "Server" since this field is also shown when provider "SMB/CIFS" is elected.
|
label: 'label.server', //change label from "NFS Server" to "Server" since this field is also shown when provider "SMB/CIFS" is elected.
|
||||||
@ -2223,7 +2223,7 @@
|
|||||||
//NFS, SMB (end)
|
//NFS, SMB (end)
|
||||||
|
|
||||||
|
|
||||||
//SMB (begin)
|
//SMB (begin)
|
||||||
smbDomain: {
|
smbDomain: {
|
||||||
label: 'label.smb.domain',
|
label: 'label.smb.domain',
|
||||||
validation: {
|
validation: {
|
||||||
@ -2242,9 +2242,9 @@
|
|||||||
validation: {
|
validation: {
|
||||||
required: true
|
required: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//SMB (end)
|
//SMB (end)
|
||||||
|
|
||||||
//S3 (begin)
|
//S3 (begin)
|
||||||
accesskey: {
|
accesskey: {
|
||||||
label: 'label.s3.access_key',
|
label: 'label.s3.access_key',
|
||||||
@ -2272,7 +2272,7 @@
|
|||||||
isHidden: true
|
isHidden: true
|
||||||
},
|
},
|
||||||
usehttps: {
|
usehttps: {
|
||||||
label: 'label.s3.use_https',
|
label: 'label.s3.use_https',
|
||||||
isBoolean: true,
|
isBoolean: true,
|
||||||
isChecked: true,
|
isChecked: true,
|
||||||
isHidden: true
|
isHidden: true
|
||||||
@ -2340,7 +2340,7 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
var $wizard = args.wizard;
|
var $wizard = args.wizard;
|
||||||
var formData = args.data;
|
var formData = args.data;
|
||||||
var advZoneConfiguredVirtualRouterCount = 0; //for multiple physical networks in advanced zone. Each physical network has 2 virtual routers: regular one and VPC one.
|
var advZoneConfiguredVirtualRouterCount = 0; //for multiple physical networks in advanced zone. Each physical network has 2 virtual routers: regular one and VPC one.
|
||||||
@ -2408,29 +2408,29 @@
|
|||||||
url: createURL("createZone" + array1.join("")),
|
url: createURL("createZone" + array1.join("")),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
if (args.data.pluginFrom == null) { //from zone wizard, not from quick instsaller(args.data.pluginFrom != null && args.data.pluginFrom.name == 'installWizard') who doesn't have public checkbox
|
if (args.data.pluginFrom == null) { //from zone wizard, not from quick instsaller(args.data.pluginFrom != null && args.data.pluginFrom.name == 'installWizard') who doesn't have public checkbox
|
||||||
if(args.data.zone.isdedicated == 'on'){ //dedicated checkbox in zone wizard is checked
|
if(args.data.zone.isdedicated == 'on'){ //dedicated checkbox in zone wizard is checked
|
||||||
message(dictionary['message.dedicate.zone']);
|
message(dictionary['message.dedicate.zone']);
|
||||||
var data = {
|
var data = {
|
||||||
zoneid: json.createzoneresponse.zone.id
|
zoneid: json.createzoneresponse.zone.id
|
||||||
};
|
};
|
||||||
if (args.data.zone.domain != null)
|
if (args.data.zone.domain != null)
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
domainid: args.data.zone.domain
|
domainid: args.data.zone.domain
|
||||||
});
|
});
|
||||||
if (args.data.zone.account != "")
|
if (args.data.zone.account != "")
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
account: args.data.zone.account
|
account: args.data.zone.account
|
||||||
});
|
});
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('dedicateZone'),
|
url: createURL('dedicateZone'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {}
|
success: function(json) {}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stepFns.addPhysicalNetworks({
|
stepFns.addPhysicalNetworks({
|
||||||
data: $.extend(args.data, {
|
data: $.extend(args.data, {
|
||||||
returnedZone: json.createzoneresponse.zone
|
returnedZone: json.createzoneresponse.zone
|
||||||
@ -3664,7 +3664,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// ***** VPC Virtual Router ***** (end) *****
|
// ***** VPC Virtual Router ***** (end) *****
|
||||||
} else { //args.data.zone.sgEnabled == true //Advanced SG-enabled zone
|
} else { //args.data.zone.sgEnabled == true //Advanced SG-enabled zone
|
||||||
message(_l('message.enabling.security.group.provider'));
|
message(_l('message.enabling.security.group.provider'));
|
||||||
|
|
||||||
// get network service provider ID of Security Group
|
// get network service provider ID of Security Group
|
||||||
@ -4377,23 +4377,23 @@
|
|||||||
if (args.data.cluster.vSwitchGuestType != "")
|
if (args.data.cluster.vSwitchGuestType != "")
|
||||||
array1.push('&guestvswitchtype=' + args.data.cluster.vSwitchGuestType);
|
array1.push('&guestvswitchtype=' + args.data.cluster.vSwitchGuestType);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
if (args.data.cluster.vSwitchGuestName != "")
|
if (args.data.cluster.vSwitchGuestName != "")
|
||||||
array1.push("&guestvswitchname=" + args.data.cluster.vSwitchGuestName);
|
array1.push("&guestvswitchname=" + args.data.cluster.vSwitchGuestName);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (args.data.cluster.vsmipaddress != null && args.data.cluster.vsmipaddress.length > 0) {
|
if (args.data.cluster.vsmipaddress != null && args.data.cluster.vsmipaddress.length > 0) {
|
||||||
array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress);
|
array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(args.data.cluster.vsmusername != null && args.data.cluster.vsmusername.length > 0) {
|
if(args.data.cluster.vsmusername != null && args.data.cluster.vsmusername.length > 0) {
|
||||||
array1.push('&vsmusername=' + args.data.cluster.vsmusername);
|
array1.push('&vsmusername=' + args.data.cluster.vsmusername);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(args.data.cluster.vsmpassword != null && args.data.cluster.vsmpassword.length > 0) {
|
if(args.data.cluster.vsmpassword != null && args.data.cluster.vsmpassword.length > 0) {
|
||||||
array1.push('&vsmpassword=' + args.data.cluster.vsmpassword);
|
array1.push('&vsmpassword=' + args.data.cluster.vsmpassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
var hostname = args.data.cluster.vCenterHost;
|
var hostname = args.data.cluster.vCenterHost;
|
||||||
var dcName = args.data.cluster.vCenterDatacenter;
|
var dcName = args.data.cluster.vCenterDatacenter;
|
||||||
@ -4459,7 +4459,7 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("addCluster" + array1.join("")),
|
url: createURL("addCluster" + array1.join("")),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
type: "POST",
|
type: "POST",
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
stepFns.addHost({
|
stepFns.addHost({
|
||||||
data: $.extend(args.data, {
|
data: $.extend(args.data, {
|
||||||
@ -4580,20 +4580,20 @@
|
|||||||
|
|
||||||
//zone-wide-primary-storage is supported only for KVM and VMWare
|
//zone-wide-primary-storage is supported only for KVM and VMWare
|
||||||
if (args.data.primaryStorage.scope == "zone") { //hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now.
|
if (args.data.primaryStorage.scope == "zone") { //hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now.
|
||||||
if(args.data.cluster.hypervisor != undefined) {
|
if(args.data.cluster.hypervisor != undefined) {
|
||||||
array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor));
|
array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor));
|
||||||
} else if(args.data.returnedCluster.hypervisortype != undefined) {
|
} else if(args.data.returnedCluster.hypervisortype != undefined) {
|
||||||
array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype));
|
array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype));
|
||||||
} else {
|
} else {
|
||||||
cloudStack.dialog.notice({
|
cloudStack.dialog.notice({
|
||||||
message: "Error: args.data.cluster.hypervisor is undefined. So is args.data.returnedCluster.hypervisortype (zone-wide-primary-storage)"
|
message: "Error: args.data.cluster.hypervisor is undefined. So is args.data.returnedCluster.hypervisortype (zone-wide-primary-storage)"
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var server = args.data.primaryStorage.server;
|
var server = args.data.primaryStorage.server;
|
||||||
var url = null;
|
var url = null;
|
||||||
if (args.data.primaryStorage.protocol == "nfs") {
|
if (args.data.primaryStorage.protocol == "nfs") {
|
||||||
var path = args.data.primaryStorage.path;
|
var path = args.data.primaryStorage.path;
|
||||||
if (path.substring(0, 1) != "/")
|
if (path.substring(0, 1) != "/")
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
@ -4606,33 +4606,33 @@
|
|||||||
array1.push("&details[0].user=" + args.data.primaryStorage.smbUsername);
|
array1.push("&details[0].user=" + args.data.primaryStorage.smbUsername);
|
||||||
array1.push("&details[1].password=" + todb(args.data.primaryStorage.smbPassword));
|
array1.push("&details[1].password=" + todb(args.data.primaryStorage.smbPassword));
|
||||||
array1.push("&details[2].domain=" + args.data.primaryStorage.smbDomain);
|
array1.push("&details[2].domain=" + args.data.primaryStorage.smbDomain);
|
||||||
} else if (args.data.primaryStorage.protocol == "PreSetup") {
|
} else if (args.data.primaryStorage.protocol == "PreSetup") {
|
||||||
var path = args.data.primaryStorage.path;
|
var path = args.data.primaryStorage.path;
|
||||||
if (path.substring(0, 1) != "/")
|
if (path.substring(0, 1) != "/")
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
url = presetupURL(server, path);
|
url = presetupURL(server, path);
|
||||||
} else if (args.data.primaryStorage.protocol == "ocfs2") {
|
} else if (args.data.primaryStorage.protocol == "ocfs2") {
|
||||||
var path = args.data.primaryStorage.path;
|
var path = args.data.primaryStorage.path;
|
||||||
if (path.substring(0, 1) != "/")
|
if (path.substring(0, 1) != "/")
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
url = ocfs2URL(server, path);
|
url = ocfs2URL(server, path);
|
||||||
} else if (args.data.primaryStorage.protocol == "SharedMountPoint") {
|
} else if (args.data.primaryStorage.protocol == "SharedMountPoint") {
|
||||||
var path = args.data.primaryStorage.path;
|
var path = args.data.primaryStorage.path;
|
||||||
if (path.substring(0, 1) != "/")
|
if (path.substring(0, 1) != "/")
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
url = SharedMountPointURL(server, path);
|
url = SharedMountPointURL(server, path);
|
||||||
} else if (args.data.primaryStorage.protocol == "clvm") {
|
} else if (args.data.primaryStorage.protocol == "clvm") {
|
||||||
var vg = args.data.primaryStorage.volumegroup;
|
var vg = args.data.primaryStorage.volumegroup;
|
||||||
if (vg.substring(0, 1) != "/")
|
if (vg.substring(0, 1) != "/")
|
||||||
vg = "/" + vg;
|
vg = "/" + vg;
|
||||||
url = clvmURL(vg);
|
url = clvmURL(vg);
|
||||||
} else if (args.data.primaryStorage.protocol == "vmfs") {
|
} else if (args.data.primaryStorage.protocol == "vmfs") {
|
||||||
var path = args.data.primaryStorage.vCenterDataCenter;
|
var path = args.data.primaryStorage.vCenterDataCenter;
|
||||||
if (path.substring(0, 1) != "/")
|
if (path.substring(0, 1) != "/")
|
||||||
path = "/" + path;
|
path = "/" + path;
|
||||||
path += "/" + args.data.primaryStorage.vCenterDataStore;
|
path += "/" + args.data.primaryStorage.vCenterDataStore;
|
||||||
url = vmfsURL("dummy", path);
|
url = vmfsURL("dummy", path);
|
||||||
} else {
|
} else {
|
||||||
var iqn = args.data.primaryStorage.iqn;
|
var iqn = args.data.primaryStorage.iqn;
|
||||||
if (iqn.substring(0, 1) != "/")
|
if (iqn.substring(0, 1) != "/")
|
||||||
iqn = "/" + iqn;
|
iqn = "/" + iqn;
|
||||||
@ -4668,11 +4668,11 @@
|
|||||||
if (args.data.secondaryStorage.provider == '') {
|
if (args.data.secondaryStorage.provider == '') {
|
||||||
complete({
|
complete({
|
||||||
data: args.data
|
data: args.data
|
||||||
});
|
});
|
||||||
return; //skip addSecondaryStorage if provider dropdown is blank
|
return; //skip addSecondaryStorage if provider dropdown is blank
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message(_l('message.creating.secondary.storage'));
|
message(_l('message.creating.secondary.storage'));
|
||||||
|
|
||||||
var data = {};
|
var data = {};
|
||||||
@ -4746,12 +4746,12 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (args.data.secondaryStorage.provider == 'S3') {
|
} else if (args.data.secondaryStorage.provider == 'S3') {
|
||||||
if($wizard.find('form[rel=secondaryStorage]').find('div[rel=name]').find('input').attr("disabled") == "disabled") { //Name textbox is disabled (and populated with S3 image setore name) when S3 image store exists. In this case, do not call addImageStore to create S3 image store.
|
if($wizard.find('form[rel=secondaryStorage]').find('div[rel=name]').find('input').attr("disabled") == "disabled") { //Name textbox is disabled (and populated with S3 image setore name) when S3 image store exists. In this case, do not call addImageStore to create S3 image store.
|
||||||
complete({
|
complete({
|
||||||
data: args.data
|
data: args.data
|
||||||
});
|
});
|
||||||
} else { //Name textbox is not disabled when S3 image store does not exist. In this case, call addImageStore to create S3 image store.
|
} else { //Name textbox is not disabled when S3 image store does not exist. In this case, call addImageStore to create S3 image store.
|
||||||
$.extend(data, {
|
$.extend(data, {
|
||||||
provider: args.data.secondaryStorage.provider,
|
provider: args.data.secondaryStorage.provider,
|
||||||
'details[0].key': 'accesskey',
|
'details[0].key': 'accesskey',
|
||||||
@ -4788,9 +4788,9 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('addImageStore'),
|
url: createURL('addImageStore'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
g_regionsecondaryenabled = true;
|
g_regionsecondaryenabled = true;
|
||||||
|
|
||||||
complete({
|
complete({
|
||||||
data: $.extend(args.data, {
|
data: $.extend(args.data, {
|
||||||
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
|
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
|
||||||
@ -4804,9 +4804,9 @@
|
|||||||
args: args
|
args: args
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//NFS Cache
|
//NFS Cache
|
||||||
if ($wizard.find('form[rel=secondaryStorage]').find('div[rel=createNfsCache]').find("input[type=checkbox]").is(':checked') == true) {
|
if ($wizard.find('form[rel=secondaryStorage]').find('div[rel=createNfsCache]').find("input[type=checkbox]").is(':checked') == true) {
|
||||||
var zoneid = args.data.secondaryStorage.nfsCacheZoneid;
|
var zoneid = args.data.secondaryStorage.nfsCacheZoneid;
|
||||||
@ -4860,14 +4860,14 @@
|
|||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('addImageStore'),
|
url: createURL('addImageStore'),
|
||||||
data: data,
|
data: data,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
g_regionsecondaryenabled = true;
|
g_regionsecondaryenabled = true;
|
||||||
|
|
||||||
complete({
|
complete({
|
||||||
data: $.extend(args.data, {
|
data: $.extend(args.data, {
|
||||||
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
|
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
error: function(XMLHttpResponse) {
|
error: function(XMLHttpResponse) {
|
||||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||||
@ -4878,7 +4878,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var complete = function(args) {
|
var complete = function(args) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user