diff --git a/ui/scripts/accounts.js b/ui/scripts/accounts.js
index 6f55b3d54a9..f6fcc27fea9 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,11 +422,11 @@
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++) {
+ for (var i = 0; i < resourcecounts.length; i++) {
switch (resourcecounts[i].resourcetype) {
case '0':
msg += 'Instance'; //vmLimit
@@ -443,8 +443,8 @@
case '4':
msg += 'Template'; //templateLimit
break;
- case '5':
- continue; //resourcetype 5 is not in use. so, skip to next item.
+ case '5':
+ continue; //resourcetype 5 is not in use. so, skip to next item.
break;
case '6':
msg += 'Network'; //networkLimit
@@ -463,18 +463,18 @@
break;
case '11':
msg += 'Secondary Storage'; //secondaryStorageLimit
- break;
+ break;
}
-
+
msg += ' Count: ' + resourcecounts[i].resourcecount + '
';
}
}
-
-
+
+
cloudStack.dialog.notice({
message: msg
- });
-
+ });
+
args.response.success();
},
error: function(json) {
@@ -653,12 +653,12 @@
}
},
-
+
tabFilter: function(args) {
var hiddenTabs = [];
if(!isAdmin()) {
hiddenTabs.push('settings');
- }
+ }
return hiddenTabs;
},
@@ -2011,13 +2011,13 @@
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..2806bfbcbae 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;
@@ -227,7 +227,7 @@
}
var accountType = args.data.accounttype;
- if (accountType == "1") { //if "admin" is selected in account type dropdown
+ if (accountType == "1") { //if "admin" is selected in account type dropdown
if (rootDomainId == undefined || args.data.domainid != rootDomainId ) { //but current login has no visibility to root domain object, or the selected domain is not root domain
accountType = "2"; // change accountType from root-domain("1") to domain-admin("2")
}
@@ -313,6 +313,6 @@
}
});
}
- }
+ }
};
}(cloudStack, jQuery));
diff --git a/ui/scripts/affinity.js b/ui/scripts/affinity.js
index 4f579e108b8..db8b79a0d0b 100644
--- a/ui/scripts/affinity.js
+++ b/ui/scripts/affinity.js
@@ -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/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..50dfb22e676 100644
--- a/ui/scripts/dashboard.js
+++ b/ui/scripts/dashboard.js
@@ -28,7 +28,7 @@
user: {
dataProvider: function(args) {
var dataFns = {
- instances: function(data) {
+ instances: function(data) {
var totalInstanceCount = 0;
$.ajax({
url: createURL("listVirtualMachines"),
@@ -38,13 +38,13 @@
pageSize: 1
},
async: false,
- success: function(json) {
+ success: function(json) {
if (json.listvirtualmachinesresponse.count != undefined) {
totalInstanceCount = json.listvirtualmachinesresponse.count;
- }
+ }
}
});
-
+
var RunningInstanceCount = 0;
$.ajax({
url: createURL("listVirtualMachines"),
@@ -55,13 +55,13 @@
state: "Running"
},
async: false,
- success: function(json) {
+ success: function(json) {
if (json.listvirtualmachinesresponse.count != undefined) {
RunningInstanceCount = json.listvirtualmachinesresponse.count;
- }
+ }
}
});
-
+
var stoppedInstanceCount = 0;
$.ajax({
url: createURL("listVirtualMachines"),
@@ -72,18 +72,18 @@
state: "Stopped"
},
async: false,
- success: function(json) {
+ 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) {
@@ -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..08a53cd7305 100644
--- a/ui/scripts/domains.js
+++ b/ui/scripts/domains.js
@@ -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,14 +108,14 @@
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
});
}
-
- if('name' in data || 'networkdomain' in data) {
+
+ if('name' in data || 'networkdomain' in data) {
$.ajax({
url: createURL("updateDomain"),
async: false,
@@ -366,7 +366,7 @@
networkdomain: {
label: 'label.network.domain',
isEditable: function(args) {
- if (isAdmin())
+ if (isAdmin())
return true;
else
return false;
@@ -652,8 +652,8 @@
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) {
+ } else if (isDomainAdmin()) {
+ if (args.context.domains[0].id != g_domainid) {
allowedActions.push("edit"); //merge updateResourceLimit into edit
}
}
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..680b0faaf03 100644
--- a/ui/scripts/globalSettings.js
+++ b/ui/scripts/globalSettings.js
@@ -234,14 +234,14 @@
}
}
}
- },
+ },
baremetalRct: {
type: 'select',
title: 'label.baremetal.rack.configuration',
listView: {
id: 'baremetalRct',
label: 'label.baremetal.rack.configuration',
- fields: {
+ fields: {
id: {
label: 'label.id'
},
@@ -252,19 +252,19 @@
dataProvider: function(args) {
var data = {};
listViewDataProvider(args, data);
-
+
$.ajax({
url: createURL("listBaremetalRct"),
data: data,
- success: function(json) {
+ 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,18 +280,18 @@
}
}
},
- action: function(args) {
+ action: function(args) {
$.ajax({
url: createURL("addBaremetalRct"),
data: {
baremetalrcturl: args.data.url
},
- success: function(json) {
+ 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;
}
}
@@ -303,8 +303,8 @@
poll: pollAsyncJobResult
}
}
- },
-
+ },
+
detailView: {
name: "details",
actions: {
@@ -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,7 +339,7 @@
poll: pollAsyncJobResult
}
}
- },
+ },
tabs: {
details: {
title: 'label.details',
@@ -351,23 +351,23 @@
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) {
+ 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..877658aef15 100644
--- a/ui/scripts/instanceWizard.js
+++ b/ui/scripts/instanceWizard.js
@@ -184,7 +184,7 @@
});
}
}
- });
+ });
$.ajax({
url: createURL("listTemplates&templatefilter=sharedexecutable&zoneid=" + args.currentData.zoneid),
dataType: "json",
@@ -199,7 +199,7 @@
});
}
}
- });
+ });
} else if (selectedTemplateOrIso == 'select-iso') {
$.ajax({
url: createURL("listIsos&isofilter=featured&zoneid=" + args.currentData.zoneid + "&bootable=true"),
@@ -248,7 +248,7 @@
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
- }
+ }
}
});
},
// 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,27 +346,27 @@
// 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) {
+ });
+ if ($(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs") == undefined) {
$.ajax({
url: createURL("listServiceOfferings&issystem=false"),
dataType: "json",
async: false,
- success: function(json) {
+ success: function(json) {
serviceOfferingObjs = json.listserviceofferingsresponse.serviceoffering;
}
- });
- } else {
- serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
+ });
+ } else {
+ serviceOfferingObjs = $(window).data("cloudStack.module.instanceWizard.serviceOfferingObjs");
}
-
-
+
+
args.response.success({
canShowCustomIops: canShowCustomIopsForServiceOffering,
customFlag: 'iscustomized',
@@ -375,7 +375,7 @@
data: {
serviceOfferings: serviceOfferingObjs
}
- });
+ });
},
// Step 4: Data disk offering
@@ -409,9 +409,9 @@
var data = {
affinityGroups: affinitygroups
};
-
+
if(selectedZoneObj.domainid != null && selectedZoneObj.affinitygroupid != null) {
- var defaultAffinityGroup;
+ var defaultAffinityGroup;
if(affinitygroups != null) {
for(var i = 0; i < affinitygroups.length; i++) {
if(affinitygroups[i].id == selectedZoneObj.affinitygroupid) {
@@ -419,13 +419,13 @@
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
- }
-
-
+ });
+ 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",
@@ -729,49 +729,49 @@
// Create a new VM!!!!
var deployVmData = {};
- //step 1 : select zone
+ //step 1 : select zone
$.extend(deployVmData, {
zoneid : args.data.zoneid
});
- //step 2: select template
+ //step 2: select template
$.extend(deployVmData, {
templateid : args.data.templateid
});
-
+
$.extend(deployVmData, {
hypervisor : selectedHypervisor
});
-
+
if (args.$wizard.find('input[name=rootDiskSize]').parent().css('display') != 'none') {
- if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
+ if (args.$wizard.find('input[name=rootDiskSize]').val().length > 0) {
$.extend(deployVmData, {
rootdisksize : args.$wizard.find('input[name=rootDiskSize]').val()
});
}
}
-
- //step 3: select service offering
+
+ //step 3: select service offering
$.extend(deployVmData, {
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) {
+ 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) {
+ }
+ 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) {
+ }
+ 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') {
@@ -788,12 +788,12 @@
}
//step 4: select disk offering
- if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
+ if (args.data.diskofferingid != null && args.data.diskofferingid != "0") {
$.extend(deployVmData, {
diskofferingid : args.data.diskofferingid
});
-
- if (selectedDiskOfferingObj.iscustomized == true) {
+
+ if (selectedDiskOfferingObj.iscustomized == true) {
$.extend(deployVmData, {
size : args.data.size
});
@@ -825,7 +825,7 @@
checkedAffinityGroupIdArray = [];
}
- if (checkedAffinityGroupIdArray.length > 0) {
+ if (checkedAffinityGroupIdArray.length > 0) {
$.extend(deployVmData, {
affinitygroupids : checkedAffinityGroupIdArray.join(",")
});
@@ -834,7 +834,7 @@
//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;
@@ -884,58 +884,58 @@
if (defaultNetworkId == null) {
cloudStack.dialog.notice({
message: "Please select a default network in Network step."
- });
+ });
return;
- }
-
+ }
+
if (checkedNetworkIdArray.length > 0) {
for (var i = 0; i < checkedNetworkIdArray.length; i++) {
- if (checkedNetworkIdArray[i] == defaultNetworkId) {
- array2.unshift(defaultNetworkId);
-
+ 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 {
+ 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);
- }
+ 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,7 +947,7 @@
checkedSecurityGroupIdArray = [];
}
- if (checkedSecurityGroupIdArray.length > 0) {
+ if (checkedSecurityGroupIdArray.length > 0) {
$.extend(deployVmData, {
securitygroupids : checkedSecurityGroupIdArray.join(",")
});
@@ -980,26 +980,26 @@
array2.push(checkedNetworkIdArray[i]);
}
}
-
+
$.extend(deployVmData, {
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
});
- if (args.context.vpc[0].account != null) {
+ if (args.context.vpc[0].account != null) {
$.extend(deployVmData, {
account : args.context.vpc[0].account
- });
- } else if (args.context.vpc[0].projectid != null) {
+ });
+ } 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) {
+ 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) {
+ 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 == ""
+ 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..9afb787fae6 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',
@@ -616,7 +616,7 @@
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,
preFilter: function(args) {
@@ -633,31 +633,31 @@
isChecked: false
}
}
- },
- messages: {
+ },
+ messages: {
notification: function(args) {
return 'label.action.destroy.instance';
}
},
- action: function(args) {
+ action: function(args) {
var data = {
- id: args.context.instances[0].id
- };
+ 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 };
@@ -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;
+ 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,11 +951,11 @@
});
}
});
-
-
+
+
//***** addResourceDetail *****
- //XenServer only (starts here)
- if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
+ //XenServer only (starts here)
+ if(args.$detailView.find('form').find('div .detail-group').find('.xenserverToolsVersion61plus').length > 0) {
$.ajax({
url: createURL('addResourceDetail'),
data: {
@@ -964,7 +964,7 @@
'details[0].key': 'hypervisortoolsversion',
'details[0].value': (args.data.xenserverToolsVersion61plus == "on") ? 'xenserver61' : 'xenserver56'
},
- success: function(json) {
+ success: function(json) {
var jobId = json.addResourceDetailresponse.jobid;
var addResourceDetailIntervalID = setInterval(function() {
$.ajax({
@@ -972,33 +972,33 @@
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({
message: _s(result.jobresult.errortext)
- });
+ });
}
}
},
- error: function(XMLHttpResponse) {
+ error: function(XMLHttpResponse) {
cloudStack.dialog.notice({
message: parseXMLHttpResponse(XMLHttpResponse)
- });
+ });
}
});
- }, g_queryAsyncJobResultInterval);
+ }, g_queryAsyncJobResultInterval);
}
- });
- }
- //XenServer only (ends here)
-
+ });
+ }
+ //XenServer only (ends here)
+
}
},
@@ -1233,17 +1233,17 @@
},
osTypeId: {
label: 'label.os.type',
- select: function(args) {
- if (ostypeObjs == undefined) {
+ select: function(args) {
+ if (ostypeObjs == undefined) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
- success: function(json) {
- ostypeObjs = json.listostypesresponse.ostype;
+ success: function(json) {
+ ostypeObjs = json.listostypesresponse.ostype;
}
});
- }
+ }
var items = [];
$(ostypeObjs).each(function() {
items.push({
@@ -1253,7 +1253,7 @@
});
args.response.success({
data: items
- });
+ });
}
},
isPublic: {
@@ -1493,12 +1493,12 @@
createForm: {
title: 'label.change.service.offering',
desc: function(args) {
- var description = '';
- var vmObj = args.jsonObj;
+ var description = '';
+ var vmObj = args.jsonObj;
if (vmObj.state == 'Running' && vmObj.hypervisor == 'VMware') {
description = 'message.read.admin.guide.scaling.up';
- }
- return description;
+ }
+ return description;
},
fields: {
serviceofferingid: {
@@ -1511,7 +1511,7 @@
async: true,
success: function(json) {
serviceofferingObjs = json.listserviceofferingsresponse.serviceoffering;
- var items = [];
+ var items = [];
if (serviceofferingObjs != null) {
for (var i = 0; i < serviceofferingObjs.length; i++) {
items.push({
@@ -1519,33 +1519,33 @@
description: serviceofferingObjs[i].name
});
}
- }
+ }
args.response.success({
data: items
});
}
});
-
+
args.$select.change(function(){
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;
+ break;
}
}
- }
- if (selectedServiceofferingObj == undefined)
- return;
-
+ }
+ 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');
@@ -1557,9 +1557,9 @@
}
});
}
- },
+ },
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,13 +1575,13 @@
isHidden: true
},
memory: {
- label: 'label.memory.mb',
+ label: 'label.memory.mb',
validation: {
required: true,
number: true
},
isHidden: true
- }
+ }
}
},
@@ -1589,24 +1589,24 @@
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')) {
$.extend(data, {
'details[0].cpuNumber': args.data.cpuNumber
});
- }
+ }
if (args.$form.find('.form-item[rel=memory]').is(':visible')) {
$.extend(data, {
'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,18 +1732,18 @@
poll: pollAsyncJobResult
}
},
-
+
assignVmToAnotherAccount: {
label: 'label.assign.instance.another',
createForm: {
title: 'label.assign.instance.another',
- fields: {
+ fields: {
domainid: {
label: 'label.domain',
validation: {
required: true
},
- select: function(args) {
+ select: function(args) {
$.ajax({
url: createURL('listDomains'),
data: {
@@ -1768,7 +1768,7 @@
data: array1
});
}
- });
+ });
}
},
account: {
@@ -1776,22 +1776,22 @@
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');
}
-
- if ('instances' in args.context && args.context.instances[0].guestosid != undefined) {
+
+ if ('instances' in args.context && args.context.instances[0].guestosid != undefined) {
if (ostypeObjs == undefined) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
- success: function(json) {
- ostypeObjs = json.listostypesresponse.ostype;
+ 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) {
+ if (ostypeObjs[i].id == args.context.instances[0].guestosid) {
ostypeName = ostypeObjs[i].description;
break;
}
- }
- if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
+ }
+ 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) {
+ select: function(args) {
+ if (ostypeObjs == undefined) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
- success: function(json) {
- ostypeObjs = json.listostypesresponse.ostype;
+ success: function(json) {
+ ostypeObjs = json.listostypesresponse.ostype;
}
});
- }
+ }
var items = [];
$(ostypeObjs).each(function() {
items.push({
@@ -1959,7 +1959,7 @@
},
converter: cloudStack.converters.toBooleanText
},
-
+
/*
isoid: {
label: 'label.attached.iso',
@@ -2045,7 +2045,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 +2060,12 @@
else
jsonObj.xenserverToolsVersion61plus = false;
}
-
+
$(window).trigger('cloudStack.module.sharedFunctions.addExtraProperties', {
obj: jsonObj,
objType: "UserVM"
});
-
+
args.response.success({
actionFilter: vmActionfilter,
data: jsonObj
@@ -2100,7 +2100,7 @@
label: 'label.network',
select: function(args) {
var data1 = {
- zoneid: args.context.instances[0].zoneid
+ zoneid: args.context.instances[0].zoneid
};
if (isAdmin()) {
$.extend(data1, {
@@ -2111,7 +2111,7 @@
account: args.context.instances[0].account,
domainid: args.context.instances[0].domainid
});
- }
+ }
$.ajax({
url: createURL('listNetworks'),
data: data1,
@@ -2322,7 +2322,7 @@
secondaryips: secondaryips
})
}
-
+
var name = 'NIC ' + (index + 1);
if (nic.isdefault) {
name += ' (' + _l('label.default') + ')';
@@ -2442,19 +2442,19 @@
} else if (jsonObj.state == 'Running') {
allowedActions.push("stop");
allowedActions.push("restart");
-
- if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
+
+ 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");
- }
+ }
if (isAdmin())
allowedActions.push("migrate");
@@ -2476,13 +2476,13 @@
allowedActions.push("start");
allowedActions.push("destroy");
allowedActions.push("reinstall");
-
- if ((jsonObj.hypervisor != 'KVM' || g_kvmsnapshotenabled == true)
+
+ 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 +2493,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..5aa5b62bd68 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,8 +50,8 @@
success: function(json) {
var nics = json.listnicsresponse.nic;
var ipSelection = [];
-
- $(nics).map(function(index, nic) {
+
+ $(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,21 +69,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) {
return nic.networkid == network.id;
})[0];
*/
-
+
// Get NIC IPs
$.ajax({
url: createURL('listNics'),
@@ -91,18 +91,18 @@
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 : [];
var ipSelection = [];
-
+
// Add primary IP as default
ipSelection.push({
id: primaryIp,
description: primaryIp + ' (Primary)'
});
-
+
// Add secondary IPs
$(secondaryIps).map(function(index, secondaryIp) {
ipSelection.push({
@@ -110,7 +110,7 @@
description: secondaryIp.ipaddress
});
});
-
+
args.response.success({
data: ipSelection
});
@@ -120,7 +120,7 @@
};
//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];
@@ -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) {
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,7 +243,7 @@
ipObj.issystem == true) {
return [];
}
-
+
if (ipObj.issourcenat) { //sourceNAT IP doesn't support staticNAT
disallowedActions.push('enableStaticNAT');
disallowedActions.push('disableStaticNAT');
@@ -255,10 +255,10 @@
} 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) {
/*
@@ -268,7 +268,7 @@
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.
@@ -283,7 +283,7 @@
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'),
@@ -301,7 +301,7 @@
}
}
});
-
+
//4. Once a LoadBalancer rule is added, hide StaticNat/VPN/PortForwarding.
$.ajax({
url: createURL('listLoadBalancerRules'),
@@ -321,7 +321,7 @@
});
}
}
-
+
if (ipObj.networkOfferingHavingVpnService == true) {
if (ipObj.vpnenabled) {
disallowedActions.push('enableVPN');
@@ -332,8 +332,8 @@
disallowedActions.push('disableVPN');
disallowedActions.push('enableVPN');
}
- } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
- if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
+ } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
+ if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
if (ipObj.vpnenabled) {
disallowedActions.push('enableVPN');
} else {
@@ -343,7 +343,7 @@
disallowedActions.push('enableVPN');
disallowedActions.push('disableVPN');
}
- }
+ }
allowedActions = $.grep(allowedActions, function(item) {
return $.inArray(item, disallowedActions) == -1;
@@ -487,15 +487,15 @@
},
dependsOn: 'zoneId',
docID: 'helpGuestNetworkNetworkOffering',
- select: function(args) {
+ select: function(args) {
var data = {
zoneid: args.zoneId,
guestiptype: 'Isolated',
supportedServices: 'SourceNat',
state: 'Enabled'
};
-
- if ('vpc' in args.context) { //from VPC section
+
+ if ('vpc' in args.context) { //from VPC section
$.extend(data, {
forVpc: true
});
@@ -508,10 +508,10 @@
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
@@ -519,12 +519,12 @@
}
}
- 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
+ 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 @@
})
});
}
- });
+ });
}
},
@@ -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'
},
-
+
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"
});
-
+
args.response.success({
actionFilter: cloudStack.actionFilter.guestNetwork,
data: jsonObj
@@ -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++) {
+ for(var i = 0; i < services.length; i++) {
var thisService = services[i];
var capabilities = thisService.capability;
- if (thisService.name == "StaticNat") {
+ 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 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") {
+ for(var k = 0; k < capabilities.length; k++) {
+ if (capabilities[k].name == "ElasticLb" && capabilities[k].value == "true") {
havingELB = true;
- break;
+ 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) {
+ 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;
+ }
+ var items = json.listregionsresponse.region;
if(items != null) {
- for(var i = 0; i < items.length; i++) {
+ 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 = {};
+ 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 items = [];
var data = {};
- listViewDataProvider(args, 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++) {
+ for(var i = 0; i < ips.length; i++) {
getExtaPropertiesForIpObj(ips[i], args);
- items.push(ips[i]);
+ items.push(ips[i]);
}
- }
+ }
}
});
-
- if (g_supportELB == "guest") {
+
+ if (g_supportELB == "guest") {
$.ajax({
url: createURL('listPublicIpAddresses'),
data: $.extend({}, data, {
- forvirtualnetwork: false, // ELB IPs are allocated on guest network
+ forvirtualnetwork: false, // ELB IPs are allocated on guest network
forloadbalancing: true
}),
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++) {
+ for(var i = 0; i < ips.length; i++) {
getExtaPropertiesForIpObj(ips[i], args);
- items.push(ips[i]);
+ 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,14 +2351,14 @@
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)
+ if (disableVpn)
disabledTabs.push('vpn');
- if (disableIpRules)
+ if (disableIpRules)
disabledTabs.push('ipRules');
return disabledTabs;
@@ -2379,12 +2379,12 @@
success: function(data) {
args.response.success({
_custom: {
- getUpdatedItem: function(json) {
+ getUpdatedItem: function(json) {
var vpnenabledAndRunning = false;
if (json.queryasyncjobresultresponse.jobresult.remoteaccessvpn.state == "Running") {
vpnenabledAndRunning = true;
- }
-
+ }
+
return {
remoteaccessvpn: json.queryasyncjobresultresponse.jobresult.remoteaccessvpn,
vpnenabled: vpnenabledAndRunning
@@ -2412,10 +2412,10 @@
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;
+ 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,7 +2896,7 @@
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++) {
+ for(var i = 0; i < services.length; i++) {
var thisService = services[i];
if (thisService.name == "Firewall")
havingFirewallService = true;
@@ -2905,9 +2905,9 @@
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
// Firewall is not supported in IP from VPC section
@@ -2929,7 +2929,7 @@
},
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++) {
@@ -2938,8 +2938,8 @@
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.
@@ -3012,11 +3012,11 @@
}
});
}
- }
+ }
}
});
}
- }
+ }
return disallowedActions;
},
@@ -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 = {};
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,8 +3587,8 @@
buttonLabel: 'label.configure',
action: cloudStack.uiCustom.autoscaler(cloudStack.autoscaler)
},
- isHidden: function(args) {
- if (!('vpc' in args.context)) { //from Guest Network section
+ isHidden: function(args) {
+ if (!('vpc' in args.context)) { //from Guest Network section
var lbProviderIsNetscaler = false;
$.ajax({
url: createURL('listNetworkOfferings'),
@@ -3596,8 +3596,8 @@
id: args.context.networks[0].networkofferingid
},
async: false,
- success: function(json) {
- var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
+ success: function(json) {
+ var networkOffering = json.listnetworkofferingsresponse.networkoffering[0];
var services = networkOffering.service;
if (services != null) {
for (var i = 0; i < services.length; i++) {
@@ -3609,23 +3609,23 @@
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;
- }
+ }
}
},
@@ -3633,7 +3633,7 @@
label: 'label.add.vms',
addButton: true
},
-
+
'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++) {
+ 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];
+ 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;
@@ -3837,36 +3837,36 @@
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++) {
+ 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];
+ 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) {
+ action: function(args) {
var inputData;
if (args.item.itemIp == undefined) {
inputData = {
id: args.multiRule.id,
virtualmachineids: args.item.id
};
- } else {
+ } 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;
-
+ //lbVMs = data.listloadbalancerruleinstancesresponse.loadbalancerruleinstance;
+
//when "lbvmips: true" is passed to API
- lbrulevmidips = data.listloadbalancerruleinstancesresponse.lbrulevmidip;
-
+ lbrulevmidips = data.listloadbalancerruleinstancesresponse.lbrulevmidip;
+
if (lbrulevmidips != null) {
for (var k = 0; k < lbrulevmidips.length; k++) {
var lbrulevmidip = lbrulevmidips[k];
- var lbVM = lbrulevmidip.loadbalancerruleinstance;
+ 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
- }));
+ }));
}
} else {
itemData.push(lbVM);
- }
+ }
}
- }
+ }
},
error: function(data) {
args.response.error(parseXMLHttpResponse(data));
}
- });
+ });
$.extend(lbRule, {
_itemName: 'name',
@@ -4160,16 +4160,16 @@
dataProvider: function(args) {
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
- });
+ });
if (!args.context.projects) {
$.extend(data, {
@@ -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) {
+ if (vms == undefined) {
vms = [{
"id": item.virtualmachineid,
"name": item.virtualmachinename,
"displayname": item.virtualmachinedisplayname
- }];
- }
-
+ }];
+ }
+
$.extend(item, {
_itemData: $.map(vms, function(vm) {
return $.extend(vm, {
@@ -5558,7 +5558,7 @@
return 'message.restart.vpc.remark';
}
},
-
+
preFilter: function(args) {
var zoneObj;
$.ajax({
@@ -5569,13 +5569,13 @@
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 {
@@ -6479,18 +6479,18 @@
}
};
- function getExtaPropertiesForIpObj(ipObj, args) {
- if (!('vpc' in args.context)) { //***** Guest Network section > Guest Network page > IP Address page *****
+ 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];
+ for(var i = 0; i < services.length; i++) {
+ var thisService = services[i];
if (thisService.name == "Vpn") {
- ipObj.networkOfferingHavingVpnService = true;
+ ipObj.networkOfferingHavingVpnService = true;
break;
}
}
- }
+ }
if (ipObj.networkOfferingHavingVpnService == true) {
$.ajax({
url: createURL('listRemoteAccessVpns'),
@@ -6509,9 +6509,9 @@
}
}
});
- }
- } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
- if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
+ }
+ } else { //***** VPC section > Configuration VPC > Router > Public IP Addresses *****
+ if (ipObj.issourcenat) { //VPC sourceNAT IP: supports VPN
$.ajax({
url: createURL('listRemoteAccessVpns'),
data: {
@@ -6528,8 +6528,8 @@
ipObj.vpnenabled = false;
}
}
- });
- }
+ });
+ }
}
};
diff --git a/ui/scripts/projects.js b/ui/scripts/projects.js
index 86e4f88b052..edfd80a5dbc 100644
--- a/ui/scripts/projects.js
+++ b/ui/scripts/projects.js
@@ -621,7 +621,7 @@
},
// Project listing data provider
- dataProvider: function(args) {
+ dataProvider: function(args) {
var user = args.context.users[0];
var data1 = {
accountId: user.userid,
@@ -632,20 +632,20 @@
}
var array1 = [];
- var page = 1;
- var getNextPage = function() {
+ var page = 1;
+ var getNextPage = function() {
var data2 = $.extend({}, data1, {
page: page,
pageSize: 500
});
-
+
$.ajax({
url: createURL('listProjects', {
ignoreProject: true
}),
- data: data2,
+ data: data2,
async: false,
- success: function(json) {
+ success: function(json) {
var projects = json.listprojectsresponse.project;
if (projects != undefined) {
for(var i = 0; i < projects.length; i++) {
@@ -653,16 +653,16 @@
displayText: projects[i].displaytext
}));
}
- }
- if (array1.length < json.listprojectsresponse.count) {
+ }
+ 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..d27719dff30 100644
--- a/ui/scripts/regions.js
+++ b/ui/scripts/regions.js
@@ -481,32 +481,32 @@
path: 'regions.lbUnderGSLB',
label: 'label.gslb.assigned.lb'
},
- actions: {
+ 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
- };
+ };
$.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: {
label: 'label.gslb.delete',
messages: {
diff --git a/ui/scripts/sharedFunctions.js b/ui/scripts/sharedFunctions.js
index 2dc19d94dcc..cf0b064bcb7 100644
--- a/ui/scripts/sharedFunctions.js
+++ b/ui/scripts/sharedFunctions.js
@@ -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,7 +294,7 @@ var addGuestNetworkDialog = {
if ('physicalNetworks' in args.context) { //Infrastructure menu > zone detail > guest traffic type > network tab (only shown in advanced zone) > add guest network dialog
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'),
@@ -302,7 +302,7 @@ var addGuestNetworkDialog = {
zoneid: selectedZoneId
},
async: false,
- success: function(json) {
+ success: function(json) {
var items = [];
var physicalnetworks = json.listphysicalnetworksresponse.physicalnetwork;
if (physicalnetworks != null) {
@@ -313,7 +313,7 @@ var addGuestNetworkDialog = {
physicalnetworkid: physicalnetworks[i].id
},
async: false,
- success: function(json) {
+ success: function(json) {
var traffictypes = json.listtraffictypesresponse.traffictype;
if (traffictypes != null) {
for (var k = 0; k < traffictypes.length; k++) {
@@ -322,13 +322,13 @@ var addGuestNetworkDialog = {
break;
}
}
- }
+ }
}
});
- }
- }
-
- addGuestNetworkDialog.physicalNetworkObjs = items;
+ }
+ }
+
+ addGuestNetworkDialog.physicalNetworkObjs = items;
}
});
}
@@ -536,14 +536,14 @@ var addGuestNetworkDialog = {
label: 'label.network.offering',
docID: 'helpGuestNetworkZoneNetworkOffering',
dependsOn: ['zoneId', 'physicalNetworkId', 'scope'],
- select: function(args) {
+ select: function(args) {
if(args.$form.find('.form-item[rel=zoneId]').find('select').val() == null || args.$form.find('.form-item[rel=zoneId]').find('select').val().length == 0) {
args.response.success({
data: null
});
return;
}
-
+
var data = {
state: 'Enabled',
zoneid: args.$form.find('.form-item[rel=zoneId]').find('select').val()
@@ -977,7 +977,7 @@ cloudStack.converters = {
convertBytes: function(bytes) {
if (bytes == undefined)
return '';
-
+
if (bytes < 1024 * 1024) {
return (bytes / 1024).toFixed(2) + " KB";
} else if (bytes < 1024 * 1024 * 1024) {
@@ -1030,20 +1030,20 @@ cloudStack.converters = {
if (g_timezoneoffset != null) {
localDate = disconnected.getTimePlusTimezoneOffset(g_timezoneoffset);
- } else {
+ } else {
var browserDate = new Date();
- var browserTimezoneoffset = browserDate.getTimezoneOffset();
- if (browserTimezoneoffset == undefined || isNaN(browserTimezoneoffset) ) {
+ 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";
@@ -1052,7 +1052,7 @@ cloudStack.converters = {
} else { //booleanValue == undefined
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,7 +1313,7 @@ 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://", "");
}
}
@@ -1324,7 +1324,7 @@ var addExtraPropertiesToUcsBladeObject = function(jsonObj) {
jsonObj.bladeid = array1[2];
}
-var processPropertiesInImagestoreObject = function(jsonObj) {
+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
@@ -1332,7 +1332,7 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
if (passwordIndex >= 0) {
jsonObj.url = url.substring(0, passwordIndex) + url.substring(domainIndex); //remove '&password=ccc' from jsonObj.url
}
- }
+ }
}
//find service object in network object
@@ -1390,12 +1390,12 @@ var processPropertiesInImagestoreObject = function(jsonObj) {
if (server.indexOf('://') == -1) {
url += 'cifs://';
}
-
+
url += (server + path);
-
+
return url;
}
-
+
function presetupURL(server, path) {
var url;
if (server.indexOf("://") == -1)
@@ -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]";
@@ -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..782622dec89 100644
--- a/ui/scripts/storage.js
+++ b/ui/scripts/storage.js
@@ -330,7 +330,7 @@
});
}
- },
+ },
diskOffering: {
label: 'Custom Disk Offering',
docID: 'helpVolumeDiskOffering',
@@ -347,7 +347,7 @@
description: ''
}];
$(diskofferingObjs).each(function() {
- if (this.iscustomized == true) {
+ if (this.iscustomized == true) {
items.push({
id: this.id,
description: this.displaytext
@@ -360,7 +360,7 @@
}
});
}
- },
+ },
diskOffering: {
label: 'Custom Disk Offering',
docID: 'helpVolumeDiskOffering',
@@ -377,7 +377,7 @@
description: ''
}];
$(diskofferingObjs).each(function() {
- if (this.iscustomized == true) {
+ if (this.iscustomized == true) {
items.push({
id: this.id,
description: this.displaytext
@@ -390,7 +390,7 @@
}
});
}
- },
+ },
checksum: {
docID: 'helpUploadVolumeChecksum',
label: 'label.md5.checksum'
@@ -406,12 +406,12 @@
url: args.data.url
};
- if (args.data.diskOffering != '' && args.data.diskOffering.length > 0) {
+ 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 +445,7 @@
poll: pollAsyncJobResult
}
},
-
+
uploadVolumefromLocal: {
isHeader: true,
label: 'Upload from Local',
@@ -462,7 +462,7 @@
fileUpload: {
getURL: function(args) {
args.data = args.formData;
-
+
var data = {
name: args.data.name,
zoneId: args.data.availabilityZone,
@@ -475,7 +475,7 @@
checksum: args.data.checksum
});
}
-
+
$.ajax({
url: createURL('getUploadParamsForVolume'),
data: data,
@@ -506,7 +506,7 @@
args.response.success();
}
}
- },
+ },
fields: {
volumeFileUpload: {
label: 'local file',
@@ -584,7 +584,7 @@
notification: {
poll: pollAsyncJobResult
}
- }
+ }
},
advSearchFields: {
@@ -686,12 +686,12 @@
$.extend(data, {
virtualMachineId: args.context.instances[0].id
});
- }
+ }
if ("primarystorages" in args.context) {
$.extend(data, {
storageid: args.context.primarystorages[0].id
});
- }
+ }
}
$.ajax({
@@ -804,7 +804,7 @@
isBoolean: true,
isHidden: function(args) {
if (args.context.volumes[0].quiescevm == true)
- return false;
+ return false;
else
return true;
}
@@ -1137,7 +1137,7 @@
hypervisor: args.context.volumes[0].hypervisor
});
}
-
+
$(['Running', 'Stopped']).each(function() {
$.ajax({
url: createURL('listVirtualMachines'),
@@ -1147,11 +1147,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 +1285,12 @@
title: 'label.create.template',
preFilter: cloudStack.preFilter.createTemplate,
desc: '',
- preFilter: function(args) {
- if (args.context.volumes[0].hypervisor == "XenServer") {
- if (isAdmin()) {
+ 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,24 +1304,24 @@
validation: {
required: true
}
- },
+ },
xenserverToolsVersion61plus: {
label: 'label.xenserver.tools.version.61.plus',
isBoolean: true,
- isChecked: function (args) {
+ isChecked: function (args) {
var b = false;
- var vmObj;
+ var vmObj;
$.ajax({
url: createURL("listVirtualMachines"),
data: {
id: args.context.volumes[0].virtualmachineid
},
async: false,
- success: function(json) {
+ success: function(json) {
vmObj = json.listvirtualmachinesresponse.virtualmachine[0];
- }
- });
- if (vmObj == undefined) { //e.g. VM has failed over
+ }
+ });
+ if (vmObj == undefined) { //e.g. VM has failed over
if (isAdmin()) {
$.ajax({
url: createURL('listConfigurations'),
@@ -1336,18 +1336,18 @@
}
});
}
- } else {
+ } 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 +1406,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)
-
+ }
+ //XenServer only (ends here)
+
$.ajax({
url: createURL('createTemplate'),
data: data,
@@ -1580,8 +1580,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 +1589,7 @@
} else {
$shrinkok.hide();
}
-
+
var $newsize = $form.find('.form-item[rel=newsize]');
if (selectedDiskOfferingObj.iscustomized == true) {
$newsize.css('display', 'inline-block');
@@ -1642,11 +1642,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 +1838,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"
});
-
+
args.response.success({
actionFilter: volumeActionfilter,
data: jsonObj
@@ -2129,9 +2129,9 @@
validation: {
required: true
}
- },
+ },
zoneid: {
- label: 'label.availability.zone',
+ label: 'label.availability.zone',
isHidden: true,
select: function(args) {
$.ajax({
@@ -2139,11 +2139,11 @@
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({
@@ -2151,14 +2151,14 @@
description: zoneObjs[i].name
});
}
- }
- args.response.success({
+ }
+ args.response.success({
data: items
});
}
});
}
- }
+ }
}
},
action: function(args) {
@@ -2166,13 +2166,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 != '') {
+
+ 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 +2329,22 @@
return ["remove"];
}
- if (jsonObj.hypervisor != "Ovm" && jsonObj.state == "Ready") {
- if (jsonObj.hypervisor == 'KVM') {
- if (jsonObj.vmstate == 'Running') {
+ 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..d4dc3020e7b 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: '