mirror of https://github.com/apache/cloudstack.git
Merge pull request #664 from @kevindierkx
Removed leading tabs and trailing spaces from ui/scripts/accounts.js ui/scripts/accountsWizard.js ui/scripts/affinity.js ui/scripts/autoscaler.js ui/scripts/cloud.core.callbacks.js ui/scripts/cloudStack.js ui/scripts/configuration.js ui/scripts/dashboard.js ui/scripts/docs.js ui/scripts/domains.js ui/scripts/events.js ui/scripts/globalSettings.js ui/scripts/installWizard.js ui/scripts/instances.js ui/scripts/instanceWizard.js ui/scripts/lbStickyPolicy.js ui/scripts/network.js ui/scripts/plugins.js ui/scripts/projects.js ui/scripts/regions.js ui/scripts/sharedFunctions.js ui/scripts/storage.js ui/scripts/system.js ui/scripts/templates.js ui/scripts/vm_snapshots.js ui/scripts/vpc.js ui/scripts/zoneWizard.js * pr/664: Removed more commented code from zoneWizard.js Removed large chunks of commented code Removed leading tabs from ui/scripts/*.js Removed trailing whitespace from ui/scripts/*.js Signed-off-by: Daan Hoogland <hoogland@daan.cc>
This commit is contained in:
commit
b074fc70d8
|
|
@ -17,7 +17,7 @@
|
|||
(function(cloudStack) {
|
||||
|
||||
var domainObjs;
|
||||
|
||||
|
||||
cloudStack.sections.accounts = {
|
||||
title: 'label.accounts',
|
||||
id: 'accounts',
|
||||
|
|
@ -91,7 +91,7 @@
|
|||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
addLdapAccount: {
|
||||
label: 'label.add.ldap.account',
|
||||
isHeader: true,
|
||||
|
|
@ -123,7 +123,7 @@
|
|||
)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
dataProvider: function(args) {
|
||||
|
|
@ -422,59 +422,59 @@
|
|||
data: data,
|
||||
async: true,
|
||||
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)
|
||||
var msg = '';
|
||||
if (resourcecounts != null) {
|
||||
for (var i = 0; i < resourcecounts.length; i++) {
|
||||
switch (resourcecounts[i].resourcetype) {
|
||||
case '0':
|
||||
msg += 'Instance'; //vmLimit
|
||||
break;
|
||||
case '1':
|
||||
msg += 'Public IP'; //ipLimit
|
||||
break;
|
||||
case '2':
|
||||
msg += 'Volume'; //volumeLimit
|
||||
break;
|
||||
case '3':
|
||||
msg += 'Snapshot'; //snapshotLimit
|
||||
break;
|
||||
case '4':
|
||||
msg += 'Template'; //templateLimit
|
||||
break;
|
||||
case '5':
|
||||
continue; //resourcetype 5 is not in use. so, skip to next item.
|
||||
break;
|
||||
case '6':
|
||||
msg += 'Network'; //networkLimit
|
||||
break;
|
||||
case '7':
|
||||
msg += 'VPC'; //vpcLimit
|
||||
break;
|
||||
case '8':
|
||||
msg += 'CPU'; //cpuLimit
|
||||
break;
|
||||
case '9':
|
||||
msg += 'Memory'; //memoryLimit
|
||||
break;
|
||||
case '10':
|
||||
msg += 'Primary Storage'; //primaryStorageLimit
|
||||
break;
|
||||
case '11':
|
||||
msg += 'Secondary Storage'; //secondaryStorageLimit
|
||||
break;
|
||||
}
|
||||
|
||||
msg += ' Count: ' + resourcecounts[i].resourcecount + ' <br> ';
|
||||
}
|
||||
for (var i = 0; i < resourcecounts.length; i++) {
|
||||
switch (resourcecounts[i].resourcetype) {
|
||||
case '0':
|
||||
msg += 'Instance'; //vmLimit
|
||||
break;
|
||||
case '1':
|
||||
msg += 'Public IP'; //ipLimit
|
||||
break;
|
||||
case '2':
|
||||
msg += 'Volume'; //volumeLimit
|
||||
break;
|
||||
case '3':
|
||||
msg += 'Snapshot'; //snapshotLimit
|
||||
break;
|
||||
case '4':
|
||||
msg += 'Template'; //templateLimit
|
||||
break;
|
||||
case '5':
|
||||
continue; //resourcetype 5 is not in use. so, skip to next item.
|
||||
break;
|
||||
case '6':
|
||||
msg += 'Network'; //networkLimit
|
||||
break;
|
||||
case '7':
|
||||
msg += 'VPC'; //vpcLimit
|
||||
break;
|
||||
case '8':
|
||||
msg += 'CPU'; //cpuLimit
|
||||
break;
|
||||
case '9':
|
||||
msg += 'Memory'; //memoryLimit
|
||||
break;
|
||||
case '10':
|
||||
msg += 'Primary Storage'; //primaryStorageLimit
|
||||
break;
|
||||
case '11':
|
||||
msg += 'Secondary Storage'; //secondaryStorageLimit
|
||||
break;
|
||||
}
|
||||
|
||||
msg += ' Count: ' + resourcecounts[i].resourcecount + ' <br> ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
cloudStack.dialog.notice({
|
||||
message: msg
|
||||
});
|
||||
|
||||
message: msg
|
||||
});
|
||||
|
||||
args.response.success();
|
||||
},
|
||||
error: function(json) {
|
||||
|
|
@ -653,13 +653,13 @@
|
|||
}
|
||||
|
||||
},
|
||||
|
||||
|
||||
tabFilter: function(args) {
|
||||
var hiddenTabs = [];
|
||||
if(!isAdmin()) {
|
||||
hiddenTabs.push('settings');
|
||||
}
|
||||
return hiddenTabs;
|
||||
var hiddenTabs = [];
|
||||
if(!isAdmin()) {
|
||||
hiddenTabs.push('settings');
|
||||
}
|
||||
return hiddenTabs;
|
||||
},
|
||||
|
||||
tabs: {
|
||||
|
|
@ -2001,23 +2001,23 @@
|
|||
allowedActions.push("remove");
|
||||
}
|
||||
} else { //domain-admin, regular-user
|
||||
if (jsonObj.username == g_username) { //selected user is self
|
||||
allowedActions.push("changePassword");
|
||||
if (jsonObj.username == g_username) { //selected user is self
|
||||
allowedActions.push("changePassword");
|
||||
allowedActions.push("generateKeys");
|
||||
} else if (isDomainAdmin()) { //if selected user is not self, and the current login is domain-admin
|
||||
allowedActions.push("edit");
|
||||
} else if (isDomainAdmin()) { //if selected user is not self, and the current login is domain-admin
|
||||
allowedActions.push("edit");
|
||||
if (jsonObj.state == "enabled")
|
||||
allowedActions.push("disable");
|
||||
if (jsonObj.state == "disabled")
|
||||
allowedActions.push("enable");
|
||||
allowedActions.push("remove");
|
||||
|
||||
|
||||
allowedActions.push("changePassword");
|
||||
allowedActions.push("generateKeys");
|
||||
if (g_idpList) {
|
||||
allowedActions.push("configureSamlAuthorization");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return allowedActions;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,9 +78,9 @@
|
|||
validation: {
|
||||
required: true
|
||||
},
|
||||
select: function(args) {
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("listDomains"),
|
||||
url: createURL("listDomains"),
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
domainObjs = json.listdomainsresponse.domain;
|
||||
|
|
@ -213,7 +213,7 @@
|
|||
if (md5Hashed) {
|
||||
password = $.md5(password);
|
||||
} else {
|
||||
password = todb(password);
|
||||
password = todb(password);
|
||||
}
|
||||
array1.push("&password=" + password);
|
||||
}
|
||||
|
|
@ -227,10 +227,10 @@
|
|||
}
|
||||
|
||||
var accountType = args.data.accounttype;
|
||||
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 (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
|
||||
accountType = "2"; // change accountType from root-domain("1") to domain-admin("2")
|
||||
}
|
||||
}
|
||||
}
|
||||
array1.push("&accounttype=" + accountType);
|
||||
|
||||
|
|
@ -313,6 +313,6 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}(cloudStack, jQuery));
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@
|
|||
success: function(json) {
|
||||
var item = json.listaffinitygroupsresponse.affinitygroup[0];
|
||||
args.response.success({
|
||||
actionFilter: affinitygroupActionfilter,
|
||||
actionFilter: affinitygroupActionfilter,
|
||||
data: item
|
||||
});
|
||||
}
|
||||
|
|
@ -206,14 +206,14 @@
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var affinitygroupActionfilter = cloudStack.actionFilter.affinitygroupActionfilter = function(args) {
|
||||
var jsonObj = args.context.item;
|
||||
var allowedActions = [];
|
||||
var allowedActions = [];
|
||||
if (jsonObj.type != 'ExplicitDedication' || isAdmin()) {
|
||||
allowedActions.push("remove");
|
||||
}
|
||||
allowedActions.push("remove");
|
||||
}
|
||||
return allowedActions;
|
||||
}
|
||||
|
||||
|
||||
})(cloudStack);
|
||||
|
|
|
|||
|
|
@ -1341,7 +1341,7 @@
|
|||
array1.push("&interval=" + args.data.interval);
|
||||
array1.push("&scaleuppolicyids=" + args.scaleUpPolicyResponse.id);
|
||||
array1.push("&scaledownpolicyids=" + args.scaleDownPolicyResponse.id);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL('createAutoScaleVmGroup' + array1.join("")),
|
||||
dataType: 'json',
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ function onLogoutCallback() {
|
|||
|
||||
return true; // return true means the login page will show
|
||||
/*
|
||||
window.location.replace("http://www.google.com"); //redirect to a different location
|
||||
return false; //return false means it will stay in the location window.location.replace() sets it to (i.e. "http://www.google.com")
|
||||
*/
|
||||
window.location.replace("http://www.google.com"); //redirect to a different location
|
||||
return false; //return false means it will stay in the location window.location.replace() sets it to (i.e. "http://www.google.com")
|
||||
*/
|
||||
}
|
||||
|
||||
var g_loginResponse = null;
|
||||
|
|
|
|||
|
|
@ -136,15 +136,15 @@
|
|||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
g_capabilities = json.listcapabilitiesresponse.capability;
|
||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
g_capabilities = json.listcapabilitiesresponse.capability;
|
||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
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_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||
|
||||
|
|
@ -251,7 +251,7 @@
|
|||
});
|
||||
$.cookie('role', g_role, {
|
||||
expires: 1
|
||||
});
|
||||
});
|
||||
$.cookie('timezone', g_timezone, {
|
||||
expires: 1
|
||||
});
|
||||
|
|
@ -268,14 +268,14 @@
|
|||
async: false,
|
||||
success: function(json) {
|
||||
g_capabilities = json.listcapabilitiesresponse.capability;
|
||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
g_supportELB = json.listcapabilitiesresponse.capability.supportELB.toString(); //convert boolean to string if it's boolean
|
||||
g_kvmsnapshotenabled = json.listcapabilitiesresponse.capability.kvmsnapshotenabled; //boolean
|
||||
g_regionsecondaryenabled = json.listcapabilitiesresponse.capability.regionsecondaryenabled; //boolean
|
||||
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_cloudstackversion = json.listcapabilitiesresponse.capability.cloudstackversion;
|
||||
|
||||
|
|
@ -300,7 +300,7 @@
|
|||
args.response.error();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Get project configuration
|
||||
// TEMPORARY -- replace w/ output of capability response, etc., once implemented
|
||||
window.g_projectsInviteRequired = false;
|
||||
|
|
@ -462,6 +462,6 @@
|
|||
|
||||
cloudStack.uiCustom.login(loginArgs);
|
||||
|
||||
document.title = _l('label.app.name');
|
||||
document.title = _l('label.app.name');
|
||||
});
|
||||
})(cloudStack, jQuery);
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@
|
|||
}
|
||||
},
|
||||
isCustomized: {
|
||||
label: 'label.custom',
|
||||
label: 'label.custom',
|
||||
isBoolean: true,
|
||||
isReverse: true,
|
||||
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.
|
||||
label: 'Host Tag',
|
||||
docID: 'helpComputeOfferingHostTags'
|
||||
docID: 'helpComputeOfferingHostTags'
|
||||
},
|
||||
cpuCap: {
|
||||
label: 'label.CPU.cap',
|
||||
|
|
@ -410,7 +410,7 @@
|
|||
var $fields = $form.find('.field');
|
||||
if ($(this).val() == "ImplicitDedicationPlanner") {
|
||||
$form.find('[rel=plannerMode]').css('display', 'block');
|
||||
} else {
|
||||
} else {
|
||||
$form.find('[rel=plannerMode]').hide();
|
||||
}
|
||||
});
|
||||
|
|
@ -596,9 +596,9 @@
|
|||
provisioningType :args.data.provisioningType,
|
||||
customized: (args.data.isCustomized == "on")
|
||||
};
|
||||
|
||||
|
||||
//custom fields (begin)
|
||||
if (args.data.isCustomized != "on") {
|
||||
if (args.data.isCustomized != "on") {
|
||||
$.extend(data, {
|
||||
cpuNumber: args.data.cpuNumber
|
||||
});
|
||||
|
|
@ -608,9 +608,9 @@
|
|||
$.extend(data, {
|
||||
memory: args.data.memory
|
||||
});
|
||||
}
|
||||
}
|
||||
//custom fields (end)
|
||||
|
||||
|
||||
if (args.data.deploymentPlanner != null && args.data.deploymentPlanner.length > 0) {
|
||||
$.extend(data, {
|
||||
deploymentplanner: args.data.deploymentPlanner
|
||||
|
|
@ -872,7 +872,7 @@
|
|||
converter: function(args) {
|
||||
if (args == undefined)
|
||||
return '';
|
||||
else
|
||||
else
|
||||
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
||||
}
|
||||
},
|
||||
|
|
@ -936,10 +936,10 @@
|
|||
},
|
||||
deploymentplanner: {
|
||||
label: 'label.deployment.planner'
|
||||
},
|
||||
},
|
||||
plannerMode: {
|
||||
label: 'label.planner.mode'
|
||||
},
|
||||
},
|
||||
pciDevice: {
|
||||
label: 'label.gpu'
|
||||
},
|
||||
|
|
@ -972,13 +972,13 @@
|
|||
async: true,
|
||||
success: function(json) {
|
||||
var item = json.listserviceofferingsresponse.serviceoffering[0];
|
||||
|
||||
|
||||
if (item.deploymentplanner != null && item.serviceofferingdetails != null) {
|
||||
if (item.deploymentplanner == 'ImplicitDedicationPlanner' && item.serviceofferingdetails.ImplicitDedicationMode != null) {
|
||||
item.plannerMode = item.serviceofferingdetails.ImplicitDedicationMode;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (item.serviceofferingdetails != null) {
|
||||
item.pciDevice = item.serviceofferingdetails.pciDevice;
|
||||
item.vgpuType = item.serviceofferingdetails.vgpuType;
|
||||
|
|
@ -1469,7 +1469,7 @@
|
|||
converter: function(args) {
|
||||
if (args == undefined)
|
||||
return '';
|
||||
else
|
||||
else
|
||||
return cloudStack.converters.convertBytes(args * 1024 * 1024);
|
||||
}
|
||||
},
|
||||
|
|
@ -1924,7 +1924,7 @@
|
|||
customized: (args.data.isCustomized == "on")
|
||||
};
|
||||
|
||||
if (args.data.isCustomized != "on") {
|
||||
if (args.data.isCustomized != "on") {
|
||||
$.extend(data, {
|
||||
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\"]').find('input[type=checkbox]').attr('checked', false);
|
||||
}
|
||||
|
||||
|
||||
//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')) {
|
||||
$supportsstrechedl2subnet.css('display', 'inline-block');
|
||||
|
|
@ -3045,8 +3045,8 @@
|
|||
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilitytype'] = 'lbSchemes';
|
||||
inputData['servicecapabilitylist[' + serviceCapabilityIndex + '].capabilityvalue'] = 'internal';
|
||||
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" )) {
|
||||
inputData[key] = value;
|
||||
}
|
||||
|
|
@ -3097,21 +3097,21 @@
|
|||
if (inputData['guestIpType'] == "Shared") { //specifyVlan checkbox is disabled, so inputData won't include specifyVlan
|
||||
inputData['specifyVlan'] = true; //hardcode inputData['specifyVlan']
|
||||
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
|
||||
//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
|
||||
inputData['specifyVlan'] = true;
|
||||
inputData['specifyVlan'] = true;
|
||||
} 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
|
||||
inputData['isPersistent'] = true;
|
||||
} 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;
|
||||
};
|
||||
|
||||
|
||||
})(cloudStack, jQuery);
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@
|
|||
user: {
|
||||
dataProvider: function(args) {
|
||||
var dataFns = {
|
||||
instances: function(data) {
|
||||
var totalInstanceCount = 0;
|
||||
$.ajax({
|
||||
instances: function(data) {
|
||||
var totalInstanceCount = 0;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines"),
|
||||
data: {
|
||||
listAll: true,
|
||||
|
|
@ -38,15 +38,15 @@
|
|||
pageSize: 1
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
totalInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
totalInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var RunningInstanceCount = 0;
|
||||
$.ajax({
|
||||
|
||||
var RunningInstanceCount = 0;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines"),
|
||||
data: {
|
||||
listAll: true,
|
||||
|
|
@ -55,15 +55,15 @@
|
|||
state: "Running"
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
RunningInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
RunningInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
var stoppedInstanceCount = 0;
|
||||
$.ajax({
|
||||
|
||||
var stoppedInstanceCount = 0;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines"),
|
||||
data: {
|
||||
listAll: true,
|
||||
|
|
@ -72,18 +72,18 @@
|
|||
state: "Stopped"
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
stoppedInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
success: function(json) {
|
||||
if (json.listvirtualmachinesresponse.count != undefined) {
|
||||
stoppedInstanceCount = json.listvirtualmachinesresponse.count;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
dataFns.account($.extend(data, {
|
||||
runningInstances: RunningInstanceCount,
|
||||
stoppedInstances: stoppedInstanceCount,
|
||||
totalInstances: totalInstanceCount
|
||||
}));
|
||||
}));
|
||||
},
|
||||
|
||||
account: function(data) {
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
data: {
|
||||
listAll: true,
|
||||
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
|
||||
},
|
||||
success: function(json) {
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
$.ajax({
|
||||
url: createURL('listPublicIpAddresses'),
|
||||
data: {
|
||||
page: 1,
|
||||
page: 1,
|
||||
pageSize: 1
|
||||
},
|
||||
success: function(json) {
|
||||
|
|
@ -197,7 +197,7 @@
|
|||
url: createURL('listAlerts'),
|
||||
data: {
|
||||
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) {
|
||||
var alerts = json.listalertsresponse.alert ?
|
||||
|
|
@ -222,7 +222,7 @@
|
|||
data: {
|
||||
state: 'Alert',
|
||||
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) {
|
||||
var hosts = json.listhostsresponse.host ?
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
fetchLatest: data.fetchLatest,
|
||||
sortBy: 'usage',
|
||||
page: 0,
|
||||
pageSize: (pageSize > 8? 8: pageSize)
|
||||
pageSize: (pageSize > 8? 8: pageSize)
|
||||
},
|
||||
success: function(json) {
|
||||
var capacities = json.listcapacityresponse.capacity ?
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
// Domain tree
|
||||
treeView: {
|
||||
overflowScroll: true,
|
||||
overflowScroll: true,
|
||||
// Details
|
||||
detailView: {
|
||||
name: 'Domain details',
|
||||
|
|
@ -100,7 +100,7 @@
|
|||
var domainObj;
|
||||
|
||||
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)
|
||||
|
|
@ -108,22 +108,22 @@
|
|||
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)
|
||||
$.extend(data, {
|
||||
networkdomain: args.data.networkdomain
|
||||
networkdomain: args.data.networkdomain
|
||||
});
|
||||
}
|
||||
|
||||
if('name' in data || 'networkdomain' in data) {
|
||||
$.ajax({
|
||||
url: createURL("updateDomain"),
|
||||
async: false,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
domainObj = json.updatedomainresponse.domain;
|
||||
}
|
||||
});
|
||||
|
||||
if('name' in data || 'networkdomain' in data) {
|
||||
$.ajax({
|
||||
url: createURL("updateDomain"),
|
||||
async: false,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
domainObj = json.updatedomainresponse.domain;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (args.data.vmLimit != null) {
|
||||
|
|
@ -366,7 +366,7 @@
|
|||
networkdomain: {
|
||||
label: 'label.network.domain',
|
||||
isEditable: function(args) {
|
||||
if (isAdmin())
|
||||
if (isAdmin())
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
|
|
@ -652,10 +652,10 @@
|
|||
if (jsonObj.level != 0) { //ROOT domain (whose level is 0) is not allowed to delete
|
||||
allowedActions.push("delete");
|
||||
}
|
||||
} else if (isDomainAdmin()) {
|
||||
if (args.context.domains[0].id != g_domainid) {
|
||||
allowedActions.push("edit"); //merge updateResourceLimit into edit
|
||||
}
|
||||
} else if (isDomainAdmin()) {
|
||||
if (args.context.domains[0].id != g_domainid) {
|
||||
allowedActions.push("edit"); //merge updateResourceLimit into edit
|
||||
}
|
||||
}
|
||||
allowedActions.push("updateResourceCount");
|
||||
return allowedActions;
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var events = args.context.events;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("deleteEvents"),
|
||||
data: {
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
error:function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -154,7 +154,7 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
archive: {
|
||||
label: 'label.archive.events',
|
||||
isHeader: true,
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// Archive multiple events
|
||||
archiveMulti: {
|
||||
label: 'label.archive.events',
|
||||
|
|
@ -232,7 +232,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var events = args.context.events;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("archiveEvents"),
|
||||
data: {
|
||||
|
|
@ -247,7 +247,7 @@
|
|||
error:function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -494,7 +494,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var events = args.context.alerts;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("deleteAlerts"),
|
||||
data: {
|
||||
|
|
@ -509,10 +509,10 @@
|
|||
error:function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
remove: {
|
||||
label: 'label.delete.alerts',
|
||||
isHeader: true,
|
||||
|
|
@ -593,7 +593,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var events = args.context.alerts;
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("archiveAlerts"),
|
||||
data: {
|
||||
|
|
@ -608,10 +608,10 @@
|
|||
error:function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
archive: {
|
||||
label: 'label.archive.alerts',
|
||||
isHeader: true,
|
||||
|
|
|
|||
|
|
@ -234,17 +234,17 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
baremetalRct: {
|
||||
type: 'select',
|
||||
title: 'label.baremetal.rack.configuration',
|
||||
listView: {
|
||||
id: 'baremetalRct',
|
||||
label: 'label.baremetal.rack.configuration',
|
||||
fields: {
|
||||
id: {
|
||||
label: 'label.id'
|
||||
},
|
||||
fields: {
|
||||
id: {
|
||||
label: 'label.id'
|
||||
},
|
||||
url: {
|
||||
label: 'label.url'
|
||||
}
|
||||
|
|
@ -252,19 +252,19 @@
|
|||
dataProvider: function(args) {
|
||||
var data = {};
|
||||
listViewDataProvider(args, data);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("listBaremetalRct"),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct });
|
||||
}
|
||||
});
|
||||
url: createURL("listBaremetalRct"),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct });
|
||||
}
|
||||
});
|
||||
},
|
||||
actions: {
|
||||
add: {
|
||||
label: 'label.add.baremetal.rack.configuration',
|
||||
messages: {
|
||||
messages: {
|
||||
notification: function(args) {
|
||||
return 'label.add.baremetal.rack.configuration';
|
||||
}
|
||||
|
|
@ -280,35 +280,35 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL("addBaremetalRct"),
|
||||
data: {
|
||||
baremetalrcturl: args.data.url
|
||||
},
|
||||
success: function(json) {
|
||||
var jid = json.addbaremetalrctresponse.jobid
|
||||
args.response.success({
|
||||
url: createURL("addBaremetalRct"),
|
||||
data: {
|
||||
baremetalrcturl: args.data.url
|
||||
},
|
||||
success: function(json) {
|
||||
var jid = json.addbaremetalrctresponse.jobid
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
getUpdatedItem: function(json) {
|
||||
return json.queryasyncjobresultresponse.jobresult.baremetalrct;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
detailView: {
|
||||
name: "details",
|
||||
actions: {
|
||||
remove: {
|
||||
name: "details",
|
||||
actions: {
|
||||
remove: {
|
||||
label: 'label.delete.baremetal.rack.configuration',
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
|
|
@ -318,7 +318,7 @@
|
|||
return 'label.delete.baremetal.rack.configuration';
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
action: function(args) {
|
||||
var data = {
|
||||
id: args.context.baremetalRct[0].id
|
||||
};
|
||||
|
|
@ -326,12 +326,12 @@
|
|||
url: createURL('deleteBaremetalRct'),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.deletebaremetalrctresponse.jobid;
|
||||
var jid = json.deletebaremetalrctresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -339,35 +339,35 @@
|
|||
poll: pollAsyncJobResult
|
||||
}
|
||||
}
|
||||
},
|
||||
tabs: {
|
||||
},
|
||||
tabs: {
|
||||
details: {
|
||||
title: 'label.details',
|
||||
fields: [{
|
||||
id: {
|
||||
label: 'label.id'
|
||||
},
|
||||
id: {
|
||||
label: 'label.id'
|
||||
},
|
||||
url: {
|
||||
label: 'label.url'
|
||||
}
|
||||
}],
|
||||
dataProvider: function(args) {
|
||||
dataProvider: function(args) {
|
||||
var data = {
|
||||
id: args.context.baremetalRct[0].id
|
||||
};
|
||||
};
|
||||
$.ajax({
|
||||
url: createURL("listBaremetalRct"),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct[0] });
|
||||
}
|
||||
});
|
||||
url: createURL("listBaremetalRct"),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
args.response.success({ data: json.listbaremetalrctresponse.baremetalrct[0] });
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
hypervisorCapabilities: {
|
||||
type: 'select',
|
||||
title: 'label.hypervisor.capabilities',
|
||||
|
|
|
|||
|
|
@ -184,22 +184,22 @@
|
|||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
$.ajax({
|
||||
url: createURL("listTemplates&templatefilter=sharedexecutable&zoneid=" + args.currentData.zoneid),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listtemplatesresponse.template == null) {
|
||||
sharedTemplateObjs = null;
|
||||
sharedTemplateObjs = null;
|
||||
} else {
|
||||
sharedTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) {
|
||||
sharedTemplateObjs = $.grep(json.listtemplatesresponse.template, function(item, index) {
|
||||
if ($.inArray(item.hypervisor, hypervisorArray) > -1)
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
} else if (selectedTemplateOrIso == 'select-iso') {
|
||||
$.ajax({
|
||||
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
|
||||
|
|
@ -243,12 +243,12 @@
|
|||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listisosresponse.iso == null) {
|
||||
sharedIsoObjs = null;
|
||||
sharedIsoObjs = null;
|
||||
} else {
|
||||
sharedIsoObjs = json.listisosresponse.iso;
|
||||
sharedIsoObjs = json.listisosresponse.iso;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
//***** get templates/ISOs (end) *****
|
||||
|
||||
|
|
@ -282,19 +282,19 @@
|
|||
////
|
||||
return true; // Disabled -- not supported in backend right now
|
||||
////
|
||||
|
||||
|
||||
if (selectedTemplateOrIso == 'select-template') {
|
||||
return false; //show Root Disk Size field
|
||||
} else { //selectedTemplateOrIso == 'select-iso'
|
||||
return true; //hide Root Disk Size field
|
||||
}
|
||||
return true; //hide Root Disk Size field
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// Step 3: Service offering
|
||||
function(args) {
|
||||
selectedTemplateObj = null; //reset
|
||||
selectedTemplateObj = null; //reset
|
||||
if (args.currentData["select-template"] == "select-template") {
|
||||
if (featuredTemplateObjs != null && featuredTemplateObjs.length > 0) {
|
||||
for (var i = 0; i < featuredTemplateObjs.length; i++) {
|
||||
|
|
@ -323,7 +323,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedTemplateObj == null) {
|
||||
if (sharedTemplateObjs != null && sharedTemplateObjs.length > 0) {
|
||||
for (var i = 0; i < sharedTemplateObjs.length; i++) {
|
||||
|
|
@ -333,7 +333,7 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedTemplateObj == null) {
|
||||
alert("unable to find matched template object");
|
||||
} else {
|
||||
|
|
@ -346,36 +346,36 @@
|
|||
// 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);
|
||||
|
||||
|
||||
|
||||
// get serviceOfferingObjs
|
||||
$(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||
$(window).removeData("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||
$(window).trigger("cloudStack.module.instanceWizard.serviceOffering.dataProvider", {
|
||||
context: args.context,
|
||||
currentData: args.currentData
|
||||
});
|
||||
if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listServiceOfferings&issystem=false"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||
context: args.context,
|
||||
currentData: args.currentData
|
||||
});
|
||||
if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listServiceOfferings&issystem=false"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
args.response.success({
|
||||
canShowCustomIops: canShowCustomIopsForServiceOffering,
|
||||
customFlag: 'iscustomized',
|
||||
//customFlag: 'offerha', //for testing only
|
||||
customIopsFlag: 'iscustomizediops',
|
||||
//customFlag: 'offerha', //for testing only
|
||||
customIopsFlag: 'iscustomizediops',
|
||||
data: {
|
||||
serviceOfferings: serviceOfferingObjs
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
// Step 4: Data disk offering
|
||||
|
|
@ -409,23 +409,23 @@
|
|||
var data = {
|
||||
affinityGroups: affinitygroups
|
||||
};
|
||||
|
||||
|
||||
if(selectedZoneObj.domainid != null && selectedZoneObj.affinitygroupid != null) {
|
||||
var defaultAffinityGroup;
|
||||
if(affinitygroups != null) {
|
||||
for(var i = 0; i < affinitygroups.length; i++) {
|
||||
if(affinitygroups[i].id == selectedZoneObj.affinitygroupid) {
|
||||
defaultAffinityGroup = affinitygroups[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$.extend(data, {
|
||||
var defaultAffinityGroup;
|
||||
if(affinitygroups != null) {
|
||||
for(var i = 0; i < affinitygroups.length; i++) {
|
||||
if(affinitygroups[i].id == selectedZoneObj.affinitygroupid) {
|
||||
defaultAffinityGroup = affinitygroups[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
$.extend(data, {
|
||||
selectedObj: defaultAffinityGroup,
|
||||
selectedObjNonEditable: true
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
args.response.success({
|
||||
data: data
|
||||
});
|
||||
|
|
@ -608,21 +608,21 @@
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// get networkObjsToPopulate
|
||||
$(window).removeData("cloudStack.module.instanceWizard.networkObjs");
|
||||
$(window).removeData("cloudStack.module.instanceWizard.networkObjs");
|
||||
$(window).trigger("cloudStack.module.instanceWizard.network.dataProvider", {
|
||||
context: args.context,
|
||||
currentData: args.currentData,
|
||||
networkObjsToPopulate: networkObjsToPopulate
|
||||
});
|
||||
if ($(window).data("cloudStack.module.instanceWizard.networkObjs") == undefined) {
|
||||
//do nothing
|
||||
} else {
|
||||
networkObjsToPopulate = $(window).data("cloudStack.module.instanceWizard.networkObjs"); //override networkObjsToPopulate
|
||||
}
|
||||
|
||||
|
||||
context: args.context,
|
||||
currentData: args.currentData,
|
||||
networkObjsToPopulate: networkObjsToPopulate
|
||||
});
|
||||
if ($(window).data("cloudStack.module.instanceWizard.networkObjs") == undefined) {
|
||||
//do nothing
|
||||
} else {
|
||||
networkObjsToPopulate = $(window).data("cloudStack.module.instanceWizard.networkObjs"); //override networkObjsToPopulate
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL("listNetworkOfferings"),
|
||||
dataType: "json",
|
||||
|
|
@ -639,7 +639,7 @@
|
|||
networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
|
||||
}
|
||||
});
|
||||
//get network offerings (end) ***
|
||||
//get network offerings (end) ***
|
||||
|
||||
$networkStepContainer.removeClass('repeat next-use-security-groups');
|
||||
|
||||
|
|
@ -729,88 +729,88 @@
|
|||
// Create a new VM!!!!
|
||||
var deployVmData = {};
|
||||
|
||||
//step 1 : select zone
|
||||
//step 1 : select zone
|
||||
$.extend(deployVmData, {
|
||||
zoneid : args.data.zoneid
|
||||
zoneid : args.data.zoneid
|
||||
});
|
||||
|
||||
//step 2: select template
|
||||
//step 2: select template
|
||||
$.extend(deployVmData, {
|
||||
templateid : args.data.templateid
|
||||
templateid : args.data.templateid
|
||||
});
|
||||
|
||||
|
||||
$.extend(deployVmData, {
|
||||
hypervisor : selectedHypervisor
|
||||
hypervisor : selectedHypervisor
|
||||
});
|
||||
|
||||
|
||||
if (args.$wizard.find('input[name=rootDiskSize]').parent().css('display') != 'none') {
|
||||
if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
rootdisksize : args.$wizard.find('input[name=rootDiskSize]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
rootdisksize : args.$wizard.find('input[name=rootDiskSize]').val()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//step 3: select service offering
|
||||
|
||||
//step 3: select service offering
|
||||
$.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]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].cpuNumber' : args.$wizard.find('input[name=compute-cpu-cores]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=compute-cpu]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].cpuSpeed' : args.$wizard.find('input[name=compute-cpu]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=compute-memory]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].memory' : args.$wizard.find('input[name=compute-memory]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=compute-cpu-cores]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].cpuNumber' : args.$wizard.find('input[name=compute-cpu-cores]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=compute-cpu]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].cpuSpeed' : args.$wizard.find('input[name=compute-cpu]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=compute-memory]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'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]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].minIops' : args.$wizard.find('input[name=disk-min-iops]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=disk-max-iops]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].maxIops' : args.$wizard.find('input[name=disk-max-iops]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=disk-min-iops]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].minIops' : args.$wizard.find('input[name=disk-min-iops]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=disk-max-iops]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].maxIops' : args.$wizard.find('input[name=disk-max-iops]').val()
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//step 4: select disk offering
|
||||
if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
|
||||
$.extend(deployVmData, {
|
||||
diskofferingid : args.data.diskofferingid
|
||||
});
|
||||
|
||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||
$.extend(deployVmData, {
|
||||
size : args.data.size
|
||||
});
|
||||
if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
|
||||
$.extend(deployVmData, {
|
||||
diskofferingid : args.data.diskofferingid
|
||||
});
|
||||
|
||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||
$.extend(deployVmData, {
|
||||
size : args.data.size
|
||||
});
|
||||
}
|
||||
|
||||
if (selectedDiskOfferingObj.iscustomizediops == true) {
|
||||
if (args.$wizard.find('input[name=disk-min-iops-do]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].minIopsDo' : args.$wizard.find('input[name=disk-min-iops-do]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=disk-min-iops-do]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].minIopsDo' : args.$wizard.find('input[name=disk-min-iops-do]').val()
|
||||
});
|
||||
}
|
||||
|
||||
if (args.$wizard.find('input[name=disk-max-iops-do]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].maxIopsDo' : args.$wizard.find('input[name=disk-max-iops-do]').val()
|
||||
});
|
||||
}
|
||||
if (args.$wizard.find('input[name=disk-max-iops-do]').val().length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
'details[0].maxIopsDo' : args.$wizard.find('input[name=disk-max-iops-do]').val()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -825,16 +825,16 @@
|
|||
checkedAffinityGroupIdArray = [];
|
||||
}
|
||||
|
||||
if (checkedAffinityGroupIdArray.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
affinitygroupids : checkedAffinityGroupIdArray.join(",")
|
||||
});
|
||||
if (checkedAffinityGroupIdArray.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
affinitygroupids : checkedAffinityGroupIdArray.join(",")
|
||||
});
|
||||
}
|
||||
|
||||
//step 6: select network
|
||||
if (step6ContainerType == 'select-network' || step6ContainerType == 'select-advanced-sg') {
|
||||
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 checkedNetworkIdArray;
|
||||
|
|
@ -882,60 +882,60 @@
|
|||
|
||||
|
||||
if (defaultNetworkId == null) {
|
||||
cloudStack.dialog.notice({
|
||||
cloudStack.dialog.notice({
|
||||
message: "Please select a default network in Network step."
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (checkedNetworkIdArray.length > 0) {
|
||||
for (var i = 0; i < checkedNetworkIdArray.length; i++) {
|
||||
if (checkedNetworkIdArray[i] == defaultNetworkId) {
|
||||
array2.unshift(defaultNetworkId);
|
||||
|
||||
var ipToNetwork = {
|
||||
networkid: defaultNetworkId
|
||||
};
|
||||
if (args.data["new-network"] == "create-new-network") {
|
||||
if (args.data['new-network-ip'] != null && args.data['new-network-ip'].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data['new-network-ip']
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data["my-network-ips"][i]
|
||||
});
|
||||
}
|
||||
}
|
||||
array3.unshift(ipToNetwork);
|
||||
|
||||
} else {
|
||||
array2.push(checkedNetworkIdArray[i]);
|
||||
|
||||
if (checkedNetworkIdArray[i] == defaultNetworkId) {
|
||||
array2.unshift(defaultNetworkId);
|
||||
|
||||
var ipToNetwork = {
|
||||
networkid: checkedNetworkIdArray[i]
|
||||
};
|
||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data["my-network-ips"][i]
|
||||
});
|
||||
}
|
||||
array3.push(ipToNetwork);
|
||||
}
|
||||
networkid: defaultNetworkId
|
||||
};
|
||||
if (args.data["new-network"] == "create-new-network") {
|
||||
if (args.data['new-network-ip'] != null && args.data['new-network-ip'].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data['new-network-ip']
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data["my-network-ips"][i]
|
||||
});
|
||||
}
|
||||
}
|
||||
array3.unshift(ipToNetwork);
|
||||
|
||||
} else {
|
||||
array2.push(checkedNetworkIdArray[i]);
|
||||
|
||||
var ipToNetwork = {
|
||||
networkid: checkedNetworkIdArray[i]
|
||||
};
|
||||
if (args.data["my-network-ips"][i] != null && args.data["my-network-ips"][i].length > 0) {
|
||||
$.extend(ipToNetwork, {
|
||||
ip: args.data["my-network-ips"][i]
|
||||
});
|
||||
}
|
||||
array3.push(ipToNetwork);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//deployVmData.push("&networkIds=" + array2.join(",")); //ipToNetworkMap can't be specified along with networkIds or ipAddress
|
||||
|
||||
for (var k = 0; k < array3.length; k++) {
|
||||
deployVmData["iptonetworklist[" + k + "].networkid"] = array3[k].networkid;
|
||||
if (array3[k].ip != undefined && array3[k].ip.length > 0) {
|
||||
deployVmData["iptonetworklist[" + k + "].ip"] = array3[k].ip;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (var k = 0; k < array3.length; k++) {
|
||||
deployVmData["iptonetworklist[" + k + "].networkid"] = array3[k].networkid;
|
||||
if (array3[k].ip != undefined && array3[k].ip.length > 0) {
|
||||
deployVmData["iptonetworklist[" + k + "].ip"] = array3[k].ip;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (step6ContainerType == 'select-security-group') {
|
||||
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"],
|
||||
|
|
@ -947,10 +947,10 @@
|
|||
checkedSecurityGroupIdArray = [];
|
||||
}
|
||||
|
||||
if (checkedSecurityGroupIdArray.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
securitygroupids : checkedSecurityGroupIdArray.join(",")
|
||||
});
|
||||
if (checkedSecurityGroupIdArray.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
securitygroupids : checkedSecurityGroupIdArray.join(",")
|
||||
});
|
||||
}
|
||||
|
||||
if (selectedZoneObj.networktype == "Advanced" && selectedZoneObj.securitygroupsenabled == true) { // Advanced SG-enabled zone
|
||||
|
|
@ -980,29 +980,29 @@
|
|||
array2.push(checkedNetworkIdArray[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$.extend(deployVmData, {
|
||||
networkids : array2.join(",")
|
||||
networkids : array2.join(",")
|
||||
});
|
||||
}
|
||||
} else if (step6ContainerType == 'nothing-to-select') {
|
||||
if ("vpc" in args.context) { //from VPC tier
|
||||
deployVmData["iptonetworklist[0].networkid"] = args.context.networks[0].id;
|
||||
if (args.data["vpc-specify-ip"] != undefined && args.data["vpc-specify-ip"].length > 0) {
|
||||
deployVmData["iptonetworklist[0].ip"] = args.data["vpc-specify-ip"];
|
||||
}
|
||||
|
||||
if ("vpc" in args.context) { //from VPC tier
|
||||
deployVmData["iptonetworklist[0].networkid"] = args.context.networks[0].id;
|
||||
if (args.data["vpc-specify-ip"] != undefined && args.data["vpc-specify-ip"].length > 0) {
|
||||
deployVmData["iptonetworklist[0].ip"] = args.data["vpc-specify-ip"];
|
||||
}
|
||||
|
||||
$.extend(deployVmData, {
|
||||
domainid : args.context.vpc[0].domainid
|
||||
domainid : args.context.vpc[0].domainid
|
||||
});
|
||||
if (args.context.vpc[0].account != null) {
|
||||
$.extend(deployVmData, {
|
||||
account : args.context.vpc[0].account
|
||||
});
|
||||
} else if (args.context.vpc[0].projectid != null) {
|
||||
$.extend(deployVmData, {
|
||||
projectid : args.context.vpc[0].projectid
|
||||
});
|
||||
if (args.context.vpc[0].account != null) {
|
||||
$.extend(deployVmData, {
|
||||
account : args.context.vpc[0].account
|
||||
});
|
||||
} else if (args.context.vpc[0].projectid != null) {
|
||||
$.extend(deployVmData, {
|
||||
projectid : args.context.vpc[0].projectid
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1015,28 +1015,28 @@
|
|||
}
|
||||
|
||||
var displayname = args.data.displayname;
|
||||
if (displayname != null && displayname.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
displayname : displayname
|
||||
});
|
||||
$.extend(deployVmData, {
|
||||
name : displayname
|
||||
});
|
||||
if (displayname != null && displayname.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
displayname : displayname
|
||||
});
|
||||
$.extend(deployVmData, {
|
||||
name : displayname
|
||||
});
|
||||
}
|
||||
|
||||
var group = args.data.groupname;
|
||||
if (group != null && group.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
group : group
|
||||
});
|
||||
if (group != null && group.length > 0) {
|
||||
$.extend(deployVmData, {
|
||||
group : group
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
var keyboard = args.data.keyboardLanguage;
|
||||
if (keyboard != null && keyboard.length > 0) { //when blank option (default option) is selected => args.data.keyboardLanguage == ""
|
||||
$.extend(deployVmData, {
|
||||
keyboard : keyboard
|
||||
});
|
||||
}
|
||||
if (keyboard != null && keyboard.length > 0) { //when blank option (default option) is selected => args.data.keyboardLanguage == ""
|
||||
$.extend(deployVmData, {
|
||||
keyboard : keyboard
|
||||
});
|
||||
}
|
||||
|
||||
if (g_hostid != null) {
|
||||
$.extend(deployVmData, {
|
||||
|
|
@ -1050,7 +1050,7 @@
|
|||
userdata : todb(btoa(userdata))
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(window).trigger('cloudStack.deployVirtualMachine', {
|
||||
deployVmData: deployVmData,
|
||||
formData: args.data
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
}
|
||||
|
||||
args.form.fields.quiescevm.isChecked = true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -69,7 +69,7 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var instances = args.context.instances;
|
||||
|
||||
|
||||
$(instances).map(function(index, instance) {
|
||||
var array1 = [];
|
||||
array1.push("&snapshotmemory=" + (args.data.snapshotMemory == "on"));
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
error: function(json) {
|
||||
args.response.error(parseXMLHttpResponse(json));
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
|
|
@ -118,10 +118,10 @@
|
|||
isMultiSelectAction: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return action;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
cloudStack.sections.instances = {
|
||||
title: 'label.instances',
|
||||
id: 'instances',
|
||||
|
|
@ -601,10 +601,10 @@
|
|||
return 'label.action.reboot.instance';
|
||||
},
|
||||
complete: function(args) {
|
||||
if (args.password != null && args.password.length > 0)
|
||||
if (args.password != null && args.password.length > 0)
|
||||
return 'Password has been reset to ' + args.password;
|
||||
else
|
||||
return null;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
},
|
||||
notification: {
|
||||
|
|
@ -616,51 +616,51 @@
|
|||
label: 'label.action.destroy.instance',
|
||||
compactLabel: 'label.destroy',
|
||||
createForm: {
|
||||
title: 'label.action.destroy.instance',
|
||||
title: 'label.action.destroy.instance',
|
||||
desc: 'label.action.destroy.instance',
|
||||
isWarning: true,
|
||||
isWarning: true,
|
||||
preFilter: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
args.$form.find('.form-item[rel=expunge]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=expunge]').hide();
|
||||
}
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
args.$form.find('.form-item[rel=expunge]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=expunge]').hide();
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
expunge: {
|
||||
expunge: {
|
||||
label: 'label.expunge',
|
||||
isBoolean: true,
|
||||
isChecked: false
|
||||
}
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
},
|
||||
messages: {
|
||||
notification: function(args) {
|
||||
return 'label.action.destroy.instance';
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
var data = {
|
||||
id: args.context.instances[0].id
|
||||
};
|
||||
if (args.data.expunge == 'on') {
|
||||
$.extend(data, {
|
||||
expunge: true
|
||||
});
|
||||
}
|
||||
action: function(args) {
|
||||
var data = {
|
||||
id: args.context.instances[0].id
|
||||
};
|
||||
if (args.data.expunge == 'on') {
|
||||
$.extend(data, {
|
||||
expunge: true
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
url: createURL('destroyVirtualMachine'),
|
||||
data: data,
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.destroyvirtualmachineresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
if ('virtualmachine' in json.queryasyncjobresultresponse.jobresult) //destroy without expunge
|
||||
getUpdatedItem: function(json) {
|
||||
if ('virtualmachine' in json.queryasyncjobresultresponse.jobresult) //destroy without expunge
|
||||
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
||||
else //destroy with expunge
|
||||
return { 'toRemove': true };
|
||||
else //destroy with expunge
|
||||
return { 'toRemove': true };
|
||||
},
|
||||
getActionFilter: function() {
|
||||
return vmActionfilter;
|
||||
|
|
@ -753,10 +753,10 @@
|
|||
return 'label.reinstall.vm';
|
||||
},
|
||||
complete: function(args) {
|
||||
if (args.password != null && args.password.length > 0)
|
||||
if (args.password != null && args.password.length > 0)
|
||||
return _l('label.password.reset.confirm') + args.password;
|
||||
else
|
||||
return null;
|
||||
else
|
||||
return null;
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -765,19 +765,19 @@
|
|||
url: createURL("restoreVirtualMachine&virtualmachineid=" + args.context.instances[0].id),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var jid = json.restorevmresponse.jobid;
|
||||
args.response.success({
|
||||
success: function(json) {
|
||||
var jid = json.restorevmresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid,
|
||||
getUpdatedItem: function(json) {
|
||||
getUpdatedItem: function(json) {
|
||||
return json.queryasyncjobresultresponse.jobresult.virtualmachine;
|
||||
},
|
||||
getActionFilter: function() {
|
||||
return vmActionfilter;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -951,54 +951,54 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//***** addResourceDetail *****
|
||||
//XenServer only (starts here)
|
||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('addResourceDetail'),
|
||||
data: {
|
||||
resourceType: 'uservm',
|
||||
resourceId: args.context.instances[0].id,
|
||||
'details[0].key': 'hypervisortoolsversion',
|
||||
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
||||
},
|
||||
success: function(json) {
|
||||
var jobId = json.addResourceDetailresponse.jobid;
|
||||
//XenServer only (starts here)
|
||||
if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
|
||||
$.ajax({
|
||||
url: createURL('addResourceDetail'),
|
||||
data: {
|
||||
resourceType: 'uservm',
|
||||
resourceId: args.context.instances[0].id,
|
||||
'details[0].key': 'hypervisortoolsversion',
|
||||
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
|
||||
},
|
||||
success: function(json) {
|
||||
var jobId = json.addResourceDetailresponse.jobid;
|
||||
var addResourceDetailIntervalID = setInterval(function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobid=" + jobId),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
|
||||
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
} else {
|
||||
clearInterval(addResourceDetailIntervalID);
|
||||
|
||||
if (result.jobstatus == 1) {
|
||||
//do nothing
|
||||
if (result.jobstatus == 1) {
|
||||
//do nothing
|
||||
} else if (result.jobstatus == 2) {
|
||||
cloudStack.dialog.notice({
|
||||
cloudStack.dialog.notice({
|
||||
message: _s(result.jobresult.errortext)
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
error: function(XMLHttpResponse) {
|
||||
cloudStack.dialog.notice({
|
||||
message: parseXMLHttpResponse(XMLHttpResponse)
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}, g_queryAsyncJobResultInterval);
|
||||
}
|
||||
});
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
}, g_queryAsyncJobResultInterval);
|
||||
}
|
||||
});
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -1015,9 +1015,9 @@
|
|||
$.ajax({
|
||||
url: createURL("listIsos"),
|
||||
data: {
|
||||
isofilter: 'featured',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
isofilter: 'featured',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
|
|
@ -1034,9 +1034,9 @@
|
|||
$.ajax({
|
||||
url: createURL("listIsos"),
|
||||
data: {
|
||||
isofilter: 'community',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
isofilter: 'community',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
|
|
@ -1055,9 +1055,9 @@
|
|||
$.ajax({
|
||||
url: createURL("listIsos"),
|
||||
data: {
|
||||
isofilter: 'selfexecutable',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
isofilter: 'selfexecutable',
|
||||
isReady: true,
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
|
|
@ -1233,18 +1233,18 @@
|
|||
},
|
||||
osTypeId: {
|
||||
label: 'label.os.type',
|
||||
select: function(args) {
|
||||
if (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
var items = [];
|
||||
select: function(args) {
|
||||
if (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
var items = [];
|
||||
$(ostypeObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
|
|
@ -1253,7 +1253,7 @@
|
|||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
});
|
||||
}
|
||||
},
|
||||
isPublic: {
|
||||
|
|
@ -1493,73 +1493,73 @@
|
|||
createForm: {
|
||||
title: 'label.change.service.offering',
|
||||
desc: function(args) {
|
||||
var description = '';
|
||||
var vmObj = args.jsonObj;
|
||||
if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') {
|
||||
description = 'message.read.admin.guide.scaling.up';
|
||||
}
|
||||
return description;
|
||||
var description = '';
|
||||
var vmObj = args.jsonObj;
|
||||
if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') {
|
||||
description = 'message.read.admin.guide.scaling.up';
|
||||
}
|
||||
return description;
|
||||
},
|
||||
fields: {
|
||||
serviceofferingid: {
|
||||
serviceofferingid: {
|
||||
label: 'label.compute.offering',
|
||||
select: function(args) {
|
||||
var serviceofferingObjs;
|
||||
var serviceofferingObjs;
|
||||
$.ajax({
|
||||
url: createURL("listServiceOfferings&VirtualMachineId=" + args.context.instances[0].id),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
serviceofferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||
var items = [];
|
||||
serviceofferingObjs = json.listserviceofferingsresponse.serviceoffering;
|
||||
var items = [];
|
||||
if (serviceofferingObjs != null) {
|
||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||
items.push({
|
||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||
items.push({
|
||||
id: serviceofferingObjs[i].id,
|
||||
description: serviceofferingObjs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
args.$select.change(function(){
|
||||
var $form = $(this).closest('form');
|
||||
|
||||
var $form = $(this).closest('form');
|
||||
|
||||
var serviceofferingid = $(this).val();
|
||||
if (serviceofferingid == null || serviceofferingid.length == 0)
|
||||
return;
|
||||
|
||||
|
||||
var items = [];
|
||||
var selectedServiceofferingObj;
|
||||
if (serviceofferingObjs != null) {
|
||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||
if (serviceofferingObjs[i].id == serviceofferingid) {
|
||||
selectedServiceofferingObj = serviceofferingObjs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedServiceofferingObj == undefined)
|
||||
return;
|
||||
|
||||
for (var i = 0; i < serviceofferingObjs.length; i++) {
|
||||
if (serviceofferingObjs[i].id == serviceofferingid) {
|
||||
selectedServiceofferingObj = serviceofferingObjs[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (selectedServiceofferingObj == undefined)
|
||||
return;
|
||||
|
||||
if (selectedServiceofferingObj.iscustomized == true) {
|
||||
$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=memory]').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=memory]').css('display', 'inline-block');
|
||||
} else {
|
||||
$form.find('.form-item[rel=cpuSpeed]').hide();
|
||||
$form.find('.form-item[rel=cpuNumber]').hide();
|
||||
$form.find('.form-item[rel=memory]').hide();
|
||||
$form.find('.form-item[rel=cpuSpeed]').hide();
|
||||
$form.find('.form-item[rel=cpuNumber]').hide();
|
||||
$form.find('.form-item[rel=memory]').hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
cpuSpeed: {
|
||||
label: 'label.cpu.mhz',
|
||||
label: 'label.cpu.mhz',
|
||||
validation: {
|
||||
required: true,
|
||||
number: true
|
||||
|
|
@ -1567,7 +1567,7 @@
|
|||
isHidden: true
|
||||
},
|
||||
cpuNumber: {
|
||||
label: 'label.num.cpu.cores',
|
||||
label: 'label.num.cpu.cores',
|
||||
validation: {
|
||||
required: true,
|
||||
number: true
|
||||
|
|
@ -1575,38 +1575,38 @@
|
|||
isHidden: true
|
||||
},
|
||||
memory: {
|
||||
label: 'label.memory.mb',
|
||||
label: 'label.memory.mb',
|
||||
validation: {
|
||||
required: true,
|
||||
number: true
|
||||
},
|
||||
isHidden: true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
action: function(args) {
|
||||
var data = {
|
||||
id: args.context.instances[0].id,
|
||||
serviceofferingid: args.data.serviceofferingid
|
||||
};
|
||||
|
||||
if (args.$form.find('.form-item[rel=cpuSpeed]').is(':visible')) {
|
||||
var data = {
|
||||
id: args.context.instances[0].id,
|
||||
serviceofferingid: args.data.serviceofferingid
|
||||
};
|
||||
|
||||
if (args.$form.find('.form-item[rel=cpuSpeed]').is(':visible')) {
|
||||
$.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, {
|
||||
'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, {
|
||||
'details[0].memory': args.data.memory
|
||||
'details[0].memory': args.data.memory
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('scaleVirtualMachine'),
|
||||
data: data,
|
||||
|
|
@ -1640,7 +1640,7 @@
|
|||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
resetSSHKeyForVirtualMachine: {
|
||||
label: 'Reset SSH Key Pair',
|
||||
createForm: {
|
||||
|
|
@ -1732,66 +1732,66 @@
|
|||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
assignVmToAnotherAccount: {
|
||||
label: 'label.assign.instance.another',
|
||||
createForm: {
|
||||
title: 'label.assign.instance.another',
|
||||
fields: {
|
||||
domainid: {
|
||||
label: 'label.domain',
|
||||
validation: {
|
||||
fields: {
|
||||
domainid: {
|
||||
label: 'label.domain',
|
||||
validation: {
|
||||
required: true
|
||||
},
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listDomains'),
|
||||
data: {
|
||||
listAll: true,
|
||||
details: 'min'
|
||||
},
|
||||
success: function(json) {
|
||||
var array1 = [];
|
||||
var domains = json.listdomainsresponse.domain;
|
||||
if (domains != null && domains.length > 0) {
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
array1.push({
|
||||
id: domains[i].id,
|
||||
description: domains[i].path
|
||||
});
|
||||
}
|
||||
}
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listDomains'),
|
||||
data: {
|
||||
listAll: true,
|
||||
details: 'min'
|
||||
},
|
||||
success: function(json) {
|
||||
var array1 = [];
|
||||
var domains = json.listdomainsresponse.domain;
|
||||
if (domains != null && domains.length > 0) {
|
||||
for (var i = 0; i < domains.length; i++) {
|
||||
array1.push({
|
||||
id: domains[i].id,
|
||||
description: domains[i].path
|
||||
});
|
||||
}
|
||||
}
|
||||
array1.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: array1
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
account: {
|
||||
label: 'label.account',
|
||||
validation: {
|
||||
args.response.success({
|
||||
data: array1
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
account: {
|
||||
label: 'label.account',
|
||||
validation: {
|
||||
required: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('assignVirtualMachine'),
|
||||
data: {
|
||||
virtualmachineid: args.context.instances[0].id,
|
||||
domainid: args.data.domainid,
|
||||
account: args.data.account
|
||||
},
|
||||
success: function(json) {
|
||||
var item = json.assignvirtualmachineresponse.virtualmachine;
|
||||
},
|
||||
success: function(json) {
|
||||
var item = json.assignvirtualmachineresponse.virtualmachine;
|
||||
args.response.success({
|
||||
data: item
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -1805,8 +1805,8 @@
|
|||
args.complete();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
viewConsole: {
|
||||
label: 'label.view.console',
|
||||
action: {
|
||||
|
|
@ -1835,36 +1835,36 @@
|
|||
} else {
|
||||
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
|
||||
}
|
||||
|
||||
|
||||
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 (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (ostypeObjs != undefined) {
|
||||
var ostypeName;
|
||||
for (var i = 0; i < ostypeObjs.length; i++) {
|
||||
if (ostypeObjs[i].id == args.context.instances[0].guestosid) {
|
||||
ostypeName = ostypeObjs[i].description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
||||
hiddenFields.push('xenserverToolsVersion61plus');
|
||||
}
|
||||
}
|
||||
|
||||
if ('instances' in args.context && args.context.instances[0].guestosid != undefined) {
|
||||
if (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (ostypeObjs != undefined) {
|
||||
var ostypeName;
|
||||
for (var i = 0; i < ostypeObjs.length; i++) {
|
||||
if (ostypeObjs[i].id == args.context.instances[0].guestosid) {
|
||||
ostypeName = ostypeObjs[i].description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
|
||||
hiddenFields.push('xenserverToolsVersion61plus');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!args.context.instances[0].publicip) {
|
||||
hiddenFields.push('publicip');
|
||||
}
|
||||
|
|
@ -1920,17 +1920,17 @@
|
|||
guestosid: {
|
||||
label: 'label.os.type',
|
||||
isEditable: true,
|
||||
select: function(args) {
|
||||
if (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
select: function(args) {
|
||||
if (ostypeObjs == undefined) {
|
||||
$.ajax({
|
||||
url: createURL("listOsTypes"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
ostypeObjs = json.listostypesresponse.ostype;
|
||||
}
|
||||
});
|
||||
}
|
||||
var items = [];
|
||||
$(ostypeObjs).each(function() {
|
||||
items.push({
|
||||
|
|
@ -1959,16 +1959,7 @@
|
|||
},
|
||||
converter: cloudStack.converters.toBooleanText
|
||||
},
|
||||
|
||||
/*
|
||||
isoid: {
|
||||
label: 'label.attached.iso',
|
||||
isEditable: false,
|
||||
converter: function(isoid) {
|
||||
return cloudStack.converters.toBooleanText(isoid != null);
|
||||
}
|
||||
},
|
||||
*/
|
||||
|
||||
isoname: {
|
||||
label: 'label.attached.iso'
|
||||
},
|
||||
|
|
@ -1977,13 +1968,13 @@
|
|||
label: 'label.compute.offering'
|
||||
},
|
||||
cpunumber: {
|
||||
label: 'label.num.cpu.cores'
|
||||
label: 'label.num.cpu.cores'
|
||||
},
|
||||
cpuspeed: {
|
||||
label: 'label.cpu.mhz'
|
||||
label: 'label.cpu.mhz'
|
||||
},
|
||||
memory: {
|
||||
label: 'label.memory.mb'
|
||||
label: 'label.memory.mb'
|
||||
},
|
||||
vgpu: {
|
||||
label: 'label.vgpu'
|
||||
|
|
@ -2045,7 +2036,7 @@
|
|||
var jsonObj;
|
||||
if (json.listvirtualmachinesresponse.virtualmachine != null && json.listvirtualmachinesresponse.virtualmachine.length > 0)
|
||||
jsonObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||
else if (isAdmin())
|
||||
else if (isAdmin())
|
||||
jsonObj = $.extend(args.context.instances[0], {
|
||||
state: "Expunged"
|
||||
}); //after root/domain admin expunge a VM, listVirtualMachines API will no longer returns this expunged VM to all users.
|
||||
|
|
@ -2060,12 +2051,12 @@
|
|||
else
|
||||
jsonObj.xenserverToolsVersion61plus = false;
|
||||
}
|
||||
|
||||
|
||||
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
||||
obj: jsonObj,
|
||||
objType: "UserVM"
|
||||
obj: jsonObj,
|
||||
objType: "UserVM"
|
||||
});
|
||||
|
||||
|
||||
args.response.success({
|
||||
actionFilter: vmActionfilter,
|
||||
data: jsonObj
|
||||
|
|
@ -2099,19 +2090,19 @@
|
|||
networkid: {
|
||||
label: 'label.network',
|
||||
select: function(args) {
|
||||
var data1 = {
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
};
|
||||
if (isAdmin()) {
|
||||
$.extend(data1, {
|
||||
listAll: true
|
||||
});
|
||||
} else {
|
||||
$.extend(data1, {
|
||||
account: args.context.instances[0].account,
|
||||
var data1 = {
|
||||
zoneid: args.context.instances[0].zoneid
|
||||
};
|
||||
if (isAdmin()) {
|
||||
$.extend(data1, {
|
||||
listAll: true
|
||||
});
|
||||
} else {
|
||||
$.extend(data1, {
|
||||
account: args.context.instances[0].account,
|
||||
domainid: args.context.instances[0].domainid
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
$.ajax({
|
||||
url: createURL('listNetworks'),
|
||||
data: data1,
|
||||
|
|
@ -2322,7 +2313,7 @@
|
|||
secondaryips: secondaryips
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
var name = 'NIC ' + (index + 1);
|
||||
if (nic.isdefault) {
|
||||
name += ' (' + _l('label.default') + ')';
|
||||
|
|
@ -2442,19 +2433,19 @@
|
|||
} else if (jsonObj.state == 'Running') {
|
||||
allowedActions.push("stop");
|
||||
allowedActions.push("restart");
|
||||
|
||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||
&& (jsonObj.hypervisor != 'LXC')) {
|
||||
|
||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||
&& (jsonObj.hypervisor != 'LXC')) {
|
||||
allowedActions.push("snapshot");
|
||||
}
|
||||
|
||||
allowedActions.push("destroy");
|
||||
|
||||
allowedActions.push("destroy");
|
||||
allowedActions.push("reinstall");
|
||||
|
||||
|
||||
//when userVm is running, scaleUp is not supported for KVM, LXC
|
||||
if (jsonObj.hypervisor != 'KVM' && jsonObj.hypervisor != 'LXC') {
|
||||
allowedActions.push("scaleUp");
|
||||
}
|
||||
allowedActions.push("scaleUp");
|
||||
}
|
||||
|
||||
if (isAdmin())
|
||||
allowedActions.push("migrate");
|
||||
|
|
@ -2476,13 +2467,13 @@
|
|||
allowedActions.push("start");
|
||||
allowedActions.push("destroy");
|
||||
allowedActions.push("reinstall");
|
||||
|
||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||
&& (jsonObj.hypervisor != 'LXC')) {
|
||||
|
||||
if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
|
||||
&& (jsonObj.hypervisor != 'LXC')) {
|
||||
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");
|
||||
|
||||
if (isAdmin())
|
||||
|
|
@ -2493,11 +2484,11 @@
|
|||
} else {
|
||||
allowedActions.push("detachISO");
|
||||
}
|
||||
allowedActions.push("resetPassword");
|
||||
allowedActions.push("resetPassword");
|
||||
if (jsonObj.hypervisor == "BareMetal") {
|
||||
allowedActions.push("createTemplate");
|
||||
}
|
||||
|
||||
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
allowedActions.push("assignVmToAnotherAccount");
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -621,48 +621,48 @@
|
|||
},
|
||||
|
||||
// Project listing data provider
|
||||
dataProvider: function(args) {
|
||||
dataProvider: function(args) {
|
||||
var user = args.context.users[0];
|
||||
var data1 = {
|
||||
accountId: user.userid,
|
||||
listAll: true
|
||||
};
|
||||
if (args.projectName) {
|
||||
data1.keyword = args.projectName;
|
||||
data1.keyword = args.projectName;
|
||||
}
|
||||
|
||||
var array1 = [];
|
||||
var page = 1;
|
||||
var getNextPage = function() {
|
||||
var data2 = $.extend({}, data1, {
|
||||
page: page,
|
||||
pageSize: 500
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listProjects', {
|
||||
ignoreProject: true
|
||||
}),
|
||||
data: data2,
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var projects = json.listprojectsresponse.project;
|
||||
if (projects != undefined) {
|
||||
for(var i = 0; i < projects.length; i++) {
|
||||
array1.push($.extend(projects[i], {
|
||||
displayText: projects[i].displaytext
|
||||
}));
|
||||
}
|
||||
}
|
||||
if (array1.length < json.listprojectsresponse.count) {
|
||||
page++;
|
||||
getNextPage();
|
||||
}
|
||||
}
|
||||
});
|
||||
var page = 1;
|
||||
var getNextPage = function() {
|
||||
var data2 = $.extend({}, data1, {
|
||||
page: page,
|
||||
pageSize: 500
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listProjects', {
|
||||
ignoreProject: true
|
||||
}),
|
||||
data: data2,
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var projects = json.listprojectsresponse.project;
|
||||
if (projects != undefined) {
|
||||
for(var i = 0; i < projects.length; i++) {
|
||||
array1.push($.extend(projects[i], {
|
||||
displayText: projects[i].displaytext
|
||||
}));
|
||||
}
|
||||
}
|
||||
if (array1.length < json.listprojectsresponse.count) {
|
||||
page++;
|
||||
getNextPage();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
getNextPage();
|
||||
args.response.success({ data: array1 });
|
||||
getNextPage();
|
||||
args.response.success({ data: array1 });
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -196,16 +196,6 @@
|
|||
preAction: function(args) {
|
||||
var region = args.context.regions[0];
|
||||
|
||||
/* e.g.
|
||||
region.endpoint == "http://localhost:8080/client/"
|
||||
document.location.href == "http://localhost:8080/client/#"
|
||||
*/
|
||||
/*
|
||||
if(document.location.href.indexOf(region.endpoint) != -1) {
|
||||
cloudStack.dialog.notice({ message: _l('You can not remove the region that you are currently in.') });
|
||||
return false;
|
||||
}
|
||||
*/
|
||||
return true;
|
||||
},
|
||||
action: function(args) {
|
||||
|
|
@ -481,33 +471,33 @@
|
|||
path: 'regions.lbUnderGSLB',
|
||||
label: 'label.gslb.assigned.lb'
|
||||
},
|
||||
actions: {
|
||||
edit: {
|
||||
actions: {
|
||||
edit: {
|
||||
label: 'label.edit',
|
||||
action: function(args) {
|
||||
action: function(args) {
|
||||
var data = {
|
||||
id: args.context.GSLB[0].id,
|
||||
description: args.data.description,
|
||||
gslblbmethod: args.data.gslblbmethod
|
||||
};
|
||||
id: args.context.GSLB[0].id,
|
||||
description: args.data.description,
|
||||
gslblbmethod: args.data.gslblbmethod
|
||||
};
|
||||
$.ajax({
|
||||
url: createURL('updateGlobalLoadBalancerRule'),
|
||||
data: data,
|
||||
success: function(json) {
|
||||
var jid = json.updategloballoadbalancerruleresponse.jobid;
|
||||
success: function(json) {
|
||||
var jid = json.updategloballoadbalancerruleresponse.jobid;
|
||||
args.response.success({
|
||||
_custom: {
|
||||
jobId: jid
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
remove: {
|
||||
},
|
||||
remove: {
|
||||
label: 'label.gslb.delete',
|
||||
messages: {
|
||||
confirm: function(args) {
|
||||
|
|
@ -956,8 +946,8 @@
|
|||
$.ajax({
|
||||
url: createURL('removeFromGlobalLoadBalancerRule'),
|
||||
data: {
|
||||
id: args.context.GSLB[0].id,
|
||||
loadbalancerrulelist: args.context.lbUnderGSLB[0].id
|
||||
id: args.context.GSLB[0].id,
|
||||
loadbalancerrulelist: args.context.lbUnderGSLB[0].id
|
||||
},
|
||||
success: function(json) {
|
||||
var jid = json.removefromloadbalancerruleresponse.jobid;
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ var pollAsyncJobResult = function(args) {
|
|||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
args.error({
|
||||
message: parseXMLHttpResponse(XMLHttpResponse)
|
||||
message: parseXMLHttpResponse(XMLHttpResponse)
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -268,7 +268,7 @@ var addGuestNetworkDialog = {
|
|||
if (items != null) {
|
||||
for (var i = 0; i < items.length; i++) {
|
||||
if (items[i].networktype == 'Advanced') {
|
||||
addGuestNetworkDialog.zoneObjs.push(items[i]);
|
||||
addGuestNetworkDialog.zoneObjs.push(items[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -294,43 +294,43 @@ 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
|
||||
addGuestNetworkDialog.physicalNetworkObjs = args.context.physicalNetworks;
|
||||
} 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) {
|
||||
$.ajax({
|
||||
url: createURL('listPhysicalNetworks'),
|
||||
data: {
|
||||
zoneid: selectedZoneId
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
|
||||
if (physicalnetworks != null) {
|
||||
for (var i = 0; i < physicalnetworks.length; i++) {
|
||||
$.ajax({
|
||||
url: createURL('listTrafficTypes'),
|
||||
data: {
|
||||
physicalnetworkid: physicalnetworks[i].id
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var traffictypes = json.listtraffictypesresponse.traffictype;
|
||||
if (traffictypes != null) {
|
||||
for (var k = 0; k < traffictypes.length; k++) {
|
||||
if (traffictypes[k].traffictype == 'Guest') {
|
||||
items.push(physicalnetworks[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addGuestNetworkDialog.physicalNetworkObjs = items;
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
url: createURL('listPhysicalNetworks'),
|
||||
data: {
|
||||
zoneid: selectedZoneId
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
|
||||
if (physicalnetworks != null) {
|
||||
for (var i = 0; i < physicalnetworks.length; i++) {
|
||||
$.ajax({
|
||||
url: createURL('listTrafficTypes'),
|
||||
data: {
|
||||
physicalnetworkid: physicalnetworks[i].id
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var traffictypes = json.listtraffictypesresponse.traffictype;
|
||||
if (traffictypes != null) {
|
||||
for (var k = 0; k < traffictypes.length; k++) {
|
||||
if (traffictypes[k].traffictype == 'Guest') {
|
||||
items.push(physicalnetworks[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
addGuestNetworkDialog.physicalNetworkObjs = items;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var items = [];
|
||||
|
|
@ -536,14 +536,14 @@ var addGuestNetworkDialog = {
|
|||
label: 'label.network.offering',
|
||||
docID: 'helpGuestNetworkZoneNetworkOffering',
|
||||
dependsOn: ['zoneId', 'physicalNetworkId', 'scope'],
|
||||
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) {
|
||||
args.response.success({
|
||||
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) {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
var data = {
|
||||
state: 'Enabled',
|
||||
zoneid: args.$form.find('.form-item[rel=zoneId]').find('select').val()
|
||||
|
|
@ -975,9 +975,9 @@ var roleTypeDomainAdmin = "2";
|
|||
|
||||
cloudStack.converters = {
|
||||
convertBytes: function(bytes) {
|
||||
if (bytes == undefined)
|
||||
return '';
|
||||
|
||||
if (bytes == undefined)
|
||||
return '';
|
||||
|
||||
if (bytes < 1024 * 1024) {
|
||||
return (bytes / 1024).toFixed(2) + " KB";
|
||||
} else if (bytes < 1024 * 1024 * 1024) {
|
||||
|
|
@ -1030,29 +1030,29 @@ cloudStack.converters = {
|
|||
|
||||
if (g_timezoneoffset != null) {
|
||||
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
||||
} else {
|
||||
var browserDate = new Date();
|
||||
var browserTimezoneoffset = browserDate.getTimezoneOffset();
|
||||
if (browserTimezoneoffset == undefined || isNaN(browserTimezoneoffset) ) {
|
||||
localDate = disconnected.toUTCString();
|
||||
} else {
|
||||
g_timezoneoffset = (browserTimezoneoffset/60) * (-1);
|
||||
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
||||
}
|
||||
} else {
|
||||
var browserDate = new Date();
|
||||
var browserTimezoneoffset = browserDate.getTimezoneOffset();
|
||||
if (browserTimezoneoffset == undefined || isNaN(browserTimezoneoffset) ) {
|
||||
localDate = disconnected.toUTCString();
|
||||
} else {
|
||||
g_timezoneoffset = (browserTimezoneoffset/60) * (-1);
|
||||
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
return localDate;
|
||||
},
|
||||
toBooleanText: function(booleanValue) {
|
||||
toBooleanText: function(booleanValue) {
|
||||
var text1;
|
||||
if (booleanValue == true) {
|
||||
text1 = "Yes";
|
||||
if (booleanValue == true) {
|
||||
text1 = "Yes";
|
||||
} else if (booleanValue == false) {
|
||||
text1 = "No";
|
||||
text1 = "No";
|
||||
} else { //booleanValue == undefined
|
||||
text1 = "";
|
||||
text1 = "";
|
||||
}
|
||||
return text1;
|
||||
return text1;
|
||||
},
|
||||
convertHz: function(hz) {
|
||||
if (hz == null)
|
||||
|
|
@ -1239,13 +1239,13 @@ cloudStack.converters = {
|
|||
}
|
||||
}
|
||||
|
||||
function isModuleIncluded(moduleName) {
|
||||
function isModuleIncluded(moduleName) {
|
||||
for(var moduleIndex = 0; moduleIndex < cloudStack.modules.length; moduleIndex++) {
|
||||
if (cloudStack.modules[moduleIndex] == moduleName) {
|
||||
return true;
|
||||
break;
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1313,26 +1313,26 @@ var addExtraPropertiesToGuestNetworkObject = function(jsonObj) {
|
|||
jsonObj.vlan = jsonObj.broadcasturi.replace("vlan://", "");
|
||||
}
|
||||
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://", "");
|
||||
}
|
||||
}
|
||||
|
||||
//used by infrastructure page
|
||||
var addExtraPropertiesToUcsBladeObject = function(jsonObj) {
|
||||
var array1 = jsonObj.bladedn.split('/');
|
||||
jsonObj.chassis = array1[1];
|
||||
jsonObj.bladeid = array1[2];
|
||||
var array1 = jsonObj.bladedn.split('/');
|
||||
jsonObj.chassis = array1[1];
|
||||
jsonObj.bladeid = array1[2];
|
||||
}
|
||||
|
||||
var processPropertiesInImagestoreObject = function(jsonObj) {
|
||||
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 passwordIndex = url.indexOf('&password='); //38
|
||||
var domainIndex = url.indexOf('&domain='); //51
|
||||
if (passwordIndex >= 0) {
|
||||
jsonObj.url = url.substring(0, passwordIndex) + url.substring(domainIndex); //remove '&password=ccc' from jsonObj.url
|
||||
}
|
||||
}
|
||||
var processPropertiesInImagestoreObject = function(jsonObj) {
|
||||
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 passwordIndex = url.indexOf('&password='); //38
|
||||
var domainIndex = url.indexOf('&domain='); //51
|
||||
if (passwordIndex >= 0) {
|
||||
jsonObj.url = url.substring(0, passwordIndex) + url.substring(domainIndex); //remove '&password=ccc' from jsonObj.url
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//find service object in network object
|
||||
|
|
@ -1388,14 +1388,14 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||
}
|
||||
|
||||
if (server.indexOf('://') == -1) {
|
||||
url += 'cifs://';
|
||||
url += 'cifs://';
|
||||
}
|
||||
|
||||
|
||||
url += (server + path);
|
||||
|
||||
|
||||
return url;
|
||||
}
|
||||
|
||||
|
||||
function presetupURL(server, path) {
|
||||
var url;
|
||||
if (server.indexOf("://") == -1)
|
||||
|
|
@ -1427,9 +1427,9 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||
var url;
|
||||
|
||||
/*
|
||||
Replace the + and / symbols by - and _ to have URL-safe base64 going to the API
|
||||
It's hacky, but otherwise we'll confuse java.net.URI which splits the incoming URI
|
||||
*/
|
||||
Replace the + and / symbols by - and _ to have URL-safe base64 going to the API
|
||||
It's hacky, but otherwise we'll confuse java.net.URI which splits the incoming URI
|
||||
*/
|
||||
secret = secret.replace("+", "-");
|
||||
secret = secret.replace("/", "_");
|
||||
|
||||
|
|
@ -1499,11 +1499,11 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
|
|||
}
|
||||
return vmName;
|
||||
}
|
||||
|
||||
|
||||
var timezoneMap = new Object();
|
||||
timezoneMap["Etc/GMT+12"] = "Etc/GMT+12 [GMT-12: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/Pago_Pago"] = "Pacific/Pago_Pago [Samoa Standard Time]";
|
||||
timezoneMap["Pacific/Samoa"] = "Pacific/Samoa [Samoa Standard Time]";
|
||||
|
|
@ -2221,12 +2221,12 @@ cloudStack.api = {
|
|||
}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
if (args.jsonObj != undefined) {
|
||||
args.response.success({
|
||||
data: args.jsonObj.tags
|
||||
});
|
||||
} else {
|
||||
var resourceId = args.context[contextId][0].id;
|
||||
if (args.jsonObj != undefined) {
|
||||
args.response.success({
|
||||
data: args.jsonObj.tags
|
||||
});
|
||||
} else {
|
||||
var resourceId = args.context[contextId][0].id;
|
||||
var data = {
|
||||
resourceId: resourceId,
|
||||
resourceType: resourceType
|
||||
|
|
@ -2256,7 +2256,7 @@ cloudStack.api = {
|
|||
args.response.error(parseXMLHttpResponse(json));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,15 +53,6 @@
|
|||
vmdisplayname: {
|
||||
label: 'label.vm.display.name'
|
||||
}
|
||||
|
||||
/*
|
||||
state: {
|
||||
label: 'State',
|
||||
indicator: {
|
||||
'Ready': 'on'
|
||||
}
|
||||
}
|
||||
*/
|
||||
},
|
||||
|
||||
// List view actions
|
||||
|
|
@ -268,7 +259,7 @@
|
|||
createForm: {
|
||||
title: 'Upload Volume from URL',
|
||||
fields: {
|
||||
url: {
|
||||
url: {
|
||||
label: 'label.url',
|
||||
docID: 'helpUploadVolumeURL',
|
||||
validation: {
|
||||
|
|
@ -330,29 +321,29 @@
|
|||
});
|
||||
}
|
||||
|
||||
},
|
||||
},
|
||||
diskOffering: {
|
||||
label: 'Custom Disk Offering',
|
||||
docID: 'helpVolumeDiskOffering',
|
||||
select: function(args) {
|
||||
var diskofferingObjs;
|
||||
$.ajax({
|
||||
var diskofferingObjs;
|
||||
$.ajax({
|
||||
url: createURL("listDiskOfferings"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
|
||||
var items = [{
|
||||
id: '',
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
$(diskofferingObjs).each(function() {
|
||||
if (this.iscustomized == true) {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.displaytext
|
||||
});
|
||||
}
|
||||
if (this.iscustomized == true) {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.displaytext
|
||||
});
|
||||
}
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
|
|
@ -360,29 +351,29 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
diskOffering: {
|
||||
label: 'Custom Disk Offering',
|
||||
docID: 'helpVolumeDiskOffering',
|
||||
select: function(args) {
|
||||
var diskofferingObjs;
|
||||
$.ajax({
|
||||
var diskofferingObjs;
|
||||
$.ajax({
|
||||
url: createURL("listDiskOfferings"),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
diskofferingObjs = json.listdiskofferingsresponse.diskoffering;
|
||||
var items = [{
|
||||
id: '',
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
$(diskofferingObjs).each(function() {
|
||||
if (this.iscustomized == true) {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.displaytext
|
||||
});
|
||||
}
|
||||
if (this.iscustomized == true) {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.displaytext
|
||||
});
|
||||
}
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
|
|
@ -390,7 +381,7 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
checksum: {
|
||||
docID: 'helpUploadVolumeChecksum',
|
||||
label: 'label.md5.checksum'
|
||||
|
|
@ -406,12 +397,12 @@
|
|||
url: args.data.url
|
||||
};
|
||||
|
||||
if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
|
||||
$.extend(data, {
|
||||
diskofferingid: args.data.diskOffering
|
||||
if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
|
||||
$.extend(data, {
|
||||
diskofferingid: args.data.diskOffering
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (args.data.checksum != null && args.data.checksum.length > 0) {
|
||||
$.extend(data, {
|
||||
checksum: args.data.checksum
|
||||
|
|
@ -445,7 +436,7 @@
|
|||
poll: pollAsyncJobResult
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
uploadVolumefromLocal: {
|
||||
isHeader: true,
|
||||
label: 'Upload from Local',
|
||||
|
|
@ -462,7 +453,7 @@
|
|||
fileUpload: {
|
||||
getURL: function(args) {
|
||||
args.data = args.formData;
|
||||
|
||||
|
||||
var data = {
|
||||
name: args.data.name,
|
||||
zoneId: args.data.availabilityZone,
|
||||
|
|
@ -475,7 +466,7 @@
|
|||
checksum: args.data.checksum
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL('getUploadParamsForVolume'),
|
||||
data: data,
|
||||
|
|
@ -506,7 +497,7 @@
|
|||
args.response.success();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
volumeFileUpload: {
|
||||
label: 'local file',
|
||||
|
|
@ -584,7 +575,7 @@
|
|||
notification: {
|
||||
poll: pollAsyncJobResult
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
advSearchFields: {
|
||||
|
|
@ -686,12 +677,12 @@
|
|||
$.extend(data, {
|
||||
virtualMachineId: args.context.instances[0].id
|
||||
});
|
||||
}
|
||||
}
|
||||
if ("primarystorages" in args.context) {
|
||||
$.extend(data, {
|
||||
storageid: args.context.primarystorages[0].id
|
||||
storageid: args.context.primarystorages[0].id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
|
|
@ -804,9 +795,9 @@
|
|||
isBoolean: true,
|
||||
isHidden: function(args) {
|
||||
if (args.context.volumes[0].quiescevm == true)
|
||||
return false;
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
},
|
||||
name: {
|
||||
|
|
@ -1137,7 +1128,7 @@
|
|||
hypervisor: args.context.volumes[0].hypervisor
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$(['Running', 'Stopped']).each(function() {
|
||||
$.ajax({
|
||||
url: createURL('listVirtualMachines'),
|
||||
|
|
@ -1147,11 +1138,11 @@
|
|||
async: false,
|
||||
success: function(json) {
|
||||
var instanceObjs = json.listvirtualmachinesresponse.virtualmachine;
|
||||
$(instanceObjs).each(function() {
|
||||
$(instanceObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.displayname ? this.displayname : this.name
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1285,12 +1276,12 @@
|
|||
title: 'label.create.template',
|
||||
preFilter: cloudStack.preFilter.createTemplate,
|
||||
desc: '',
|
||||
preFilter: function(args) {
|
||||
if (args.context.volumes[0].hypervisor == "XenServer") {
|
||||
if (isAdmin()) {
|
||||
args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
||||
}
|
||||
}
|
||||
preFilter: function(args) {
|
||||
if (args.context.volumes[0].hypervisor == "XenServer") {
|
||||
if (isAdmin()) {
|
||||
args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
|
||||
}
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
|
|
@ -1304,25 +1295,25 @@
|
|||
validation: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
},
|
||||
xenserverToolsVersion61plus: {
|
||||
label: 'label.xenserver.tools.version.61.plus',
|
||||
isBoolean: true,
|
||||
isChecked: function (args) {
|
||||
var b = false;
|
||||
var vmObj;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines"),
|
||||
data: {
|
||||
id: args.context.volumes[0].virtualmachineid
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||
}
|
||||
});
|
||||
if (vmObj == undefined) { //e.g. VM has failed over
|
||||
if (isAdmin()) {
|
||||
isChecked: function (args) {
|
||||
var b = false;
|
||||
var vmObj;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualMachines"),
|
||||
data: {
|
||||
id: args.context.volumes[0].virtualmachineid
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
|
||||
}
|
||||
});
|
||||
if (vmObj == undefined) { //e.g. VM has failed over
|
||||
if (isAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
|
|
@ -1336,18 +1327,18 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
if ('details' in vmObj && 'hypervisortoolsversion' in vmObj.details) {
|
||||
} else {
|
||||
if ('details' in vmObj && 'hypervisortoolsversion' in vmObj.details) {
|
||||
if (vmObj.details.hypervisortoolsversion == 'xenserver61')
|
||||
b = true;
|
||||
else
|
||||
b = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return b;
|
||||
},
|
||||
isHidden: true
|
||||
},
|
||||
},
|
||||
osTypeId: {
|
||||
label: 'label.os.type',
|
||||
select: function(args) {
|
||||
|
|
@ -1406,17 +1397,17 @@
|
|||
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]').css("display") != "none") {
|
||||
$.extend(data, {
|
||||
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
||||
});
|
||||
}
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
|
||||
$.extend(data, {
|
||||
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
|
||||
});
|
||||
}
|
||||
}
|
||||
//XenServer only (ends here)
|
||||
|
||||
$.ajax({
|
||||
url: createURL('createTemplate'),
|
||||
data: data,
|
||||
|
|
@ -1580,8 +1571,8 @@
|
|||
return;
|
||||
|
||||
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 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
|
||||
|
|
@ -1589,7 +1580,7 @@
|
|||
} else {
|
||||
$shrinkok.hide();
|
||||
}
|
||||
|
||||
|
||||
var $newsize = $form.find('.form-item[rel=newsize]');
|
||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||
$newsize.css('display', 'inline-block');
|
||||
|
|
@ -1642,11 +1633,11 @@
|
|||
},
|
||||
action: function(args) {
|
||||
var array1 = [];
|
||||
|
||||
if(args.$form.find('.form-item[rel=shrinkok]').css("display") != "none") {
|
||||
array1.push("&shrinkok=" + (args.data.shrinkok == "on"));
|
||||
}
|
||||
|
||||
|
||||
if(args.$form.find('.form-item[rel=shrinkok]').css("display") != "none") {
|
||||
array1.push("&shrinkok=" + (args.data.shrinkok == "on"));
|
||||
}
|
||||
|
||||
var newDiskOffering = args.data.newdiskoffering;
|
||||
var newSize;
|
||||
if (selectedDiskOfferingObj.iscustomized == true) {
|
||||
|
|
@ -1838,13 +1829,13 @@
|
|||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var jsonObj = json.listvolumesresponse.volume[0];
|
||||
|
||||
var jsonObj = json.listvolumesresponse.volume[0];
|
||||
|
||||
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
|
||||
obj: jsonObj,
|
||||
objType: "Volume"
|
||||
obj: jsonObj,
|
||||
objType: "Volume"
|
||||
});
|
||||
|
||||
|
||||
args.response.success({
|
||||
actionFilter: volumeActionfilter,
|
||||
data: jsonObj
|
||||
|
|
@ -2117,11 +2108,11 @@
|
|||
title: 'label.action.create.volume',
|
||||
desc: '',
|
||||
preFilter: function(args) {
|
||||
if (g_regionsecondaryenabled == true) {
|
||||
args.$form.find('.form-item[rel=zoneid]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=zoneid]').hide();
|
||||
}
|
||||
if (g_regionsecondaryenabled == true) {
|
||||
args.$form.find('.form-item[rel=zoneid]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=zoneid]').hide();
|
||||
}
|
||||
},
|
||||
fields: {
|
||||
name: {
|
||||
|
|
@ -2129,9 +2120,9 @@
|
|||
validation: {
|
||||
required: true
|
||||
}
|
||||
},
|
||||
},
|
||||
zoneid: {
|
||||
label: 'label.availability.zone',
|
||||
label: 'label.availability.zone',
|
||||
isHidden: true,
|
||||
select: function(args) {
|
||||
$.ajax({
|
||||
|
|
@ -2139,26 +2130,26 @@
|
|||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var zoneObjs = json.listzonesresponse.zone;
|
||||
var zoneObjs = json.listzonesresponse.zone;
|
||||
var items = [{
|
||||
id: '',
|
||||
description: ''
|
||||
}];
|
||||
}];
|
||||
if (zoneObjs != null) {
|
||||
for (i = 0; i < zoneObjs.length; i++) {
|
||||
items.push({
|
||||
id: zoneObjs[i].id,
|
||||
description: zoneObjs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
for (i = 0; i < zoneObjs.length; i++) {
|
||||
items.push({
|
||||
id: zoneObjs[i].id,
|
||||
description: zoneObjs[i].name
|
||||
});
|
||||
}
|
||||
}
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
|
|
@ -2166,13 +2157,13 @@
|
|||
snapshotid: args.context.snapshots[0].id,
|
||||
name: args.data.name
|
||||
};
|
||||
|
||||
if (args.$form.find('.form-item[rel=zoneid]').css("display") != "none" && args.data.zoneid != '') {
|
||||
$.extend(data, {
|
||||
zoneId: args.data.zoneid
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
if (args.$form.find('.form-item[rel=zoneid]').css("display") != "none" && args.data.zoneid != '') {
|
||||
$.extend(data, {
|
||||
zoneId: args.data.zoneid
|
||||
});
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('createVolume'),
|
||||
data: data,
|
||||
|
|
@ -2329,22 +2320,22 @@
|
|||
return ["remove"];
|
||||
}
|
||||
|
||||
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
||||
if (jsonObj.hypervisor == 'KVM') {
|
||||
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)
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
} else {
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
} else {
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
|
||||
if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
|
||||
if (jsonObj.hypervisor == 'KVM') {
|
||||
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)
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
} else {
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
} else {
|
||||
allowedActions.push("takeSnapshot");
|
||||
allowedActions.push("recurringSnapshot");
|
||||
}
|
||||
|
||||
if (jsonObj.type == "DATADISK") {
|
||||
allowedActions.push("resize");
|
||||
}
|
||||
|
|
|
|||
2994
ui/scripts/system.js
2994
ui/scripts/system.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
|
@ -130,89 +130,89 @@
|
|||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
//for testing only (begin)
|
||||
/*
|
||||
json = {
|
||||
"ldapuserresponse": {
|
||||
"count": 11,
|
||||
"LdapUser": [
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Administrator",
|
||||
"domain": "CN=Administrator"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Guest",
|
||||
"domain": "CN=Guest"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IUSR_HYD-QA12",
|
||||
"domain": "CN=IUSR_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IWAM_HYD-QA12",
|
||||
"domain": "CN=IWAM_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "SUPPORT_388945a0",
|
||||
"domain": "CN=SUPPORT_388945a0"
|
||||
},
|
||||
{
|
||||
"principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "jessica",
|
||||
"lastname": "j",
|
||||
"username": "jessica",
|
||||
"domain": "CN=jessica j"
|
||||
},
|
||||
{
|
||||
"principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "krbtgt",
|
||||
"domain": "CN=krbtgt"
|
||||
},
|
||||
{
|
||||
"email": "sadhu@sadhu.com",
|
||||
"principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sadhu",
|
||||
"username": "sadhu",
|
||||
"domain": "CN=sadhu"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sangee1",
|
||||
"lastname": "hariharan",
|
||||
"username": "sangee1",
|
||||
"domain": "CN=sangee1 hariharan"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sanjeev",
|
||||
"username": "sanjeev",
|
||||
"domain": "CN=sanjeev n."
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "test1",
|
||||
"username": "test1dddd",
|
||||
"domain": "CN=test1dddd"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
*/
|
||||
//for testing only (end)
|
||||
|
||||
//for testing only (begin)
|
||||
/*
|
||||
json = {
|
||||
"ldapuserresponse": {
|
||||
"count": 11,
|
||||
"LdapUser": [
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Administrator,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Administrator",
|
||||
"domain": "CN=Administrator"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=Guest,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "Guest",
|
||||
"domain": "CN=Guest"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IUSR_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IUSR_HYD-QA12",
|
||||
"domain": "CN=IUSR_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=IWAM_HYD-QA12,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "IWAM_HYD-QA12",
|
||||
"domain": "CN=IWAM_HYD-QA12"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=SUPPORT_388945a0,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "SUPPORT_388945a0",
|
||||
"domain": "CN=SUPPORT_388945a0"
|
||||
},
|
||||
{
|
||||
"principal": "CN=jessica j,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "jessica",
|
||||
"lastname": "j",
|
||||
"username": "jessica",
|
||||
"domain": "CN=jessica j"
|
||||
},
|
||||
{
|
||||
"principal": "CN=krbtgt,CN=Users,DC=hyd-qa,DC=com",
|
||||
"username": "krbtgt",
|
||||
"domain": "CN=krbtgt"
|
||||
},
|
||||
{
|
||||
"email": "sadhu@sadhu.com",
|
||||
"principal": "CN=sadhu,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sadhu",
|
||||
"username": "sadhu",
|
||||
"domain": "CN=sadhu"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sangee1 hariharan,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sangee1",
|
||||
"lastname": "hariharan",
|
||||
"username": "sangee1",
|
||||
"domain": "CN=sangee1 hariharan"
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=sanjeev n.,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "sanjeev",
|
||||
"username": "sanjeev",
|
||||
"domain": "CN=sanjeev n."
|
||||
},
|
||||
{
|
||||
"email": "test@test.com",
|
||||
"principal": "CN=test1dddd,CN=Users,DC=hyd-qa,DC=com",
|
||||
"firstname": "test1",
|
||||
"username": "test1dddd",
|
||||
"domain": "CN=test1dddd"
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
*/
|
||||
//for testing only (end)
|
||||
|
||||
if (json.ldapuserresponse.count > 0) {
|
||||
$(json.ldapuserresponse.LdapUser).each(function() {
|
||||
var $result = $('<tr>');
|
||||
|
|
@ -334,4 +334,4 @@
|
|||
accountsWizard(args);
|
||||
};
|
||||
};
|
||||
})(jQuery, cloudStack);
|
||||
})(jQuery, cloudStack);
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@
|
|||
|
||||
'select-iso': function($step, formData) {
|
||||
$step.find('.section.custom-size').hide();
|
||||
|
||||
|
||||
var originalValues = function(formData) {
|
||||
var $inputs = $step.find('.wizard-step-conditional:visible')
|
||||
.find('input[type=radio]');
|
||||
|
|
@ -323,7 +323,7 @@
|
|||
|
||||
return {
|
||||
response: {
|
||||
success: function(args) {
|
||||
success: function(args) {
|
||||
if (formData['select-template']) {
|
||||
$step.find('.wizard-step-conditional').filter(function() {
|
||||
return $(this).hasClass(formData['select-template']);
|
||||
|
|
@ -462,7 +462,7 @@
|
|||
}, {
|
||||
'wizard-field': 'service-offering'
|
||||
})
|
||||
);
|
||||
);
|
||||
|
||||
$step.find('input[type=radio]').bind('change', function() {
|
||||
var $target = $(this);
|
||||
|
|
@ -576,7 +576,7 @@
|
|||
$selectContainer.hide();
|
||||
|
||||
// Fix issue with containers always showing after reload
|
||||
$multiDiskSelect.find('.select-container').attr('style', null);
|
||||
$multiDiskSelect.find('.select-container').attr('style', null);
|
||||
} else {
|
||||
$selectContainer.show();
|
||||
$step.find('.content .select-container').append(
|
||||
|
|
@ -618,7 +618,7 @@
|
|||
// handle removal of custom IOPS controls
|
||||
$step.removeClass('custom-iops-do');
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1137,19 +1137,19 @@
|
|||
// Next button
|
||||
if ($target.closest('div.button.next').size()) {
|
||||
//step 2 - select template/ISO
|
||||
if($activeStep.hasClass('select-iso')) {
|
||||
if ($activeStep.find('.content:visible input:checked').size() == 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: 'message.step.1.continue'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
|
||||
$form: $form,
|
||||
currentStep: 2
|
||||
});
|
||||
}
|
||||
|
||||
if($activeStep.hasClass('select-iso')) {
|
||||
if ($activeStep.find('.content:visible input:checked').size() == 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: 'message.step.1.continue'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
$(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
|
||||
$form: $form,
|
||||
currentStep: 2
|
||||
});
|
||||
}
|
||||
|
||||
//step 6 - select network
|
||||
if ($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
||||
var data = $activeStep.data('my-networks');
|
||||
|
|
@ -1277,7 +1277,7 @@
|
|||
$wizard.find('.tab-view').tabs();
|
||||
$wizard.find('.slider').each(function() {
|
||||
var $slider = $(this);
|
||||
|
||||
|
||||
$slider.slider({
|
||||
min: minCustomDiskSize,
|
||||
max: maxCustomDiskSize,
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@
|
|||
);
|
||||
|
||||
$li.appendTo($socketInfo);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -53,13 +53,13 @@
|
|||
|
||||
$plugin.click(function() {
|
||||
var $mainSection = $('#navigation ul li').filter('.' + plugin.id);
|
||||
|
||||
|
||||
if ($mainSection.size()) {
|
||||
$mainSection.click();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$browser.cloudBrowser('addPanel', {
|
||||
title: plugin.title,
|
||||
$parent: $('.panel:first'),
|
||||
|
|
|
|||
|
|
@ -36,10 +36,6 @@
|
|||
|
||||
$li.data('region-data', region);
|
||||
|
||||
/* e.g.
|
||||
region.endpoint == "http://localhost:8080/client/"
|
||||
document.location.href == "http://localhost:8080/client/#"
|
||||
*/
|
||||
if (document.location.href.indexOf(region.endpoint) != -1) {
|
||||
currentRegion = region;
|
||||
$li.addClass('active');
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@
|
|||
if ($.inArray(trafficType.dependsOn, validTrafficTypes) == -1) { //if its dependsOn is not a valid traffic type, either
|
||||
return true; //skip this item
|
||||
}
|
||||
//else, if its dependsOn is a valid traffic type, continue to Make list item (e.g. providers.dependsOn is 'guest')
|
||||
//else, if its dependsOn is a valid traffic type, continue to Make list item (e.g. providers.dependsOn is 'guest')
|
||||
} else {
|
||||
return true; //if it doesn't have dependsOn, skip this item
|
||||
}
|
||||
|
|
|
|||
|
|
@ -296,91 +296,91 @@
|
|||
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
|
||||
var zoneType = getData($trafficType.closest('.zone-wizard')).zone.networkType;
|
||||
var fields;
|
||||
|
||||
|
||||
if (hypervisor == 'VMware') {
|
||||
fields = {
|
||||
vSwitchName: {
|
||||
label: 'label.vswitch.name' ,
|
||||
defaultValue: trafficData.vSwitchName
|
||||
},
|
||||
vlanId: {
|
||||
label: 'label.vlan.id',
|
||||
defaultValue: trafficData.vlanId
|
||||
}
|
||||
};
|
||||
|
||||
if(zoneType == 'Advanced') {
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
if(trafficData.vSwitchType == null) {
|
||||
var useDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useDvs == true) {
|
||||
var useNexusDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useNexusDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useNexusDvs == true) {
|
||||
trafficData.vSwitchType = 'nexusdvs';
|
||||
fields.vSwitchName.defaultValue = 'epp0';
|
||||
} else {
|
||||
trafficData.vSwitchType = 'vmwaredvs';
|
||||
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||
}
|
||||
} else { //useDvs == false
|
||||
trafficData.vSwitchType = 'vmwaresvs';
|
||||
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
label: 'label.vSwitch.type',
|
||||
select: function (args) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: 'nexusdvs',
|
||||
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaresvs',
|
||||
description: 'VMware vNetwork Standard Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaredvs',
|
||||
description: 'VMware vNetwork Distributed Virtual Switch'
|
||||
}]
|
||||
});
|
||||
},
|
||||
defaultValue: trafficData.vSwitchType
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fields = {
|
||||
label: {
|
||||
label: hypervisor + ' ' + _l('label.traffic.label'),
|
||||
defaultValue: trafficData.label
|
||||
}
|
||||
};
|
||||
fields = {
|
||||
vSwitchName: {
|
||||
label: 'label.vswitch.name' ,
|
||||
defaultValue: trafficData.vSwitchName
|
||||
},
|
||||
vlanId: {
|
||||
label: 'label.vlan.id',
|
||||
defaultValue: trafficData.vlanId
|
||||
}
|
||||
};
|
||||
|
||||
if(zoneType == 'Advanced') {
|
||||
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
|
||||
if(trafficData.vSwitchType == null) {
|
||||
var useDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.dvswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useDvs == true) {
|
||||
var useNexusDvs = false;
|
||||
$.ajax({
|
||||
url: createURL('listConfigurations'),
|
||||
data: {
|
||||
name: 'vmware.use.nexus.vswitch'
|
||||
},
|
||||
async: false,
|
||||
success: function(json) {
|
||||
if (json.listconfigurationsresponse.configuration[0].value == 'true') {
|
||||
useNexusDvs = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
if (useNexusDvs == true) {
|
||||
trafficData.vSwitchType = 'nexusdvs';
|
||||
fields.vSwitchName.defaultValue = 'epp0';
|
||||
} else {
|
||||
trafficData.vSwitchType = 'vmwaredvs';
|
||||
fields.vSwitchName.defaultValue = 'dvSwitch0';
|
||||
}
|
||||
} else { //useDvs == false
|
||||
trafficData.vSwitchType = 'vmwaresvs';
|
||||
fields.vSwitchName.defaultValue = 'vSwitch0';
|
||||
}
|
||||
}
|
||||
|
||||
$.extend(fields, {
|
||||
vSwitchType: {
|
||||
label: 'label.vSwitch.type',
|
||||
select: function (args) {
|
||||
args.response.success({
|
||||
data: [{
|
||||
id: 'nexusdvs',
|
||||
description: 'Cisco Nexus 1000v Distributed Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaresvs',
|
||||
description: 'VMware vNetwork Standard Virtual Switch'
|
||||
}, {
|
||||
id: 'vmwaredvs',
|
||||
description: 'VMware vNetwork Distributed Virtual Switch'
|
||||
}]
|
||||
});
|
||||
},
|
||||
defaultValue: trafficData.vSwitchType
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fields = {
|
||||
label: {
|
||||
label: hypervisor + ' ' + _l('label.traffic.label'),
|
||||
defaultValue: trafficData.label
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
cloudStack.dialog.createForm({
|
||||
|
|
@ -390,7 +390,7 @@
|
|||
fields: fields
|
||||
},
|
||||
|
||||
after: function(args) {
|
||||
after: function(args) {
|
||||
$trafficType.data('traffic-type-data', args.data);
|
||||
}
|
||||
});
|
||||
|
|
@ -727,7 +727,7 @@
|
|||
$('<option>').attr({
|
||||
value: 'L3VPN'
|
||||
}).html('L3VPN'),
|
||||
$('<option>').attr({
|
||||
$('<option>').attr({
|
||||
value: 'VSP'
|
||||
}).html('VSP'),
|
||||
$('<option>').attr({
|
||||
|
|
|
|||
|
|
@ -98,7 +98,7 @@
|
|||
$navItem.addClass('active');
|
||||
$browser.cloudBrowser('removeAllPanels');
|
||||
}
|
||||
|
||||
|
||||
$browser.cloudBrowser('addPanel', {
|
||||
title: '<span class="section">' + _l(data.title) + '</span>' + '<span class="subsection"></span>',
|
||||
data: '',
|
||||
|
|
@ -106,7 +106,7 @@
|
|||
if(!isPlugin) {
|
||||
$breadcrumb.attr('title', _l(data.title));
|
||||
}
|
||||
|
||||
|
||||
data.$breadcrumb = $breadcrumb;
|
||||
|
||||
// Hide breadcrumb if this is the home section
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@
|
|||
|
||||
// Description text
|
||||
var formDesc;
|
||||
if (typeof(args.form.desc) == 'function') {
|
||||
formDesc = args.form.desc(args);
|
||||
if (typeof(args.form.desc) == 'function') {
|
||||
formDesc = args.form.desc(args);
|
||||
} else { //typeof(args.form.desc) == 'string' or 'undefined'
|
||||
formDesc = args.form.desc;
|
||||
}
|
||||
formDesc = args.form.desc;
|
||||
}
|
||||
$('<span>').addClass('message').prependTo($formContainer).html(
|
||||
_l(formDesc)
|
||||
);
|
||||
|
|
@ -225,7 +225,7 @@
|
|||
|
||||
if ($dependsOn.is('[type=checkbox]')) {
|
||||
var isReverse = false;
|
||||
|
||||
|
||||
if (args.form.fields[dependsOn]) {
|
||||
isReverse = args.form.fields[dependsOn].isReverse;
|
||||
isChecked = args.form.fields[dependsOn].isChecked;
|
||||
|
|
@ -238,10 +238,10 @@
|
|||
|
||||
if (($target.is(':checked') && !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.each(function() {
|
||||
if ($(this).data('dialog-select-fn')) {
|
||||
$(this).data('dialog-select-fn')();
|
||||
|
|
@ -281,11 +281,11 @@
|
|||
context: args.context,
|
||||
response: {
|
||||
success: function(args) {
|
||||
if (args.data == undefined || args.data.length == 0) {
|
||||
var $option = $('<option>')
|
||||
.appendTo($input)
|
||||
if (args.data == undefined || args.data.length == 0) {
|
||||
var $option = $('<option>')
|
||||
.appendTo($input)
|
||||
.html("");
|
||||
} else {
|
||||
} else {
|
||||
$(args.data).each(function() {
|
||||
var id;
|
||||
if (field.valueField)
|
||||
|
|
@ -305,7 +305,7 @@
|
|||
.data('json-obj', this)
|
||||
.html(_s(desc));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (field.defaultValue) {
|
||||
$input.val(_s(strOrFunc(field.defaultValue, args.data)));
|
||||
|
|
@ -410,14 +410,14 @@
|
|||
name: key,
|
||||
type: 'checkbox'
|
||||
}).appendTo($value);
|
||||
var isChecked;
|
||||
if (typeof (field.isChecked) == 'function') {
|
||||
isChecked = field.isChecked(args);
|
||||
} else {
|
||||
isChecked = field.isChecked;
|
||||
}
|
||||
var isChecked;
|
||||
if (typeof (field.isChecked) == 'function') {
|
||||
isChecked = field.isChecked(args);
|
||||
} else {
|
||||
isChecked = field.isChecked;
|
||||
}
|
||||
if (isChecked) {
|
||||
$input.attr('checked', strOrFunc(field.isChecked, args));
|
||||
$input.attr('checked', strOrFunc(field.isChecked, args));
|
||||
} else {
|
||||
// This is mainly for IE compatibility
|
||||
setTimeout(function() {
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
return '';
|
||||
}
|
||||
|
||||
var sanitized = value
|
||||
var sanitized = value
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">");
|
||||
|
||||
|
|
|
|||
|
|
@ -235,11 +235,11 @@
|
|||
}
|
||||
|
||||
if (messages.complete) {
|
||||
if( messages.complete(args2.data) != null && messages.complete(args2.data).length > 0) {
|
||||
cloudStack.dialog.notice({
|
||||
if( messages.complete(args2.data) != null && messages.complete(args2.data).length > 0) {
|
||||
cloudStack.dialog.notice({
|
||||
message: messages.complete(args2.data)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
if (additional && additional.complete) additional.complete($.extend(true, args, {
|
||||
$detailView: $detailView
|
||||
|
|
@ -311,7 +311,7 @@
|
|||
if (messages && messages.confirm) {
|
||||
cloudStack.dialog.confirm({
|
||||
message: messages.confirm(messageArgs),
|
||||
isWarning: messages.isWarning,
|
||||
isWarning: messages.isWarning,
|
||||
action: function() {
|
||||
performAction({
|
||||
id: id
|
||||
|
|
@ -387,48 +387,48 @@
|
|||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
destroy: function($detailView, args) {
|
||||
var tab = args.tabs[args.activeTab];
|
||||
var isMultiple = tab.multiple;
|
||||
|
||||
uiActions.standard($detailView, args, {
|
||||
noRefresh: true,
|
||||
complete: function(args, args2) {
|
||||
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
|
||||
if (isMultiple && $detailView.is(':visible')) {
|
||||
$detailView.find('.refresh').click(); // Reload tab
|
||||
} else {
|
||||
var $browser = $('#browser .container');
|
||||
var $panel = $detailView.closest('.panel');
|
||||
|
||||
if ($detailView.is(':visible')) {
|
||||
$browser.cloudBrowser('selectPanel', {
|
||||
panel: $panel.prev()
|
||||
});
|
||||
}
|
||||
|
||||
if ($detailView.data("list-view-row") != null) {
|
||||
var $row = $detailView.data('list-view-row');
|
||||
var $tbody = $row.closest('tbody');
|
||||
|
||||
$row.remove();
|
||||
if (!$tbody.find('tr').size()) {
|
||||
$("<tr>").addClass('empty').append(
|
||||
$("<td>").html(_l('label.no.data'))
|
||||
).appendTo($tbody);
|
||||
}
|
||||
$tbody.closest('table').dataTable('refresh');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$detailView.find('.refresh').click(); // Reload tab
|
||||
}
|
||||
complete: function(args, args2) {
|
||||
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
|
||||
if (isMultiple && $detailView.is(':visible')) {
|
||||
$detailView.find('.refresh').click(); // Reload tab
|
||||
} else {
|
||||
var $browser = $('#browser .container');
|
||||
var $panel = $detailView.closest('.panel');
|
||||
|
||||
if ($detailView.is(':visible')) {
|
||||
$browser.cloudBrowser('selectPanel', {
|
||||
panel: $panel.prev()
|
||||
});
|
||||
}
|
||||
|
||||
if ($detailView.data("list-view-row") != null) {
|
||||
var $row = $detailView.data('list-view-row');
|
||||
var $tbody = $row.closest('tbody');
|
||||
|
||||
$row.remove();
|
||||
if (!$tbody.find('tr').size()) {
|
||||
$("<tr>").addClass('empty').append(
|
||||
$("<td>").html(_l('label.no.data'))
|
||||
).appendTo($tbody);
|
||||
}
|
||||
$tbody.closest('table').dataTable('refresh');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$detailView.find('.refresh').click(); // Reload tab
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Convert editable fields to text boxes; clicking again saves data
|
||||
*
|
||||
|
|
@ -1060,22 +1060,6 @@
|
|||
isOddRow = true;
|
||||
}
|
||||
|
||||
//???
|
||||
/*
|
||||
if("pollAgainIfValueIsIn" in value) {
|
||||
if ((content in value.pollAgainIfValueIsIn) && (value.pollAgainFn != null)) {
|
||||
//poll again
|
||||
var intervalKey = setInterval(function() {
|
||||
var toClearInterval = value.pollAgainFn(context);
|
||||
if(toClearInterval == true) {
|
||||
clearInterval(intervalKey);
|
||||
$('.detail-view .toolbar .button.refresh').click(); //click Refresh button to refresh detailView
|
||||
}
|
||||
}, 2000);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
$name.html(_l(value.label));
|
||||
$value.html(_s(content));
|
||||
$value.attr('title', _s(content));
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@
|
|||
(function($, cloudStack, _l, _s) {
|
||||
var uiActions = {
|
||||
standard: function($instanceRow, args, additional) {
|
||||
var isAddAction = args.action.isAdd;
|
||||
|
||||
var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
|
||||
var isAddAction = args.action.isAdd;
|
||||
|
||||
var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
|
||||
var notification = args.action.notification ? args.action.notification : {};
|
||||
var messages = args.action ? args.action.messages : {};
|
||||
var preAction = args.action ? args.action.preAction : {};
|
||||
|
|
@ -275,7 +275,7 @@
|
|||
});
|
||||
} else {
|
||||
$newRow = replaceItem($instanceRow,
|
||||
args.data, //$.extend($instanceRow.data('json-obj'), args.data), /* $.extend($instanceRow.data('json-obj'), args.data) causes CLOUDSTACK-4687 */
|
||||
args.data,
|
||||
actionFilter);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -366,7 +366,7 @@
|
|||
error: function(message) {
|
||||
$instanceRow.removeClass('loading');
|
||||
$instanceRow.find('td.quick-view').removeClass('loading-overlay');
|
||||
|
||||
|
||||
if (!isHeader) {
|
||||
if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') ||
|
||||
(!args.action.createForm && args.action.addRow == 'true')) {
|
||||
|
|
@ -629,10 +629,10 @@
|
|||
showEditField();
|
||||
} else if ($editInput.val() != $label.html()) { //click Save button with changed value
|
||||
if ($editInput.val().match(/<|>/)) {
|
||||
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
|
||||
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
$edit.animate({
|
||||
opacity: 0.5
|
||||
});
|
||||
|
|
@ -1148,7 +1148,7 @@
|
|||
|
||||
$td.attr('title', _s(content));
|
||||
});
|
||||
|
||||
|
||||
var $first = $tr.find('td:first');
|
||||
if (multiSelect)
|
||||
$first = $first.next();
|
||||
|
|
@ -1208,15 +1208,15 @@
|
|||
rowActions[actionName]($tr);
|
||||
var map1 = {};
|
||||
$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.
|
||||
* e.g. An Template/ISO of multiple zones have the same UUID.
|
||||
*/
|
||||
var objId = $(this).data('json-obj').id;
|
||||
if(!(objId in map1)) {
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var objId = $(this).data('json-obj').id;
|
||||
if(!(objId in map1)) {
|
||||
sort($(this), action);
|
||||
map1[objId] = 1;
|
||||
}
|
||||
map1[objId] = 1;
|
||||
}
|
||||
});
|
||||
$tr.closest('.data-table').dataTable('selectRow', $tr.index());
|
||||
|
||||
|
|
@ -1238,15 +1238,15 @@
|
|||
rowActions._std($tr, function() {});
|
||||
var map1 = {};
|
||||
$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.
|
||||
* e.g. An Template/ISO of multiple zones have the same UUID.
|
||||
*/
|
||||
var objId = $(this).data('json-obj').id;
|
||||
if(!(objId in map1)) {
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
var objId = $(this).data('json-obj').id;
|
||||
if(!(objId in map1)) {
|
||||
sort($(this), reorder.moveDrag);
|
||||
map1[objId] = 1;
|
||||
}
|
||||
map1[objId] = 1;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
@ -1355,7 +1355,7 @@
|
|||
$select.hide();
|
||||
}
|
||||
|
||||
$select.find('option:first').attr('selected', 'selected');
|
||||
$select.find('option:first').attr('selected', 'selected');
|
||||
$listView.find('.data-table').dataTable('refresh');
|
||||
}
|
||||
}
|
||||
|
|
@ -1801,7 +1801,7 @@
|
|||
noActionCol: listViewData.noActionCol
|
||||
});
|
||||
createFilters($toolbar, listViewData.filters);
|
||||
|
||||
|
||||
if (listViewData.hideSearchBar != true) {
|
||||
createSearchBar($toolbar, listViewData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
if (isHidden) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
var $td = $('<td>').addClass(fieldName).appendTo($tr);
|
||||
var $input, val;
|
||||
var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone();
|
||||
|
|
@ -280,7 +280,7 @@
|
|||
|
||||
// Align width to main header
|
||||
_medit.refreshItemWidths($multi);
|
||||
|
||||
|
||||
if (data._hideFields &&
|
||||
$.inArray(fieldName, data._hideFields) > -1) {
|
||||
$td.addClass('disabled');
|
||||
|
|
@ -712,7 +712,7 @@
|
|||
|
||||
itemRow: function(item, itemActions, multiRule, $tbody) {
|
||||
var $tr = $('<tr>');
|
||||
|
||||
|
||||
var itemName = multiRule._itemName ? item[multiRule._itemName] : item.name;
|
||||
var $itemName = $('<span>').html(_s(itemName));
|
||||
|
||||
|
|
@ -727,14 +727,14 @@
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
var itemIp = multiRule._itemIp ? item[multiRule._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));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
var itemState = item._itemState ? item._itemState : item.state;
|
||||
|
||||
$tr.append($('<td>').addClass('state').appendTo($tr).append(
|
||||
|
|
@ -993,7 +993,7 @@
|
|||
.appendTo($td);
|
||||
|
||||
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();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
subselect: {
|
||||
isMultiple: true,
|
||||
label: 'label.use.vm.ip',
|
||||
dataProvider: function(args) {
|
||||
dataProvider: function(args) {
|
||||
var instance = args.context.instances[0];
|
||||
var network = args.context.networks[0];
|
||||
|
||||
|
|
@ -41,7 +41,7 @@
|
|||
virtualmachineid: instance.id,
|
||||
nicId: instance.nic[0].id
|
||||
},
|
||||
success: function(json) {
|
||||
success: function(json) {
|
||||
var nic = json.listnicsresponse.nic[0];
|
||||
var primaryIp = nic.ipaddress;
|
||||
var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
|
||||
|
|
@ -126,14 +126,14 @@
|
|||
});
|
||||
}
|
||||
}),
|
||||
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 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
|
||||
*/
|
||||
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 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 vms = args.context.instances;
|
||||
|
||||
|
||||
// Assign subselect values
|
||||
$(vms).each(function() {
|
||||
var vm = this;
|
||||
|
|
@ -143,53 +143,31 @@
|
|||
$.extend(vm, { _subselect: $vmRow.find('.subselect select').val() });
|
||||
});
|
||||
|
||||
/*
|
||||
var array1 = [];
|
||||
for (var i = 0; i < vms.length; i++) {
|
||||
array1.push(vms[i].id);
|
||||
}
|
||||
var virtualmachineids = array1.join(',');
|
||||
var inputData = {
|
||||
id: args.context.internalLoadBalancers[0].id,
|
||||
virtualmachineids: virtualmachineids
|
||||
};
|
||||
*/
|
||||
//virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the lines above.
|
||||
|
||||
|
||||
var inputData = {
|
||||
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.~):
|
||||
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
|
||||
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
|
||||
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
|
||||
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
|
||||
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
|
||||
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
|
||||
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
|
||||
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
|
||||
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
|
||||
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
|
||||
*/
|
||||
var selectedVMs = vms;
|
||||
if (selectedVMs != null) {
|
||||
var vmidipmapIndex = 0;
|
||||
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
|
||||
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
|
||||
var selectedIPs = selectedVMs[vmIndex]._subselect;
|
||||
for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
|
||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
|
||||
|
||||
//"ipAddresses" is not in args.context since this LB rule is under a VPC, not an address.
|
||||
/*
|
||||
if (args.context.ipAddresses[0].isportable) {
|
||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
|
||||
} else {
|
||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
||||
}
|
||||
*/
|
||||
|
||||
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
|
||||
|
||||
|
||||
vmidipmapIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL('assignToLoadBalancerRule'),
|
||||
|
|
@ -211,10 +189,10 @@
|
|||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var aclMultiEdit = {
|
||||
noSelect: true,
|
||||
|
||||
|
||||
reorder: {
|
||||
moveDrag: {
|
||||
action: function(args) {
|
||||
|
|
@ -1192,12 +1170,12 @@
|
|||
label: 'label.id'
|
||||
}
|
||||
},
|
||||
dataProvider: function(args) {
|
||||
var data = {
|
||||
vpcid: args.context.vpc[0].id
|
||||
};
|
||||
dataProvider: function(args) {
|
||||
var data = {
|
||||
vpcid: args.context.vpc[0].id
|
||||
};
|
||||
listViewDataProvider(args, data);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: createURL('listNetworkACLLists'),
|
||||
data: data,
|
||||
|
|
@ -2281,7 +2259,7 @@
|
|||
if (this.id == args.context.vpcGateways[0].aclid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.name
|
||||
|
|
@ -2289,7 +2267,7 @@
|
|||
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
|
|
@ -2412,13 +2390,13 @@
|
|||
success: function(json) {
|
||||
var objs = json.listnetworkacllistsresponse.networkacllist;
|
||||
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';
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
args.response.success({
|
||||
data: item,
|
||||
actionFilter: function(args) {
|
||||
|
|
@ -2813,12 +2791,12 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
passive: {
|
||||
label: 'label.passive',
|
||||
isBoolean: true,
|
||||
isChecked: false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
action: function(args) {
|
||||
|
|
@ -2882,10 +2860,10 @@
|
|||
passive: {
|
||||
label: 'label.passive',
|
||||
converter: cloudStack.converters.toBooleanText
|
||||
},
|
||||
},
|
||||
publicip: {
|
||||
label: 'label.ip.address'
|
||||
},
|
||||
},
|
||||
gateway: {
|
||||
label: 'label.gateway'
|
||||
},
|
||||
|
|
@ -3099,7 +3077,7 @@
|
|||
if (args.context.networks[0].type == "Isolated") { //Isolated network
|
||||
cloudStack.dialog.confirm({
|
||||
message: 'message.confirm.current.guest.CIDR.unchanged',
|
||||
action: function() { //"Yes" button is clicked
|
||||
action: function() { //"Yes" button is clicked
|
||||
array1.push("&changecidr=false");
|
||||
$.ajax({
|
||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||
|
|
@ -3352,30 +3330,30 @@
|
|||
},
|
||||
|
||||
tabFilter: function(args) {
|
||||
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
|
||||
|
||||
var networkOfferingHavingELB = false;
|
||||
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
|
||||
|
||||
var networkOfferingHavingELB = false;
|
||||
var services = args.context.networks[0].service;
|
||||
if(services != null) {
|
||||
for(var i = 0; i < services.length; i++) {
|
||||
if (services[i].name == "Lb") {
|
||||
var capabilities = services[i].capability;
|
||||
if(capabilities != null) {
|
||||
for(var k = 0; k < capabilities.length; k++) {
|
||||
if(capabilities[k].name == "ElasticLb") {
|
||||
networkOfferingHavingELB = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(var i = 0; i < services.length; i++) {
|
||||
if (services[i].name == "Lb") {
|
||||
var capabilities = services[i].capability;
|
||||
if(capabilities != null) {
|
||||
for(var k = 0; k < capabilities.length; k++) {
|
||||
if(capabilities[k].name == "ElasticLb") {
|
||||
networkOfferingHavingELB = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (networkOfferingHavingELB == false) {
|
||||
hiddenTabs.push("addloadBalancer");
|
||||
}
|
||||
|
||||
|
||||
return hiddenTabs;
|
||||
},
|
||||
|
||||
|
|
@ -3490,13 +3468,13 @@
|
|||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//include currently selected network offeirng to dropdown
|
||||
items.push({
|
||||
id: args.context.networks[0].networkofferingid,
|
||||
description: args.context.networks[0].networkofferingdisplaytext
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
|
|
@ -3975,7 +3953,7 @@
|
|||
zoneid: {
|
||||
label: 'label.zone',
|
||||
validation: {
|
||||
required: true
|
||||
required: true
|
||||
},
|
||||
isHidden: true,
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue