diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 6f55b3d54a9..e48f3a18ff4 100644
--- a/ui/scripts/accounts.js
+++ b/ui/scripts/accounts.js
@@ -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 + '
';
- }
+ 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 + '
';
+ }
}
-
-
+
+
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;
}
diff --git a/ui/scripts/accountsWizard.js b/ui/scripts/accountsWizard.js
index 03dc65c3c0a..633821edb14 100644
--- a/ui/scripts/accountsWizard.js
+++ b/ui/scripts/accountsWizard.js
@@ -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));
diff --git a/ui/scripts/affinity.js b/ui/scripts/affinity.js
index 4f579e108b8..aecb4d6e46a 100644
--- a/ui/scripts/affinity.js
+++ b/ui/scripts/affinity.js
@@ -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);
diff --git a/ui/scripts/autoscaler.js b/ui/scripts/autoscaler.js
index c0c41baaa86..cf39d2cae67 100644
--- a/ui/scripts/autoscaler.js
+++ b/ui/scripts/autoscaler.js
@@ -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',
diff --git a/ui/scripts/cloud.core.callbacks.js b/ui/scripts/cloud.core.callbacks.js
index 3ae6d09fe7c..9aad73a75b7 100644
--- a/ui/scripts/cloud.core.callbacks.js
+++ b/ui/scripts/cloud.core.callbacks.js
@@ -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;
diff --git a/ui/scripts/cloudStack.js b/ui/scripts/cloudStack.js
index 6d08735381f..146f8d1083d 100644
--- a/ui/scripts/cloudStack.js
+++ b/ui/scripts/cloudStack.js
@@ -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);
diff --git a/ui/scripts/configuration.js b/ui/scripts/configuration.js
index 5cb6f8d6468..61f2d1f96ff 100644
--- a/ui/scripts/configuration.js
+++ b/ui/scripts/configuration.js
@@ -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);
diff --git a/ui/scripts/dashboard.js b/ui/scripts/dashboard.js
index dff6a91a9e8..f2b56820781 100644
--- a/ui/scripts/dashboard.js
+++ b/ui/scripts/dashboard.js
@@ -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 ?
diff --git a/ui/scripts/domains.js b/ui/scripts/domains.js
index e46f104364d..f2b40731628 100644
--- a/ui/scripts/domains.js
+++ b/ui/scripts/domains.js
@@ -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;
diff --git a/ui/scripts/events.js b/ui/scripts/events.js
index 92804290095..2fd70dd018d 100644
--- a/ui/scripts/events.js
+++ b/ui/scripts/events.js
@@ -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,
diff --git a/ui/scripts/globalSettings.js b/ui/scripts/globalSettings.js
index 2b1fe5c905e..eba8e687b5b 100644
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@ -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',
diff --git a/ui/scripts/instanceWizard.js b/ui/scripts/instanceWizard.js
index 3d3f74e56e3..1401acef8e2 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -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
diff --git a/ui/scripts/instances.js b/ui/scripts/instances.js
index 81732d76307..3fdd7701fbf 100644
--- a/ui/scripts/instances.js
+++ b/ui/scripts/instances.js
@@ -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");
}
diff --git a/ui/scripts/network.js b/ui/scripts/network.js
index 4e337fb57e3..45322b7d049 100755
--- a/ui/scripts/network.js
+++ b/ui/scripts/network.js
@@ -37,7 +37,7 @@
};
//value of Primary IP in subselect dropdown is -1, for single VM selection (API parameter virtualmachineid + vmguestip), e.g. enableStaticNat API, createPortForwardingRule API.
- var singleVmSecondaryIPSubselect = function(args) {
+ var singleVmSecondaryIPSubselect = function(args) {
var instance = args.context.instances[0];
var network = args.context.networks[0];
@@ -50,9 +50,9 @@
success: function(json) {
var nics = json.listnicsresponse.nic;
var ipSelection = [];
-
- $(nics).map(function(index, nic) {
- var primaryIp = nic.ipaddress;
+
+ $(nics).map(function(index, nic) {
+ var primaryIp = nic.ipaddress;
var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
var prefix = '[NIC ' + (index + 1) + '] ';
@@ -61,7 +61,7 @@
id: nic.networkid + ',-1',
description: prefix + primaryIp + ' (Primary)'
});
-
+
// Add secondary IPs
$(secondaryIps).map(function(index, secondaryIp) {
ipSelection.push({
@@ -69,58 +69,58 @@
description: prefix + secondaryIp.ipaddress
});
});
- });
+ });
+
+ args.response.success({
+ data: ipSelection
+ });
+ }
+ });
+
+ } else { //non-portable IP which has only one NIC
+ /*
+ var nic = $.grep(instance.nic, function(nic) {
+ return nic.networkid == network.id;
+ })[0];
+ */
+
+ // Get NIC IPs
+ $.ajax({
+ url: createURL('listNics'),
+ data: {
+ virtualmachineid: instance.id,
+ nicId: instance.nic[0].id
+ },
+ success: function(json) {
+ var nic = json.listnicsresponse.nic[0];
+ var primaryIp = nic.ipaddress;
+ var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
+ var ipSelection = [];
+
+ // Add primary IP as default
+ ipSelection.push({
+ id: primaryIp,
+ description: primaryIp + ' (Primary)'
+ });
+
+ // Add secondary IPs
+ $(secondaryIps).map(function(index, secondaryIp) {
+ ipSelection.push({
+ id: secondaryIp.ipaddress,
+ description: secondaryIp.ipaddress
+ });
+ });
args.response.success({
data: ipSelection
});
}
});
-
- } else { //non-portable IP which has only one NIC
- /*
- var nic = $.grep(instance.nic, function(nic) {
- return nic.networkid == network.id;
- })[0];
- */
-
- // Get NIC IPs
- $.ajax({
- url: createURL('listNics'),
- data: {
- virtualmachineid: instance.id,
- nicId: instance.nic[0].id
- },
- success: function(json) {
- var nic = json.listnicsresponse.nic[0];
- var primaryIp = nic.ipaddress;
- var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
- var ipSelection = [];
-
- // Add primary IP as default
- ipSelection.push({
- id: primaryIp,
- description: primaryIp + ' (Primary)'
- });
-
- // Add secondary IPs
- $(secondaryIps).map(function(index, secondaryIp) {
- ipSelection.push({
- id: secondaryIp.ipaddress,
- description: secondaryIp.ipaddress
- });
- });
-
- args.response.success({
- data: ipSelection
- });
- }
- });
}
};
//value of Primary IP in subselect dropdown is itself (not -1), for multiple VM selection (API parameter vmidipmap), e.g. assignToLoadBalancerRule API.
- var multipleVmSecondaryIPSubselect = function(args) {
+ var multipleVmSecondaryIPSubselect = function(args) {
var instance = args.context.instances[0];
var network = args.context.networks[0];
@@ -137,7 +137,7 @@
//portable IP has multiple NICs. Each NIC has a different network ID.
$(nics).map(function(index, nic) {
var primaryIp = nic.ipaddress;
- var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
+ var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
var prefix = '[NIC ' + (index + 1) + '] ';
// Add primary IP as default
@@ -145,7 +145,7 @@
id: nic.networkid + ',' + primaryIp,
description: prefix + primaryIp + ' (Primary)'
});
-
+
// Add secondary IPs
$(secondaryIps).map(function(index, secondaryIp) {
ipSelection.push({
@@ -153,21 +153,21 @@
description: prefix + secondaryIp.ipaddress
});
});
- });
-
+ });
+
args.response.success({
data: ipSelection
});
}
- });
-
- } else { //non-portable IP which has only one NIC
+ });
+
+ } else { //non-portable IP which has only one NIC
/*
- var nic = $.grep(instance.nic, function(nic) {
+ var nic = $.grep(instance.nic, function(nic) {
return nic.networkid == network.id;
})[0];
*/
-
+
// Get NIC IPs
$.ajax({
url: createURL('listNics'),
@@ -175,7 +175,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 : [];
@@ -207,9 +207,9 @@
});
}
});
- }
+ }
};
-
+
var ipChangeNotice = function() {
cloudStack.dialog.confirm({
message: 'message.ip.address.changed',
@@ -243,107 +243,107 @@
ipObj.issystem == true) {
return [];
}
-
+
if (ipObj.issourcenat) { //sourceNAT IP doesn't support staticNAT
disallowedActions.push('enableStaticNAT');
disallowedActions.push('disableStaticNAT');
disallowedActions.push('remove');
} else { //non-sourceNAT IP supports staticNAT
- disallowedActions.push('enableVPN');
- if (ipObj.isstaticnat) {
+ disallowedActions.push('enableVPN');
+ if (ipObj.isstaticnat) {
disallowedActions.push('enableStaticNAT');
} else {
disallowedActions.push('disableStaticNAT');
}
- }
+ }
//***** apply to both Isolated Guest Network IP, VPC IP (end) *****
-
-
+
+
if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page *****
- if (args.context.networks[0].networkofferingconservemode == false) {
- /*
- (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
- */
- if (ipObj.issourcenat == true) {
- disallowedActions.push('enableStaticNAT');
- disallowedActions.push('enableVPN');
- }
-
- /*
- (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer at first.
- 1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
- 2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
- 3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
- 4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
- */
- else { //ipObj.issourcenat == false
- if (ipObj.isstaticnat) { //1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
- disallowedActions.push('enableVPN');
- }
- if (ipObj.vpnenabled) { //2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
- disallowedActions.push('enableStaticNAT');
- }
-
- //3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
- $.ajax({
- url: createURL('listPortForwardingRules'),
- data: {
- ipaddressid: ipObj.id,
- listAll: true
- },
- dataType: 'json',
- async: false,
- success: function(json) {
- var rules = json.listportforwardingrulesresponse.portforwardingrule;
- if (rules != null && rules.length > 0) {
- disallowedActions.push('enableVPN');
- disallowedActions.push('enableStaticNAT');
- }
- }
- });
-
- //4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
- $.ajax({
- url: createURL('listLoadBalancerRules'),
- data: {
- publicipid: ipObj.id,
- listAll: true
- },
- dataType: 'json',
- async: false,
- success: function(json) {
- var rules = json.listloadbalancerrulesresponse.loadbalancerrule;
- if (rules != null && rules.length > 0) {
- disallowedActions.push('enableVPN');
- disallowedActions.push('enableStaticNAT');
- }
- }
- });
- }
- }
-
- if (ipObj.networkOfferingHavingVpnService == true) {
- if (ipObj.vpnenabled) {
- disallowedActions.push('enableVPN');
- } else {
- disallowedActions.push('disableVPN');
- }
- } else { //ipObj.networkOfferingHavingVpnService == false
- disallowedActions.push('disableVPN');
- disallowedActions.push('enableVPN');
- }
- } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
- if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
- if (ipObj.vpnenabled) {
- disallowedActions.push('enableVPN');
- } else {
- disallowedActions.push('disableVPN');
- }
- } else { //VPC non-sourceNAT IP: doesn't support VPN
- disallowedActions.push('enableVPN');
- disallowedActions.push('disableVPN');
- }
- }
+ if (args.context.networks[0].networkofferingconservemode == false) {
+ /*
+ (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
+ */
+ if (ipObj.issourcenat == true) {
+ disallowedActions.push('enableStaticNAT');
+ disallowedActions.push('enableVPN');
+ }
+
+ /*
+ (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer at first.
+ 1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
+ 2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
+ 3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
+ 4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
+ */
+ else { //ipObj.issourcenat == false
+ if (ipObj.isstaticnat) { //1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
+ disallowedActions.push('enableVPN');
+ }
+ if (ipObj.vpnenabled) { //2. Once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
+ disallowedActions.push('enableStaticNAT');
+ }
+
+ //3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
+ $.ajax({
+ url: createURL('listPortForwardingRules'),
+ data: {
+ ipaddressid: ipObj.id,
+ listAll: true
+ },
+ dataType: 'json',
+ async: false,
+ success: function(json) {
+ var rules = json.listportforwardingrulesresponse.portforwardingrule;
+ if (rules != null && rules.length > 0) {
+ disallowedActions.push('enableVPN');
+ disallowedActions.push('enableStaticNAT');
+ }
+ }
+ });
+
+ //4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
+ $.ajax({
+ url: createURL('listLoadBalancerRules'),
+ data: {
+ publicipid: ipObj.id,
+ listAll: true
+ },
+ dataType: 'json',
+ async: false,
+ success: function(json) {
+ var rules = json.listloadbalancerrulesresponse.loadbalancerrule;
+ if (rules != null && rules.length > 0) {
+ disallowedActions.push('enableVPN');
+ disallowedActions.push('enableStaticNAT');
+ }
+ }
+ });
+ }
+ }
+
+ if (ipObj.networkOfferingHavingVpnService == true) {
+ if (ipObj.vpnenabled) {
+ disallowedActions.push('enableVPN');
+ } else {
+ disallowedActions.push('disableVPN');
+ }
+ } else { //ipObj.networkOfferingHavingVpnService == false
+ disallowedActions.push('disableVPN');
+ disallowedActions.push('enableVPN');
+ }
+ } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
+ if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
+ if (ipObj.vpnenabled) {
+ disallowedActions.push('enableVPN');
+ } else {
+ disallowedActions.push('disableVPN');
+ }
+ } else { //VPC non-sourceNAT IP: doesn't support VPN
+ disallowedActions.push('enableVPN');
+ disallowedActions.push('disableVPN');
+ }
+ }
allowedActions = $.grep(allowedActions, function(item) {
return $.inArray(item, disallowedActions) == -1;
@@ -487,44 +487,44 @@
},
dependsOn: 'zoneId',
docID: 'helpGuestNetworkNetworkOffering',
- select: function(args) {
+ select: function(args) {
var data = {
- zoneid: args.zoneId,
+ zoneid: args.zoneId,
guestiptype: 'Isolated',
supportedServices: 'SourceNat',
state: 'Enabled'
};
-
- if ('vpc' in args.context) { //from VPC section
- $.extend(data, {
- forVpc: true
- });
+
+ if ('vpc' in args.context) { //from VPC section
+ $.extend(data, {
+ forVpc: true
+ });
}
else { //from guest network section
- var vpcs;
- $.ajax({
+ var vpcs;
+ $.ajax({
url: createURL('listVPCs'),
data: {
listAll: true
},
async: false,
- success: function(json) {
- vpcs = json.listvpcsresponse.vpc;
+ success: function(json) {
+ vpcs = json.listvpcsresponse.vpc;
}
- });
+ });
if (vpcs == null || vpcs.length == 0) { //if there is no VPC in the system
- $.extend(data, {
- forVpc: false
- });
+ $.extend(data, {
+ forVpc: false
+ });
}
}
- if(!isAdmin()) { //normal user is not aware of the VLANs in the system, so normal user is not allowed to create network with network offerings whose specifyvlan = true
- $.extend(data, {
- specifyvlan: false
- });
+ if(!isAdmin()) { //normal user is not aware of the VLANs in the system, so normal user is not allowed to create network with network offerings whose specifyvlan = true
+ $.extend(data, {
+ specifyvlan: false
+ });
}
-
+
$.ajax({
url: createURL('listNetworkOfferings'),
data: data,
@@ -554,7 +554,7 @@
})
});
}
- });
+ });
}
},
@@ -952,7 +952,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
$.extend(data, {
changecidr: false
});
@@ -1090,7 +1090,7 @@
confirm: function(args) {
return 'message.action.delete.network';
},
- isWarning: true,
+ isWarning: true,
notification: function(args) {
return 'label.action.delete.network';
}
@@ -1124,8 +1124,8 @@
var isAdvancedSGZone = false;
var hiddenTabs = [];
var isSharedNetwork;
-
- var thisNetwork = args.context.networks[0];
+
+ var thisNetwork = args.context.networks[0];
if (thisNetwork.vpcid != null) {
isVPC = true;
}
@@ -1157,7 +1157,7 @@
return true;
});
}
- });
+ });
// Get zone data
$.ajax({
@@ -1261,7 +1261,7 @@
return _l('label.na');
}
},
-
+
ispersistent: {
label: 'label.persistent',
converter: cloudStack.converters.toBooleanText
@@ -1279,11 +1279,11 @@
vlan: {
label: 'label.vnet.id'
},
-
+
broadcasturi: {
- label: 'label.broadcasturi'
+ label: 'label.broadcasturi'
},
-
+
networkofferingid: {
label: 'label.network.offering',
isEditable: true,
@@ -1317,13 +1317,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
});
@@ -1390,13 +1390,13 @@
async: true,
success: function(json) {
var jsonObj = json.listnetworksresponse.network[0];
- addExtraPropertiesToGuestNetworkObject(jsonObj);
-
+ addExtraPropertiesToGuestNetworkObject(jsonObj);
+
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
- obj: jsonObj,
- objType: "Network"
+ obj: jsonObj,
+ objType: "Network"
});
-
+
args.response.success({
actionFilter: cloudStack.actionFilter.guestNetwork,
data: jsonObj
@@ -1732,8 +1732,8 @@
addButton: true
},
'state' : {
- edit: 'ignore',
- label: 'label.state'
+ edit: 'ignore',
+ label: 'label.state'
}
},
@@ -2094,8 +2094,8 @@
$.ajax({
url: createURL('listZones'),
data: dataObj,
- // id: args.context.networks[0].zoneid
- // },
+ // id: args.context.networks[0].zoneid
+ // },
async: false,
success: function(json) {
zoneObj = json.listzonesresponse.zone[0];
@@ -2108,35 +2108,35 @@
if (zoneObj.networktype == 'Basic') {
var havingEIP = false,
- havingELB = false;
-
+ havingELB = false;
+
var services = args.context.networks[0].service;
if(services != null) {
- for(var i = 0; i < services.length; i++) {
- var thisService = services[i];
- var capabilities = thisService.capability;
- if (thisService.name == "StaticNat") {
- if(capabilities != null) {
- for(var k = 0; k < capabilities.length; k++) {
- if (capabilities[k].name == "ElasticIp" && capabilities[k].value == "true") {
+ for(var i = 0; i < services.length; i++) {
+ var thisService = services[i];
+ var capabilities = thisService.capability;
+ if (thisService.name == "StaticNat") {
+ if(capabilities != null) {
+ for(var k = 0; k < capabilities.length; k++) {
+ if (capabilities[k].name == "ElasticIp" && capabilities[k].value == "true") {
havingEIP = true;
- break;
+ break;
}
- }
- }
+ }
+ }
} else if (thisService.name == "Lb") {
- if(capabilities != null) {
- for(var k = 0; k < capabilities.length; k++) {
- if (capabilities[k].name == "ElasticLb" && capabilities[k].value == "true") {
- havingELB = true;
- break;
+ if(capabilities != null) {
+ for(var k = 0; k < capabilities.length; k++) {
+ if (capabilities[k].name == "ElasticLb" && capabilities[k].value == "true") {
+ havingELB = true;
+ break;
}
- }
- }
- }
- }
+ }
+ }
+ }
+ }
}
-
+
if (havingEIP != true || havingELB != true) { //not EIP-ELB
return false; //acquire new IP is not allowed in non-EIP-ELB basic zone
}
@@ -2155,7 +2155,7 @@
return true; //VPC section, show Acquire IP button
}
},
- messages: {
+ messages: {
notification: function(args) {
return 'label.acquire.new.ip';
}
@@ -2163,29 +2163,29 @@
createForm: {
title: 'label.acquire.new.ip',
desc: 'Please confirm that you want to acquire new IP',
- preFilter: function(args) {
- $.ajax({
- url: createURL('listRegions'),
- success: function(json) {
- var selectedRegionName = $(".region-switcher .title").text();
- if ( selectedRegionName == undefined || selectedRegionName.length == 0) {
- selectedRegionName = "Local";
- }
- var items = json.listregionsresponse.region;
- if(items != null) {
- for(var i = 0; i < items.length; i++) {
- if(items[i].name == selectedRegionName) {
- if(items[i].portableipserviceenabled == true) {
- args.$form.find('.form-item[rel=isportable]').css('display', 'inline-block');
- } else {
- args.$form.find('.form-item[rel=isportable]').hide();
- }
- break;
- }
- }
- }
- }
- });
+ preFilter: function(args) {
+ $.ajax({
+ url: createURL('listRegions'),
+ success: function(json) {
+ var selectedRegionName = $(".region-switcher .title").text();
+ if ( selectedRegionName == undefined || selectedRegionName.length == 0) {
+ selectedRegionName = "Local";
+ }
+ var items = json.listregionsresponse.region;
+ if(items != null) {
+ for(var i = 0; i < items.length; i++) {
+ if(items[i].name == selectedRegionName) {
+ if(items[i].portableipserviceenabled == true) {
+ args.$form.find('.form-item[rel=isportable]').css('display', 'inline-block');
+ } else {
+ args.$form.find('.form-item[rel=isportable]').hide();
+ }
+ break;
+ }
+ }
+ }
+ }
+ });
},
fields: {
isportable: {
@@ -2209,13 +2209,13 @@
}
},
action: function(args) {
- var dataObj = {};
- if (args.$form.find('.form-item[rel=isportable]').css("display") != "none") {
- $.extend(dataObj, {
- isportable: args.data.isportable
- });
- }
-
+ var dataObj = {};
+ if (args.$form.find('.form-item[rel=isportable]').css("display") != "none") {
+ $.extend(dataObj, {
+ isportable: args.data.isportable
+ });
+ }
+
if ('vpc' in args.context) { //from VPC section
$.extend(dataObj, {
vpcid: args.context.vpc[0].id
@@ -2266,9 +2266,9 @@
},
dataProvider: function(args) {
- var items = [];
- var data = {};
- listViewDataProvider(args, data);
+ var items = [];
+ var data = {};
+ listViewDataProvider(args, data);
if (args.context.networks) {
$.extend(data, {
associatedNetworkId: args.context.networks[0].id
@@ -2278,8 +2278,8 @@
$.extend(data, {
vpcid: args.context.vpc[0].id
});
- }
-
+ }
+
$.ajax({
url: createURL('listPublicIpAddresses'),
data: $.extend({}, data, {
@@ -2288,48 +2288,48 @@
dataType: "json",
async: false,
success: function(json) {
- var ips = json.listpublicipaddressesresponse.publicipaddress;
+ var ips = json.listpublicipaddressesresponse.publicipaddress;
if(ips != null) {
- for(var i = 0; i < ips.length; i++) {
- getExtaPropertiesForIpObj(ips[i], args);
- items.push(ips[i]);
- }
- }
+ for(var i = 0; i < ips.length; i++) {
+ getExtaPropertiesForIpObj(ips[i], args);
+ items.push(ips[i]);
+ }
+ }
}
});
-
- if (g_supportELB == "guest") {
- $.ajax({
- url: createURL('listPublicIpAddresses'),
- data: $.extend({}, data, {
- forvirtualnetwork: false, // ELB IPs are allocated on guest network
- forloadbalancing: true
- }),
- dataType: "json",
- async: false,
- success: function(json) {
- var ips = json.listpublicipaddressesresponse.publicipaddress;
- if(ips != null) {
- for(var i = 0; i < ips.length; i++) {
- getExtaPropertiesForIpObj(ips[i], args);
- items.push(ips[i]);
- }
- }
- }
- });
+
+ if (g_supportELB == "guest") {
+ $.ajax({
+ url: createURL('listPublicIpAddresses'),
+ data: $.extend({}, data, {
+ forvirtualnetwork: false, // ELB IPs are allocated on guest network
+ forloadbalancing: true
+ }),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ var ips = json.listpublicipaddressesresponse.publicipaddress;
+ if(ips != null) {
+ for(var i = 0; i < ips.length; i++) {
+ getExtaPropertiesForIpObj(ips[i], args);
+ items.push(ips[i]);
+ }
+ }
+ }
+ });
}
-
+
args.response.success({
actionFilter: actionFilters.ipAddress,
data: items
- });
+ });
},
// Detail view
detailView: {
name: 'IP address detail',
tabFilter: function(args) {
- var item = args.context.ipAddresses[0];
+ var item = args.context.ipAddresses[0];
var disabledTabs = [];
var ipAddress = args.context.ipAddresses[0];
@@ -2351,15 +2351,15 @@
if (ipAddress.vpcid != null && ipAddress.issourcenat) { //don't show Configuration(ipRules) tab on VPC sourceNAT IP
disableIpRules = true;
}
-
+
if (('vpc' in args.context) == false && ipAddress.vpcid != null) { //from Guest Network section, don't show Configuration(ipRules) tab on VPC IP
disableIpRules = true;
}
- if (disableVpn)
- disabledTabs.push('vpn');
- if (disableIpRules)
- disabledTabs.push('ipRules');
+ if (disableVpn)
+ disabledTabs.push('vpn');
+ if (disableIpRules)
+ disabledTabs.push('ipRules');
return disabledTabs;
},
@@ -2379,12 +2379,12 @@
success: function(data) {
args.response.success({
_custom: {
- getUpdatedItem: function(json) {
- var vpnenabledAndRunning = false;
- if (json.queryasyncjobresultresponse.jobresult.remoteaccessvpn.state == "Running") {
- vpnenabledAndRunning = true;
- }
-
+ getUpdatedItem: function(json) {
+ var vpnenabledAndRunning = false;
+ if (json.queryasyncjobresultresponse.jobresult.remoteaccessvpn.state == "Running") {
+ vpnenabledAndRunning = true;
+ }
+
return {
remoteaccessvpn: json.queryasyncjobresultresponse.jobresult.remoteaccessvpn,
vpnenabled: vpnenabledAndRunning
@@ -2410,12 +2410,12 @@
return 'label.enable.vpn';
},
complete: function(args) {
- var msg;
- if (args.remoteaccessvpn.state == "Running") {
- msg = _l('message.enabled.vpn') + ' ' + args.remoteaccessvpn.publicip + '.' + '
' + _l('message.enabled.vpn.ip.sec') + '
' + args.remoteaccessvpn.presharedkey;
- } else {
- msg = "Remote Access VPN configuration has been generated, but it failed to apply. Please check connectivity of the network element, then re-try.";
- }
+ var msg;
+ if (args.remoteaccessvpn.state == "Running") {
+ msg = _l('message.enabled.vpn') + ' ' + args.remoteaccessvpn.publicip + '.' + '
' + _l('message.enabled.vpn.ip.sec') + '
' + args.remoteaccessvpn.presharedkey;
+ } else {
+ msg = "Remote Access VPN configuration has been generated, but it failed to apply. Please check connectivity of the network element, then re-try.";
+ }
return msg;
}
},
@@ -2797,10 +2797,10 @@
},
associatednetworkid: {
label: 'label.associated.network.id'
- },
+ },
associatednetworkname: {
label: 'label.network.name'
- },
+ },
state: {
label: 'label.state'
},
@@ -2896,20 +2896,20 @@
if (!('vpc' in args.context)) { //from Guest Network section
var services = args.context.networks[0].service;
if(services != null) {
- for(var i = 0; i < services.length; i++) {
- var thisService = services[i];
- if (thisService.name == "Firewall")
+ for(var i = 0; i < services.length; i++) {
+ var thisService = services[i];
+ if (thisService.name == "Firewall")
havingFirewallService = true;
if (thisService.name == "PortForwarding")
havingPortForwardingService = true;
if (thisService.name == "Lb")
havingLbService = true;
if (thisService.name == "Vpn")
- havingVpnService = true;
- }
- }
+ havingVpnService = true;
+ }
+ }
} else { //from VPC section
- //a VPC network from Guest Network section or from VPC section
+ //a VPC network from Guest Network section or from VPC section
// Firewall is not supported in IP from VPC section
// (because ACL has already supported in tier from VPC section)
havingFirewallService = false;
@@ -2929,21 +2929,21 @@
},
async: false,
success: function(json) {
- var networkObj = json.listnetworksresponse.network[0];
+ var networkObj = json.listnetworksresponse.network[0];
var services = networkObj.service;
if(services != null) {
- for(var i = 0; i < services.length; i++) {
- if (services[i].name == "PortForwarding")
+ for(var i = 0; i < services.length; i++) {
+ if (services[i].name == "PortForwarding")
havingPortForwardingService = true;
if (services[i].name == "Lb")
havingLbService = true;
- }
- }
-
+ }
+ }
+
if (networkObj.networkofferingconservemode == false) {
/*
- (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
- */
+ (1) If IP is SourceNat, no StaticNat/VPN/PortForwarding/LoadBalancer can be enabled/added.
+ */
if (args.context.ipAddresses[0].issourcenat) {
if (havingFirewallService == false) { //firewall is not supported in IP from VPC section (because ACL has already supported in tier from VPC section)
disallowedActions.push("firewall");
@@ -2954,12 +2954,12 @@
}
/*
- (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer at first.
- 1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
- 2. If VPN service is supported (i.e. IP comes from Guest Network section, not from VPC section), once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
- 3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
- 4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
- */
+ (2) If IP is non-SourceNat, show StaticNat/VPN/PortForwarding/LoadBalancer at first.
+ 1. Once StaticNat is enabled, hide VPN/PortForwarding/LoadBalancer.
+ 2. If VPN service is supported (i.e. IP comes from Guest Network section, not from VPC section), once VPN is enabled, hide StaticNat/PortForwarding/LoadBalancer.
+ 3. Once a PortForwarding rule is added, hide StaticNat/VPN/LoadBalancer.
+ 4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
+ */
else { //args.context.ipAddresses[0].issourcenat == false
if (havingFirewallService == false)
disallowedActions.push("firewall");
@@ -3012,11 +3012,11 @@
}
});
}
- }
+ }
}
});
}
- }
+ }
return disallowedActions;
},
@@ -3103,8 +3103,8 @@
addButton: true
},
'state' : {
- edit: 'ignore',
- label: 'label.state'
+ edit: 'ignore',
+ label: 'label.state'
}
},
@@ -3368,28 +3368,28 @@
}
},
filters: false,
-
- //when server-side change of adding new parameter "vmidipmap" to assignToLoadBalancerRule API is in, uncomment the following commented 4 lines.
+
+ //when server-side change of adding new parameter "vmidipmap" to assignToLoadBalancerRule API is in, uncomment the following commented 4 lines.
subselect: {
isMultiple: true,
label: 'label.use.vm.ips',
- dataProvider: multipleVmSecondaryIPSubselect
+ dataProvider: multipleVmSecondaryIPSubselect
},
-
- dataProvider: function(args) {
- var itemData = $.isArray(args.context.multiRule) && args.context.subItemData ? args.context.subItemData : [];
- var data = {};
+ dataProvider: function(args) {
+ var itemData = $.isArray(args.context.multiRule) && args.context.subItemData ? args.context.subItemData : [];
+
+ var data = {};
listViewDataProvider(args, data);
-
+
var networkid;
if ('vpc' in args.context) {
networkid = args.context.multiData.tier;
} else {
networkid = args.context.ipAddresses[0].associatednetworkid;
}
- $.extend(data, {
- networkid: networkid
+ $.extend(data, {
+ networkid: networkid
});
if (!args.context.projects) {
@@ -3520,7 +3520,7 @@
}
},
multipleAdd: true,
-
+
fields: {
'name': {
edit: true,
@@ -3587,45 +3587,45 @@
buttonLabel: 'label.configure',
action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
},
- isHidden: function(args) {
- if (!('vpc' in args.context)) { //from Guest Network section
- var lbProviderIsNetscaler = false;
- $.ajax({
- url: createURL('listNetworkOfferings'),
- data: {
- id: args.context.networks[0].networkofferingid
- },
- async: false,
- success: function(json) {
- var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
- var services = networkOffering.service;
- if (services != null) {
- for (var i = 0; i < services.length; i++) {
- if (services[i].name == 'Lb') {
- var providers = services[i].provider;
- if (providers != null) {
- for (var k = 0; k < providers.length; k++) {
- if (providers[k].name == 'Netscaler') {
- lbProviderIsNetscaler = true;
- break;
- }
- }
- }
- break;
- }
- }
- }
- }
- });
- if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
- return false; //show AutoScale button
- } else {
- return 2; //hide Autoscale button (both header and form)
- }
+ isHidden: function(args) {
+ if (!('vpc' in args.context)) { //from Guest Network section
+ var lbProviderIsNetscaler = false;
+ $.ajax({
+ url: createURL('listNetworkOfferings'),
+ data: {
+ id: args.context.networks[0].networkofferingid
+ },
+ async: false,
+ success: function(json) {
+ var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
+ var services = networkOffering.service;
+ if (services != null) {
+ for (var i = 0; i < services.length; i++) {
+ if (services[i].name == 'Lb') {
+ var providers = services[i].provider;
+ if (providers != null) {
+ for (var k = 0; k < providers.length; k++) {
+ if (providers[k].name == 'Netscaler') {
+ lbProviderIsNetscaler = true;
+ break;
+ }
+ }
+ }
+ break;
+ }
+ }
+ }
+ }
+ });
+ if (lbProviderIsNetscaler == true) { //AutoScale is only supported on Netscaler (but not on any other provider like VirtualRouter)
+ return false; //show AutoScale button
+ } else {
+ return 2; //hide Autoscale button (both header and form)
+ }
} else { //from VPC section
- //VPC doesn't support autoscale
- return 2;
- }
+ //VPC doesn't support autoscale
+ return 2;
+ }
}
},
@@ -3633,10 +3633,10 @@
label: 'label.add.vms',
addButton: true
},
-
+
'state' : {
- edit: 'ignore',
- label: 'label.state'
+ edit: 'ignore',
+ label: 'label.state'
}
},
@@ -3669,7 +3669,7 @@
};
var stickyData = $.extend(true, {}, args.data.sticky);
-
+
//***** create new LB rule > Add VMs *****
$.ajax({
url: createURL('createLoadBalancerRule'),
@@ -3680,52 +3680,52 @@
var itemData = args.itemData;
var jobID = data.createloadbalancerruleresponse.jobid;
var lbID = data.createloadbalancerruleresponse.id;
-
+
var inputData = {
- id: data.createloadbalancerruleresponse.id
- };
-
+ id: data.createloadbalancerruleresponse.id
+ };
+
/*
var inputData = {
id: data.createloadbalancerruleresponse.id,
virtualmachineids: $.map(itemData, function(elem) {
return elem.id;
}).join(',')
- };
- */
+ };
+ */
//virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the 6 lines above.
-
-
- /*
+
+
+ /*
* 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 = args.itemData;
if (selectedVMs != null) {
- var vmidipmapIndex = 0;
- 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;
-
- if (args.context.ipAddresses[0].isportable) {
- inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
- } else {
- inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
- }
-
- vmidipmapIndex++;
- }
- }
- }
-
+ var vmidipmapIndex = 0;
+ 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;
+
+ if (args.context.ipAddresses[0].isportable) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
+ } else {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
+ }
+
+ vmidipmapIndex++;
+ }
+ }
+ }
+
$.ajax({
url: createURL('assignToLoadBalancerRule'),
- data: inputData,
+ data: inputData,
success: function(data) {
var jobID = data.assigntoloadbalancerruleresponse.jobid;
var lbStickyCreated = false;
@@ -3832,41 +3832,41 @@
},
itemActions: {
- //***** update existing LB rule > Add VMs *****
- add: {
+ //***** update existing LB rule > Add VMs *****
+ add: {
label: 'label.add.vms.to.lb',
action: function(args) {
var inputData = {
- id: args.multiRule.id
- };
-
- /*
+ id: args.multiRule.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 = args.data;
if (selectedVMs != null) {
- var vmidipmapIndex = 0;
- 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;
-
- if (args.context.ipAddresses[0].isportable) {
- inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
- } else {
- inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
- }
-
- vmidipmapIndex++;
- }
- }
- }
-
+ var vmidipmapIndex = 0;
+ 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;
+
+ if (args.context.ipAddresses[0].isportable) {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
+ } else {
+ inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
+ }
+
+ vmidipmapIndex++;
+ }
+ }
+ }
+
$.ajax({
url: createURL('assignToLoadBalancerRule'),
data: inputData,
@@ -3892,21 +3892,21 @@
},
destroy: {
label: 'label.remove.vm.from.lb',
- action: function(args) {
- var inputData;
- if (args.item.itemIp == undefined) {
- inputData = {
+ action: function(args) {
+ var inputData;
+ if (args.item.itemIp == undefined) {
+ inputData = {
id: args.multiRule.id,
virtualmachineids: args.item.id
};
- } else {
- inputData = {
+ } else {
+ inputData = {
id: args.multiRule.id,
"vmidipmap[0].vmid": args.item.id,
- "vmidipmap[0].vmip": args.item.itemIp
- };
- }
-
+ "vmidipmap[0].vmip": args.item.itemIp
+ };
+ }
+
$.ajax({
url: createURL('removeFromLoadBalancerRule'),
data: inputData,
@@ -3943,12 +3943,12 @@
dataType: 'json',
async: true,
success: function(data) {
- var loadbalancerrules = data.listloadbalancerrulesresponse.loadbalancerrule;
-
- $(loadbalancerrules).each(function() {
+ var loadbalancerrules = data.listloadbalancerrulesresponse.loadbalancerrule;
+
+ $(loadbalancerrules).each(function() {
var lbRule = this;
var stickyData = {};
-
+
//var lbInstances = [];
var itemData = [];
@@ -4017,19 +4017,19 @@
data: {
listAll: true,
lbvmips: true,
- id: lbRule.id
+ id: lbRule.id
},
success: function(data) {
- //when "lbvmips: true" is not passed to API
- //lbVMs = data.listloadbalancerruleinstancesresponse.loadbalancerruleinstance;
-
- //when "lbvmips: true" is passed to API
- lbrulevmidips = data.listloadbalancerruleinstancesresponse.lbrulevmidip;
-
+ //when "lbvmips: true" is not passed to API
+ //lbVMs = data.listloadbalancerruleinstancesresponse.loadbalancerruleinstance;
+
+ //when "lbvmips: true" is passed to API
+ lbrulevmidips = data.listloadbalancerruleinstancesresponse.lbrulevmidip;
+
if (lbrulevmidips != null) {
- for (var k = 0; k < lbrulevmidips.length; k++) {
- var lbrulevmidip = lbrulevmidips[k];
- var lbVM = lbrulevmidip.loadbalancerruleinstance;
+ for (var k = 0; k < lbrulevmidips.length; k++) {
+ var lbrulevmidip = lbrulevmidips[k];
+ var lbVM = lbrulevmidip.loadbalancerruleinstance;
if (lbVM.displayname.indexOf('AutoScale-LB-') > -1) //autoscale VM is not allowed to be deleted manually. So, hide destroy button
lbVM._hideActions = ['destroy'];
@@ -4037,24 +4037,24 @@
lbVM._itemStateLabel = 'label.service.state';
lbVM._itemState = lbVM.servicestate;
}
-
+
if (lbrulevmidip.lbvmipaddresses != null) {
- for (var m = 0 ; m < lbrulevmidip.lbvmipaddresses.length; m++) {
- var ip = lbrulevmidip.lbvmipaddresses[m];
- itemData.push($.extend({}, lbVM, {
- itemIp: ip
- }));
- }
+ for (var m = 0 ; m < lbrulevmidip.lbvmipaddresses.length; m++) {
+ var ip = lbrulevmidip.lbvmipaddresses[m];
+ itemData.push($.extend({}, lbVM, {
+ itemIp: ip
+ }));
+ }
} else {
- itemData.push(lbVM);
- }
- }
- }
+ itemData.push(lbVM);
+ }
+ }
+ }
},
error: function(data) {
args.response.error(parseXMLHttpResponse(data));
}
- });
+ });
$.extend(lbRule, {
_itemName: 'name',
@@ -4158,18 +4158,18 @@
dataProvider: singleVmSecondaryIPSubselect
},
dataProvider: function(args) {
- var data = {};
+ var data = {};
listViewDataProvider(args, data);
-
- var networkid;
+
+ var networkid;
if ('vpc' in args.context) {
networkid = args.context.multiData.tier;
} else {
networkid = args.context.ipAddresses[0].associatednetworkid;
- }
+ }
$.extend(data, {
- networkid: networkid
- });
+ networkid: networkid
+ });
if (!args.context.projects) {
$.extend(data, {
@@ -4233,8 +4233,8 @@
}
},
'state' : {
- edit: 'ignore',
- label: 'label.state'
+ edit: 'ignore',
+ label: 'label.state'
},
'add-vm': {
label: 'label.add.vm',
@@ -4261,7 +4261,7 @@
virtualmachineid: args.itemData[0].id,
openfirewall: false
};
-
+
if (args.context.ipAddresses[0].isportable) {
var subselect = args.itemData[0]._subselect.split(',');
//var networkid = subselect[0];
@@ -4274,7 +4274,7 @@
}
} else if (args.itemData[0]._subselect && args.itemData[0]._subselect != -1) {
data.vmguestip = args.itemData[0]._subselect;
- }
+ }
if ('vpc' in args.context) { //from VPC section
if (args.data.tier == null) {
@@ -4297,7 +4297,7 @@
args.response.success({
_custom: {
jobId: data.createportforwardingruleresponse.jobid,
- getUpdatedItem: function(json) {
+ getUpdatedItem: function(json) {
return json.queryasyncjobresultresponse.jobresult.portforwardingrule;
}
},
@@ -4378,16 +4378,16 @@
success: function(data) {
loadCurrent++;
var vms = data.listvirtualmachinesresponse.virtualmachine;
-
+
//if this VM is destroyed, data.listvirtualmachinesresponse.virtualmachine will be undefined for regular-user (CLOUDSTACK-3195)
- if (vms == undefined) {
- vms = [{
+ if (vms == undefined) {
+ vms = [{
"id": item.virtualmachineid,
"name": item.virtualmachinename,
"displayname": item.virtualmachinedisplayname
- }];
- }
-
+ }];
+ }
+
$.extend(item, {
_itemData: $.map(vms, function(vm) {
return $.extend(vm, {
@@ -5550,52 +5550,52 @@
restart: {
label: 'label.restart.vpc',
createForm: {
- title: 'label.restart.vpc',
- desc: function(args) {
- if (Boolean(args.context.vpc[0].redundantvpcrouter)) {
- return 'message.restart.vpc';
- } else {
- return 'message.restart.vpc.remark';
- }
- },
-
- preFilter: function(args) {
- var zoneObj;
- $.ajax({
- url: createURL("listZones&id=" + args.context.vpc[0].zoneid),
- dataType: "json",
- async: false,
- success: function(json) {
- zoneObj = json.listzonesresponse.zone[0];
- }
- });
-
-
- args.$form.find('.form-item[rel=cleanup]').find('input').attr('checked', 'checked'); //checked
- args.$form.find('.form-item[rel=cleanup]').css('display', 'inline-block'); //shown
- args.$form.find('.form-item[rel=makeredundant]').find('input').attr('checked', 'checked'); //checked
- args.$form.find('.form-item[rel=makeredundant]').css('display', 'inline-block'); //shown
-
- if (Boolean(args.context.vpc[0].redundantvpcrouter)) {
- args.$form.find('.form-item[rel=makeredundant]').hide();
- } else {
- args.$form.find('.form-item[rel=makeredundant]').show();
- }
- },
- fields: {
- cleanup: {
- label: 'label.clean.up',
- isBoolean: true
- },
- makeredundant: {
- label: 'label.make.redundant',
- isBoolean: true
- }
- }
- },
+ title: 'label.restart.vpc',
+ desc: function(args) {
+ if (Boolean(args.context.vpc[0].redundantvpcrouter)) {
+ return 'message.restart.vpc';
+ } else {
+ return 'message.restart.vpc.remark';
+ }
+ },
+
+ preFilter: function(args) {
+ var zoneObj;
+ $.ajax({
+ url: createURL("listZones&id=" + args.context.vpc[0].zoneid),
+ dataType: "json",
+ async: false,
+ success: function(json) {
+ zoneObj = json.listzonesresponse.zone[0];
+ }
+ });
+
+
+ args.$form.find('.form-item[rel=cleanup]').find('input').attr('checked', 'checked'); //checked
+ args.$form.find('.form-item[rel=cleanup]').css('display', 'inline-block'); //shown
+ args.$form.find('.form-item[rel=makeredundant]').find('input').attr('checked', 'checked'); //checked
+ args.$form.find('.form-item[rel=makeredundant]').css('display', 'inline-block'); //shown
+
+ if (Boolean(args.context.vpc[0].redundantvpcrouter)) {
+ args.$form.find('.form-item[rel=makeredundant]').hide();
+ } else {
+ args.$form.find('.form-item[rel=makeredundant]').show();
+ }
+ },
+ fields: {
+ cleanup: {
+ label: 'label.clean.up',
+ isBoolean: true
+ },
+ makeredundant: {
+ label: 'label.make.redundant',
+ isBoolean: true
+ }
+ }
+ },
messages: {
confirm: function(args) {
- return 'message.restart.vpc';
+ return 'message.restart.vpc';
},
notification: function(args) {
return 'label.restart.vpc';
@@ -6479,57 +6479,57 @@
}
};
- function getExtaPropertiesForIpObj(ipObj, args) {
- if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page *****
- var services = args.context.networks[0].service;
- if(services != null) {
- for(var i = 0; i < services.length; i++) {
- var thisService = services[i];
- if (thisService.name == "Vpn") {
- ipObj.networkOfferingHavingVpnService = true;
- break;
- }
- }
- }
- if (ipObj.networkOfferingHavingVpnService == true) {
- $.ajax({
- url: createURL('listRemoteAccessVpns'),
- data: {
- listAll: true,
- publicipid: ipObj.id
- },
- async: false,
- success: function(vpnResponse) {
- var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
- if (isVPNEnabled) {
- ipObj.vpnenabled = true;
- ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
- } else {
- ipObj.vpnenabled = false;
- }
- }
- });
- }
- } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
- if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
- $.ajax({
- url: createURL('listRemoteAccessVpns'),
- data: {
- listAll: true,
- publicipid: ipObj.id
- },
- async: false,
- success: function(vpnResponse) {
- var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
- if (isVPNEnabled) {
- ipObj.vpnenabled = true;
- ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
- } else {
- ipObj.vpnenabled = false;
- }
- }
- });
- }
+ function getExtaPropertiesForIpObj(ipObj, args) {
+ if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page *****
+ var services = args.context.networks[0].service;
+ if(services != null) {
+ for(var i = 0; i < services.length; i++) {
+ var thisService = services[i];
+ if (thisService.name == "Vpn") {
+ ipObj.networkOfferingHavingVpnService = true;
+ break;
+ }
+ }
+ }
+ if (ipObj.networkOfferingHavingVpnService == true) {
+ $.ajax({
+ url: createURL('listRemoteAccessVpns'),
+ data: {
+ listAll: true,
+ publicipid: ipObj.id
+ },
+ async: false,
+ success: function(vpnResponse) {
+ var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
+ if (isVPNEnabled) {
+ ipObj.vpnenabled = true;
+ ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
+ } else {
+ ipObj.vpnenabled = false;
+ }
+ }
+ });
+ }
+ } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
+ if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
+ $.ajax({
+ url: createURL('listRemoteAccessVpns'),
+ data: {
+ listAll: true,
+ publicipid: ipObj.id
+ },
+ async: false,
+ success: function(vpnResponse) {
+ var isVPNEnabled = vpnResponse.listremoteaccessvpnsresponse.count;
+ if (isVPNEnabled) {
+ ipObj.vpnenabled = true;
+ ipObj.remoteaccessvpn = vpnResponse.listremoteaccessvpnsresponse.remoteaccessvpn[0];
+ } else {
+ ipObj.vpnenabled = false;
+ }
+ }
+ });
+ }
}
};
diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js
index 86e4f88b052..f980f21ac61 100644
--- a/ui/scripts/projects.js
+++ b/ui/scripts/projects.js
@@ -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 });
}
};
diff --git a/ui/scripts/regions.js b/ui/scripts/regions.js
index f7cb8fdaeed..05d46b8e297 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -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;
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 2dc19d94dcc..daf3eb56818 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -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));
}
});
- }
+ }
}
};
}
diff --git a/ui/scripts/storage.js b/ui/scripts/storage.js
index 9cabaf9a83a..b7c71a4cd46 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -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");
}
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 0f8fe6a9b38..46686776313 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -16,27 +16,27 @@
// under the License.
(function ($, cloudStack) {
-
+
var zoneObjs, podObjs, clusterObjs, domainObjs, networkOfferingObjs, physicalNetworkObjs;
var selectedClusterObj, selectedZoneObj, selectedPublicNetworkObj, selectedManagementNetworkObj, selectedPhysicalNetworkObj, selectedGuestNetworkObj;
var nspMap = {
};
//from listNetworkServiceProviders API
var nspHardcodingArray =[]; //for service providers listView (hardcoding, not from listNetworkServiceProviders API)
-
+
// Add router type to virtual router
// -- can be either Project, VPC, or System (standard)
var mapRouterType = function (index, router) {
var routerType = _l('label.menu.system');
-
+
if (router.projectid) routerType = _l('label.project');
if (router.vpcid) routerType = _l('label.vpc');
-
+
return $.extend(router, {
routerType: routerType
});
};
-
+
cloudStack.publicIpRangeAccount = {
dialog: function (args) {
return function (args) {
@@ -71,7 +71,7 @@
}
};
var success = args.response.success;
-
+
if (args.$item) {
// Account data is read-only after creation
$.ajax({
@@ -82,7 +82,7 @@
},
success: function (json) {
var domain = json.listdomainsresponse.domain[0];
-
+
cloudStack.dialog.notice({
message: '