Removed trailing whitespace from ui/scripts/*.js

This commit is contained in:
Kevin Dierkx 2015-08-07 11:25:15 +02:00
parent a5e563aa85
commit 2bdbaf453e
32 changed files with 2177 additions and 2177 deletions

View File

@ -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 + ' <br> ';
}
}
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;
}

View File

@ -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));

View File

@ -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);

View File

@ -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',

View File

@ -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);

View File

@ -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);

View File

@ -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 ?

View File

@ -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
}
}

View File

@ -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,

View File

@ -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',

View File

@ -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

View File

@ -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");
}

File diff suppressed because it is too large Load Diff

View File

@ -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 });
}
};

View File

@ -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: {

View File

@ -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));
}
});
}
}
}
};
}

View File

@ -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");
}

File diff suppressed because it is too large Load Diff

View File

@ -16,7 +16,7 @@
// under the License.
(function(cloudStack, $) {
var ostypeObjs;
cloudStack.sections.templates = {
title: 'label.menu.templates',
id: 'templates',
@ -131,19 +131,19 @@
validation: {
required: true
}
},
},
zone: {
label: 'label.zone',
docID: 'helpRegisterTemplateZone',
select: function(args) {
select: function(args) {
if(g_regionsecondaryenabled == true) {
args.response.success({
data: [{
id: -1,
description: "All Zones"
}]
});
} else {
});
} else {
$.ajax({
url: createURL("listZones&available=true"),
dataType: "json",
@ -184,7 +184,7 @@
var apiCmd;
if (args.zone == -1) { //All Zones
//apiCmd = "listHypervisors&zoneid=-1"; //"listHypervisors&zoneid=-1" has been changed to return only hypervisors available in all zones (bug 8809)
apiCmd = "listHypervisors";
apiCmd = "listHypervisors";
}
else {
apiCmd = "listHypervisors&zoneid=" + args.zone;
@ -215,20 +215,20 @@
$form.find('.form-item[rel=rootDiskControllerType]').css('display', 'inline-block');
$form.find('.form-item[rel=nicAdapterType]').css('display', 'inline-block');
$form.find('.form-item[rel=keyboardType]').css('display', 'inline-block');
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
} else if ($(this).val() == "XenServer") {
$form.find('.form-item[rel=rootDiskControllerType]').hide();
$form.find('.form-item[rel=nicAdapterType]').hide();
$form.find('.form-item[rel=keyboardType]').hide();
$form.find('.form-item[rel=keyboardType]').hide();
if (isAdmin())
$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
$form.find('.form-item[rel=xenserverToolsVersion61plus]').css('display', 'inline-block');
} else {
$form.find('.form-item[rel=rootDiskControllerType]').hide();
$form.find('.form-item[rel=nicAdapterType]').hide();
$form.find('.form-item[rel=keyboardType]').hide();
$form.find('.form-item[rel=xenserverToolsVersion61plus]').hide();
}
});
@ -260,7 +260,7 @@
},
isHidden: true
},
//fields for hypervisor == "VMware" (starts here)
rootDiskControllerType: {
label: 'label.root.disk.controller',
@ -419,18 +419,18 @@
osTypeId: {
label: 'label.os.type',
docID: 'helpRegisterTemplateOSType',
select: function(args) {
select: function(args) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: true,
success: function(json) {
success: function(json) {
var ostypeObjs = json.listostypesresponse.ostype;
args.response.success({
data: ostypeObjs
});
}
});
});
}
},
@ -519,16 +519,16 @@
});
}
//XenServer only (starts here)
//XenServer only (starts here)
if (args.$form.find('.form-item[rel=xenserverToolsVersion61plus]').css("display") != "none") {
$.extend(data, {
'details[0].hypervisortoolsversion': (args.data.xenserverToolsVersion61plus == "on") ? "xenserver61" : "xenserver56"
});
}
//XenServer only (ends here)
//VMware only (starts here)
if (args.$form.find('.form-item[rel=rootDiskControllerType]').css("display") != "none" && args.data.rootDiskControllerType != "") {
$.extend(data, {
@ -579,7 +579,7 @@
}
}
},
uploadTemplateFromLocal: {
isHeader: true,
label: 'Upload from Local',
@ -592,9 +592,9 @@
title: 'Upload Template from Local',
preFilter: cloudStack.preFilter.createTemplate,
fileUpload: {
getURL: function(args) {
getURL: function(args) {
args.data = args.formData;
var data = {
name: args.data.name,
displayText: args.data.description,
@ -606,7 +606,7 @@
osTypeId: args.data.osTypeId,
hypervisor: args.data.hypervisor
};
if (args.$form.find('.form-item[rel=isPublic]').css("display") != "none") {
$.extend(data, {
ispublic: (args.data.isPublic == "on")
@ -630,15 +630,15 @@
isrouting: (args.data.isrouting === 'on')
});
}
$.ajax({
url: createURL('getUploadParamsForTemplate'),
data: data,
async: false,
success: function(json) {
success: function(json) {
var uploadparams = json.postuploadtemplateresponse.getuploadparams;
var templateId = uploadparams.id;
args.response.success({
url: uploadparams.postURL,
ajaxPost: true,
@ -647,9 +647,9 @@
'X-expires': uploadparams.expires,
'X-metadata': uploadparams.metadata
}
});
});
}
});
});
},
postUpload: function(args) {
if(args.error) {
@ -685,7 +685,7 @@
validation: {
required: true
}
},
},
zone: {
label: 'label.zone',
@ -742,24 +742,24 @@
});
}
},
format: {
label: 'label.format',
docID: 'helpRegisterTemplateFormat',
dependsOn: 'hypervisor',
select: function(args) {
var items = [];
if (args.hypervisor == "XenServer") {
if (args.hypervisor == "XenServer") {
items.push({
id: 'VHD',
description: 'VHD'
});
} else if (args.hypervisor == "VMware") {
} else if (args.hypervisor == "VMware") {
items.push({
id: 'OVA',
description: 'OVA'
});
} else if (args.hypervisor == "KVM") {
} else if (args.hypervisor == "KVM") {
items.push({
id: 'QCOW2',
description: 'QCOW2'
@ -776,17 +776,17 @@
id: 'VMDK',
description: 'VMDK'
});
} else if (args.hypervisor == "BareMetal") {
} else if (args.hypervisor == "BareMetal") {
items.push({
id: 'BareMetal',
description: 'BareMetal'
});
} else if (args.hypervisor == "Ovm") {
} else if (args.hypervisor == "Ovm") {
items.push({
id: 'RAW',
description: 'RAW'
});
} else if (args.hypervisor == "LXC") {
} else if (args.hypervisor == "LXC") {
items.push({
id: 'TAR',
description: 'TAR'
@ -805,23 +805,23 @@
data: items
});
}
},
},
osTypeId: {
label: 'label.os.type',
docID: 'helpRegisterTemplateOSType',
select: function(args) {
select: function(args) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: true,
success: function(json) {
success: function(json) {
var ostypeObjs = json.listostypesresponse.ostype;
args.response.success({
data: ostypeObjs
});
}
});
});
}
},
@ -830,40 +830,40 @@
docID: 'helpRegisterTemplateExtractable',
isBoolean: true
},
isPasswordEnabled: {
label: "label.password.enabled",
docID: 'helpRegisterTemplatePasswordEnabled',
isBoolean: true
},
isdynamicallyscalable: {
label: "label.dynamically.scalable",
docID: 'helpRegisterTemplateDynamicallyScalable',
isBoolean: true
},
},
isPublic: {
label: "label.public",
docID: 'helpRegisterTemplatePublic',
isBoolean: true,
isHidden: true
},
},
isFeatured: {
label: "label.featured",
docID: 'helpRegisterTemplateFeatured',
isBoolean: true,
isHidden: true
},
isrouting: {
label: 'label.routing',
docID: 'helpRegisterTemplateRouting',
isBoolean: true,
isHidden: true
},
requireshvm: {
label: 'label.hvm',
docID: 'helpRegisterTemplateHvm',
@ -934,14 +934,14 @@
success: function(json) {
var items = json.listtemplatesresponse.template;
var itemsView = [];
$(items).each(function(index, item) {
var existing = $.grep(itemsView, function(it){
return it != null && it.id !=null && it.id == item.id;
});
if (existing.length == 0) {
itemsView.push($.extend(item, {
itemsView.push($.extend(item, {
zones: item.zonename,
zoneids: [item.zoneid]
}));
@ -950,7 +950,7 @@
existing[0].zones = 'label.multiplezones';
existing[0].zoneids.push(item.zoneid);
}
});
});
args.response.success({
actionFilter: templateActionfilter,
@ -1035,10 +1035,10 @@
}
});
//***** 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: {
@ -1055,33 +1055,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: "message.XSTools61plus.update.failed" + " " + _s(result.jobresult.errortext)
});
});
}
}
},
error: function(XMLHttpResponse) {
error: function(XMLHttpResponse) {
cloudStack.dialog.notice({
message: "message.XSTools61plus.update.failed" + " " + parseXMLHttpResponse(XMLHttpResponse)
});
});
}
});
}, g_queryAsyncJobResultInterval);
}, g_queryAsyncJobResultInterval);
}
});
}
//XenServer only (ends here)
});
}
//XenServer only (ends here)
//***** listTemplates *****
//So, we call listTemplates API to get a complete template object
@ -1162,36 +1162,36 @@
} else {
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
}
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
hiddenFields.push('xenserverToolsVersion61plus');
}
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
var ostypeObjs;
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
success: function(json) {
var ostypeObjs = json.listostypesresponse.ostype;
success: function(json) {
var ostypeObjs = json.listostypesresponse.ostype;
}
});
if (ostypeObjs != undefined) {
var ostypeName;
for (var i = 0; i < ostypeObjs.length; i++) {
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
ostypeName = ostypeObjs[i].description;
break;
}
}
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
}
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
hiddenFields.push('xenserverToolsVersion61plus');
}
}
}
}
return hiddenFields;
},
@ -1203,7 +1203,7 @@
required: true
}
}
}, {
}, {
hypervisor: {
label: 'label.hypervisor'
},
@ -1217,8 +1217,8 @@
return false;
},
converter: cloudStack.converters.toBooleanText
},
},
size: {
label: 'label.size',
converter: function(args) {
@ -1276,8 +1276,8 @@
return false;
},
converter: cloudStack.converters.toBooleanText
},
},
ostypeid: {
label: 'label.os.type',
isEditable: true,
@ -1287,11 +1287,11 @@
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({
@ -1315,8 +1315,8 @@
validation: {
required: true
}
},
},
domain: {
label: 'label.domain'
},
@ -1327,11 +1327,11 @@
label: 'label.created',
converter: cloudStack.converters.toLocalDate
},
templatetype: {
label: 'label.type'
},
id: {
label: 'label.id'
}
@ -1343,7 +1343,7 @@
}),
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab
$.ajax({
url: createURL("listTemplates"),
data: {
@ -1352,14 +1352,14 @@
},
success: function(json) {
var jsonObj = json.listtemplatesresponse.template[0];
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
if (jsonObj.details.hypervisortoolsversion == 'xenserver61')
jsonObj.xenserverToolsVersion61plus = true;
else
jsonObj.xenserverToolsVersion61plus = false;
}
args.response.success({
actionFilter: templateActionfilter,
data: jsonObj
@ -1388,7 +1388,7 @@
hideSearchBar: true,
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing)
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing)
$.ajax({
url: createURL("listTemplates"),
data: {
@ -1397,7 +1397,7 @@
},
success: function(json) {
var jsonObjs = json.listtemplatesresponse.template;
if (jsonObjs != undefined) {
for (var i = 0; i < jsonObjs.length; i++) {
var jsonObj = jsonObjs[i];
@ -1408,16 +1408,16 @@
jsonObj.xenserverToolsVersion61plus = false;
}
}
}
}
args.response.success({
actionFilter: templateActionfilter,
data: jsonObjs
});
}
});
});
},
detailView: {
noCompact: true,
actions: {
@ -1500,18 +1500,18 @@
}
}
},
action: function(args) {
action: function(args) {
var data = {
id: args.context.templates[0].id,
destzoneid: args.data.destinationZoneId
};
};
$.extend(data, {
sourcezoneid: args.context.zones[0].zoneid
});
});
$.ajax({
url: createURL('copyTemplate'),
data: data,
data: data,
success: function(json) {
var jid = json.copytemplateresponse.jobid;
args.response.success({
@ -1532,7 +1532,7 @@
poll: pollAsyncJobResult
}
}
},
},
tabs: {
details: {
@ -1544,36 +1544,36 @@
} else {
hiddenFields = ["hypervisor", 'xenserverToolsVersion61plus'];
}
if ('templates' in args.context && args.context.templates[0].hypervisor != 'XenServer') {
hiddenFields.push('xenserverToolsVersion61plus');
}
if ('templates' in args.context && args.context.templates[0].ostypeid != undefined) {
var ostypeObjs;
$.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.templates[0].ostypeid) {
if (ostypeObjs[i].id == args.context.templates[0].ostypeid) {
ostypeName = ostypeObjs[i].description;
break;
}
}
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
}
if (ostypeName == undefined || ostypeName.indexOf("Win") == -1) {
hiddenFields.push('xenserverToolsVersion61plus');
}
}
}
}
}
return hiddenFields;
},
@ -1585,13 +1585,13 @@
required: true
}
}
}, {
}, {
id: {
label: 'label.id'
},
zonename: {
label: 'label.zone.name'
},
},
zoneid: {
label: 'label.zone.id'
},
@ -1616,8 +1616,8 @@
return false;
},
converter: cloudStack.converters.toBooleanText
},
},
size: {
label: 'label.size',
converter: function(args) {
@ -1675,22 +1675,22 @@
return false;
},
converter: cloudStack.converters.toBooleanText
},
},
ostypeid: {
label: 'label.os.type',
isEditable: true,
select: function(args) {
select: function(args) {
var ostypeObjs;
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
success: function(json) {
ostypeObjs = json.listostypesresponse.ostype;
ostypeObjs = json.listostypesresponse.ostype;
}
});
var items = [];
$(ostypeObjs).each(function() {
items.push({
@ -1711,8 +1711,8 @@
validation: {
required: true
}
},
},
domain: {
label: 'label.domain'
},
@ -1723,7 +1723,7 @@
label: 'label.created',
converter: cloudStack.converters.toLocalDate
},
templatetype: {
label: 'label.type'
}
@ -1736,7 +1736,7 @@
}),
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing) > select a zone from listing > Details tab
dataProvider: function(args) { // UI > Templates menu (listing) > select a template from listing > Details tab > Zones tab (listing) > select a zone from listing > Details tab
var jsonObj = args.context.zones[0];
if ('details' in jsonObj && 'hypervisortoolsversion' in jsonObj.details) {
@ -1749,11 +1749,11 @@
args.response.success({
actionFilter: templateActionfilter,
data: jsonObj
});
});
}
}
}}
}
}
}
}
}
@ -1838,8 +1838,8 @@
id: -1,
description: "All Zones"
}]
});
} else {
});
} else {
$.ajax({
url: createURL("listZones&available=true"),
dataType: "json",
@ -1891,7 +1891,7 @@
dataType: "json",
async: true,
success: function(json) {
var ostypeObjs = json.listostypesresponse.ostype;
var ostypeObjs = json.listostypesresponse.ostype;
var items = [];
//items.push({id: "", description: "None"}); //shouldn't have None option when bootable is checked
$(ostypeObjs).each(function() {
@ -1904,7 +1904,7 @@
data: items
});
}
});
});
}
},
@ -2316,13 +2316,13 @@
label: 'label.os.type',
isEditable: true,
select: function(args) {
if (ostypeObjs == undefined) {
if (ostypeObjs == undefined) {
$.ajax({
url: createURL("listOsTypes"),
dataType: "json",
async: false,
success: function(json) {
ostypeObjs = json.listostypesresponse.ostype;
ostypeObjs = json.listostypesresponse.ostype;
}
});
}
@ -2412,7 +2412,7 @@
}
});
},
detailView: {
actions: {
copyISO: {
@ -2458,17 +2458,17 @@
}
}
},
action: function(args) {
action: function(args) {
var data = {
id: args.context.isos[0].id,
destzoneid: args.data.destinationZoneId
};
};
if (args.context.zones[0].zoneid != undefined) {
$.extend(data, {
sourcezoneid: args.context.zones[0].zoneid
});
}
});
}
$.ajax({
url: createURL('copyIso'),
data: data,
@ -2616,10 +2616,10 @@
dataType: "json",
async: false,
success: function(json) {
ostypeObjs = json.listostypesresponse.ostype;
ostypeObjs = json.listostypesresponse.ostype;
}
});
var items = [];
$(ostypeObjs).each(function() {
items.push({
@ -2629,7 +2629,7 @@
});
args.response.success({
data: items
});
});
}
},
@ -2689,14 +2689,14 @@
//do nothing
} else {
allowedActions.push("edit");
allowedActions.push("copyTemplate");
/*
if(g_regionsecondaryenabled != true) {
allowedActions.push("copyTemplate");
}
*/
//allowedActions.push("createVm"); // For Beta2, this simply doesn't work without a network.
}

View File

@ -209,10 +209,10 @@
}
]
}
};
*/
};
*/
//for testing only (end)
if (json.ldapuserresponse.count > 0) {
$(json.ldapuserresponse.LdapUser).each(function() {
var $result = $('<tr>');
@ -334,4 +334,4 @@
accountsWizard(args);
};
};
})(jQuery, cloudStack);
})(jQuery, cloudStack);

View File

@ -301,7 +301,7 @@
'select-iso': function($step, formData) {
$step.find('.section.custom-size').hide();
var originalValues = function(formData) {
var $inputs = $step.find('.wizard-step-conditional:visible')
.find('input[type=radio]');
@ -323,7 +323,7 @@
return {
response: {
success: function(args) {
success: function(args) {
if (formData['select-template']) {
$step.find('.wizard-step-conditional').filter(function() {
return $(this).hasClass(formData['select-template']);
@ -462,7 +462,7 @@
}, {
'wizard-field': 'service-offering'
})
);
);
$step.find('input[type=radio]').bind('change', function() {
var $target = $(this);
@ -576,7 +576,7 @@
$selectContainer.hide();
// Fix issue with containers always showing after reload
$multiDiskSelect.find('.select-container').attr('style', null);
$multiDiskSelect.find('.select-container').attr('style', null);
} else {
$selectContainer.show();
$step.find('.content .select-container').append(
@ -618,7 +618,7 @@
// handle removal of custom IOPS controls
$step.removeClass('custom-iops-do');
}
return true;
}
@ -1137,19 +1137,19 @@
// Next button
if ($target.closest('div.button.next').size()) {
//step 2 - select template/ISO
if($activeStep.hasClass('select-iso')) {
if($activeStep.hasClass('select-iso')) {
if ($activeStep.find('.content:visible input:checked').size() == 0) {
cloudStack.dialog.notice({
message: 'message.step.1.continue'
});
return false;
}
}
$(window).trigger("cloudStack.module.instanceWizard.clickNextButton", {
$form: $form,
currentStep: 2
});
}
});
}
//step 6 - select network
if ($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
var data = $activeStep.data('my-networks');
@ -1277,7 +1277,7 @@
$wizard.find('.tab-view').tabs();
$wizard.find('.slider').each(function() {
var $slider = $(this);
$slider.slider({
min: minCustomDiskSize,
max: maxCustomDiskSize,

View File

@ -61,7 +61,7 @@
);
$li.appendTo($socketInfo);
});
});
}
}
});

View File

@ -53,13 +53,13 @@
$plugin.click(function() {
var $mainSection = $('#navigation ul li').filter('.' + plugin.id);
if ($mainSection.size()) {
$mainSection.click();
return;
}
$browser.cloudBrowser('addPanel', {
title: plugin.title,
$parent: $('.panel:first'),

View File

@ -296,21 +296,21 @@
var hypervisor = getData($trafficType.closest('.zone-wizard')).zone.hypervisor;
var zoneType = getData($trafficType.closest('.zone-wizard')).zone.networkType;
var fields;
if (hypervisor == 'VMware') {
fields = {
vSwitchName: {
label: 'label.vswitch.name' ,
defaultValue: trafficData.vSwitchName
},
vlanId: {
vlanId: {
label: 'label.vlan.id',
defaultValue: trafficData.vlanId
}
};
}
};
if(zoneType == 'Advanced') {
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
if($trafficType.hasClass('guest') || $trafficType.hasClass('public')) {
if(trafficData.vSwitchType == null) {
var useDvs = false;
$.ajax({
@ -324,9 +324,9 @@
useDvs = true;
}
}
});
if (useDvs == true) {
var useNexusDvs = false;
});
if (useDvs == true) {
var useNexusDvs = false;
$.ajax({
url: createURL('listConfigurations'),
data: {
@ -345,17 +345,17 @@
} else {
trafficData.vSwitchType = 'vmwaredvs';
fields.vSwitchName.defaultValue = 'dvSwitch0';
}
}
} else { //useDvs == false
trafficData.vSwitchType = 'vmwaresvs';
fields.vSwitchName.defaultValue = 'vSwitch0';
}
}
}
$.extend(fields, {
vSwitchType: {
label: 'label.vSwitch.type',
select: function (args) {
select: function (args) {
args.response.success({
data: [{
id: 'nexusdvs',
@ -371,10 +371,10 @@
},
defaultValue: trafficData.vSwitchType
}
});
}
});
}
}
} else {
} else {
fields = {
label: {
label: hypervisor + ' ' + _l('label.traffic.label'),
@ -390,7 +390,7 @@
fields: fields
},
after: function(args) {
after: function(args) {
$trafficType.data('traffic-type-data', args.data);
}
});

View File

@ -98,7 +98,7 @@
$navItem.addClass('active');
$browser.cloudBrowser('removeAllPanels');
}
$browser.cloudBrowser('addPanel', {
title: '<span class="section">' + _l(data.title) + '</span>' + '<span class="subsection"></span>',
data: '',
@ -106,7 +106,7 @@
if(!isPlugin) {
$breadcrumb.attr('title', _l(data.title));
}
data.$breadcrumb = $breadcrumb;
// Hide breadcrumb if this is the home section

View File

@ -48,11 +48,11 @@
// Description text
var formDesc;
if (typeof(args.form.desc) == 'function') {
if (typeof(args.form.desc) == 'function') {
formDesc = args.form.desc(args);
} else { //typeof(args.form.desc) == 'string' or 'undefined'
formDesc = args.form.desc;
}
}
$('<span>').addClass('message').prependTo($formContainer).html(
_l(formDesc)
);
@ -225,7 +225,7 @@
if ($dependsOn.is('[type=checkbox]')) {
var isReverse = false;
if (args.form.fields[dependsOn]) {
isReverse = args.form.fields[dependsOn].isReverse;
isChecked = args.form.fields[dependsOn].isChecked;
@ -238,10 +238,10 @@
if (($target.is(':checked') && !isReverse) ||
($target.is(':unchecked') && isReverse)) {
$dependent.css('display', 'inline-block'); //show dependent dropdown field
$dependent.change(); //trigger event handler for default option in dependent dropdown field (CLOUDSTACK-7826)
$dependent.each(function() {
if ($(this).data('dialog-select-fn')) {
$(this).data('dialog-select-fn')();
@ -283,7 +283,7 @@
success: function(args) {
if (args.data == undefined || args.data.length == 0) {
var $option = $('<option>')
.appendTo($input)
.appendTo($input)
.html("");
} else {
$(args.data).each(function() {

View File

@ -90,7 +90,7 @@
return '';
}
var sanitized = value
var sanitized = value
.replace(/</g, "&lt;")
.replace(/>/g, "&gt;");

View File

@ -239,7 +239,7 @@
cloudStack.dialog.notice({
message: messages.complete(args2.data)
});
}
}
}
if (additional && additional.complete) additional.complete($.extend(true, args, {
$detailView: $detailView
@ -387,31 +387,31 @@
}
});
},
destroy: function($detailView, args) {
var tab = args.tabs[args.activeTab];
var isMultiple = tab.multiple;
uiActions.standard($detailView, args, {
noRefresh: true,
complete: function(args, args2) {
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
complete: function(args, args2) {
if ((!('id' in args2.data)) && ('toRemove' in args2.data) && (args2.data.toRemove == true)) {
if (isMultiple && $detailView.is(':visible')) {
$detailView.find('.refresh').click(); // Reload tab
} else {
var $browser = $('#browser .container');
var $panel = $detailView.closest('.panel');
if ($detailView.is(':visible')) {
$browser.cloudBrowser('selectPanel', {
panel: $panel.prev()
});
}
if ($detailView.data("list-view-row") != null) {
var $row = $detailView.data('list-view-row');
var $tbody = $row.closest('tbody');
$row.remove();
if (!$tbody.find('tr').size()) {
$("<tr>").addClass('empty').append(
@ -427,8 +427,8 @@
}
});
},
/**
* Convert editable fields to text boxes; clicking again saves data
*

View File

@ -21,7 +21,7 @@
var uiActions = {
standard: function($instanceRow, args, additional) {
var isAddAction = args.action.isAdd;
var listViewArgs = $instanceRow.closest('div.list-view').data('view-args');
var notification = args.action.notification ? args.action.notification : {};
var messages = args.action ? args.action.messages : {};
@ -366,7 +366,7 @@
error: function(message) {
$instanceRow.removeClass('loading');
$instanceRow.find('td.quick-view').removeClass('loading-overlay');
if (!isHeader) {
if (($.isPlainObject(args.action.createForm) && args.action.addRow != 'false') ||
(!args.action.createForm && args.action.addRow == 'true')) {
@ -629,10 +629,10 @@
showEditField();
} else if ($editInput.val() != $label.html()) { //click Save button with changed value
if ($editInput.val().match(/<|>/)) {
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
cloudStack.dialog.notice({ message: 'message.validate.invalid.characters' });
return false;
}
$edit.animate({
opacity: 0.5
});
@ -1148,7 +1148,7 @@
$td.attr('title', _s(content));
});
var $first = $tr.find('td:first');
if (multiSelect)
$first = $first.next();
@ -1208,15 +1208,15 @@
rowActions[actionName]($tr);
var map1 = {};
$tr.closest('tbody').find('tr').each(function() {
/*
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
/*
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
* e.g. An Template/ISO of multiple zones have the same UUID.
*/
var objId = $(this).data('json-obj').id;
if(!(objId in map1)) {
if(!(objId in map1)) {
sort($(this), action);
map1[objId] = 1;
}
}
});
$tr.closest('.data-table').dataTable('selectRow', $tr.index());
@ -1238,12 +1238,12 @@
rowActions._std($tr, function() {});
var map1 = {};
$tr.closest('tbody').find('tr').each(function() {
/*
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
/*
* fire only one sorting API call(updateXXXXXXX&sortKey=n&id=UUID) for items who have the same UUID.
* e.g. An Template/ISO of multiple zones have the same UUID.
*/
var objId = $(this).data('json-obj').id;
if(!(objId in map1)) {
if(!(objId in map1)) {
sort($(this), reorder.moveDrag);
map1[objId] = 1;
}
@ -1355,7 +1355,7 @@
$select.hide();
}
$select.find('option:first').attr('selected', 'selected');
$select.find('option:first').attr('selected', 'selected');
$listView.find('.data-table').dataTable('refresh');
}
}
@ -1801,7 +1801,7 @@
noActionCol: listViewData.noActionCol
});
createFilters($toolbar, listViewData.filters);
if (listViewData.hideSearchBar != true) {
createSearchBar($toolbar, listViewData);
}

View File

@ -90,7 +90,7 @@
if (isHidden) {
return true;
}
var $td = $('<td>').addClass(fieldName).appendTo($tr);
var $input, val;
var $addButton = $multi.find('form .button.add-vm:not(.custom-action)').clone();
@ -280,7 +280,7 @@
// Align width to main header
_medit.refreshItemWidths($multi);
if (data._hideFields &&
$.inArray(fieldName, data._hideFields) > -1) {
$td.addClass('disabled');
@ -712,7 +712,7 @@
itemRow: function(item, itemActions, multiRule, $tbody) {
var $tr = $('<tr>');
var itemName = multiRule._itemName ? item[multiRule._itemName] : item.name;
var $itemName = $('<span>').html(_s(itemName));
@ -727,14 +727,14 @@
});
});
var itemIp = multiRule._itemIp ? item[multiRule._itemIp] : null;
if (itemIp != null) {
var $itemIp = $('<span>').html(_s(itemIp));
$tr.append($('<td>').addClass('state').appendTo($tr).append($itemIp));
}
}
var itemState = item._itemState ? item._itemState : item.state;
$tr.append($('<td>').addClass('state').appendTo($tr).append(
@ -993,7 +993,7 @@
.appendTo($td);
if (field.validation) {
$td.find('input').first().data("validation-settings", field.validation );
$td.find('input').first().data("validation-settings", field.validation );
}
if (field.isDisabled) $input.hide();

View File

@ -31,7 +31,7 @@
subselect: {
isMultiple: true,
label: 'label.use.vm.ip',
dataProvider: function(args) {
dataProvider: function(args) {
var instance = args.context.instances[0];
var network = args.context.networks[0];
@ -41,7 +41,7 @@
virtualmachineid: instance.id,
nicId: instance.nic[0].id
},
success: function(json) {
success: function(json) {
var nic = json.listnicsresponse.nic[0];
var primaryIp = nic.ipaddress;
var secondaryIps = nic.secondaryip ? nic.secondaryip : [];
@ -126,14 +126,14 @@
});
}
}),
action: function(args) {
action: function(args) {
/*
* path 1: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > click on a grid row (Details tab) > click "Assign VMs" tab > click Assign VMs" button on top of list
* path 2: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > "QuickView" on a grid row > click "Assign VMs" button in QuickView
*/
* path 1: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > click on a grid row (Details tab) > click "Assign VMs" tab > click Assign VMs" button on top of list
* path 2: Network > VPC (list) > click "Configure" > pick an internal LB tier > click "Internal LB" (list) > "QuickView" on a grid row > click "Assign VMs" button in QuickView
*/
var $rows = $(':ui-dialog .list-view tbody tr');
var vms = args.context.instances;
// Assign subselect values
$(vms).each(function() {
var vm = this;
@ -155,41 +155,41 @@
};
*/
//virtualmachineids parameter has been replaced with vmidipmap parameter, so comment out the lines above.
var inputData = {
id: args.context.internalLoadBalancers[0].id
};
/*
};
/*
* e.g. first VM(xxx) has two IPs(10.1.1.~), second VM(yyy) has three IPs(10.2.2.~):
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
* vmidipmap[0].vmid=xxx vmidipmap[0].vmip=10.1.1.11
* vmidipmap[1].vmid=xxx vmidipmap[1].vmip=10.1.1.12
* vmidipmap[2].vmid=yyy vmidipmap[2].vmip=10.2.2.77
* vmidipmap[3].vmid=yyy vmidipmap[3].vmip=10.2.2.78
* vmidipmap[4].vmid=yyy vmidipmap[4].vmip=10.2.2.79
*/
var selectedVMs = vms;
if (selectedVMs != null) {
var vmidipmapIndex = 0;
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
for (var vmIndex = 0; vmIndex < selectedVMs.length; vmIndex++) {
var selectedIPs = selectedVMs[vmIndex]._subselect;
for (var ipIndex = 0; ipIndex < selectedIPs.length; ipIndex++) {
inputData['vmidipmap[' + vmidipmapIndex + '].vmid'] = selectedVMs[vmIndex].id;
//"ipAddresses" is not in args.context since this LB rule is under a VPC, not an address.
//"ipAddresses" is not in args.context since this LB rule is under a VPC, not an address.
/*
if (args.context.ipAddresses[0].isportable) {
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex].split(',')[1];
} else {
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
}
*/
inputData['vmidipmap[' + vmidipmapIndex + '].vmip'] = selectedIPs[ipIndex];
vmidipmapIndex++;
}
}
}
}
}
$.ajax({
url: createURL('assignToLoadBalancerRule'),
@ -211,10 +211,10 @@
}
};
};
var aclMultiEdit = {
noSelect: true,
reorder: {
moveDrag: {
action: function(args) {
@ -1192,12 +1192,12 @@
label: 'label.id'
}
},
dataProvider: function(args) {
dataProvider: function(args) {
var data = {
vpcid: args.context.vpc[0].id
};
};
listViewDataProvider(args, data);
$.ajax({
url: createURL('listNetworkACLLists'),
data: data,
@ -2281,7 +2281,7 @@
if (this.id == args.context.vpcGateways[0].aclid) {
return true;
}
items.push({
id: this.id,
description: this.name
@ -2289,7 +2289,7 @@
return true;
});
args.response.success({
data: items
});
@ -2412,13 +2412,13 @@
success: function(json) {
var objs = json.listnetworkacllistsresponse.networkacllist;
var acl = $.grep(objs, function(obj) {
return obj.id === args.context.vpcGateways[0].aclid;
return obj.id === args.context.vpcGateways[0].aclid;
});
item.aclName = acl[0] ? acl[0].name : 'None';
}
});
args.response.success({
data: item,
actionFilter: function(args) {
@ -2813,12 +2813,12 @@
}
});
}
},
},
passive: {
label: 'label.passive',
isBoolean: true,
isChecked: false
}
}
}
},
action: function(args) {
@ -2882,10 +2882,10 @@
passive: {
label: 'label.passive',
converter: cloudStack.converters.toBooleanText
},
},
publicip: {
label: 'label.ip.address'
},
},
gateway: {
label: 'label.gateway'
},
@ -3353,29 +3353,29 @@
tabFilter: function(args) {
var hiddenTabs = ['ipAddresses', 'acl']; // Disable IP address tab; it is redundant with 'view all' button
var networkOfferingHavingELB = false;
var networkOfferingHavingELB = false;
var services = args.context.networks[0].service;
if(services != null) {
for(var i = 0; i < services.length; i++) {
for(var i = 0; i < services.length; i++) {
if (services[i].name == "Lb") {
var capabilities = services[i].capability;
if(capabilities != null) {
for(var k = 0; k < capabilities.length; k++) {
if(capabilities[k].name == "ElasticLb") {
networkOfferingHavingELB = true;
break;
break;
}
}
}
}
break;
}
}
}
}
}
if (networkOfferingHavingELB == false) {
hiddenTabs.push("addloadBalancer");
}
return hiddenTabs;
},
@ -3490,13 +3490,13 @@
});
}
});
//include currently selected network offeirng to dropdown
items.push({
id: args.context.networks[0].networkofferingid,
description: args.context.networks[0].networkofferingdisplaytext
});
});
args.response.success({
data: items
});
@ -3975,7 +3975,7 @@
zoneid: {
label: 'label.zone',
validation: {
required: true
required: true
},
isHidden: true,

View File

@ -34,15 +34,15 @@
physicalNetworkID = zoneType == 'Advanced' ? physicalNetworkID : 0;
var physicalNetwork = data.physicalNetworks ? data.physicalNetworks[physicalNetworkID] : null;
var trafficConfig = physicalNetwork ? physicalNetwork.trafficTypeConfiguration[trafficTypeID] : null;
var trafficLabel;
var trafficLabel;
if (trafficConfig != null) {
if ('label' in trafficConfig) {
trafficLabel = trafficConfig.label;
}
else {
trafficLabel = '';
if ('vSwitchName' in trafficConfig) {
trafficLabel += trafficConfig.vSwitchName;
}
@ -56,17 +56,17 @@
trafficLabel += ',';
trafficLabel += trafficConfig.vSwitchType;
}
if (trafficLabel.length == 0) { //trafficLabel == ''
trafficLabel = null;
} else if (trafficLabel.length >= 1) {
if (trafficLabel.charAt(trafficLabel.length-1) == ',') { //if last character is comma
trafficLabel = trafficLabel.substring(0, trafficLabel.length - 1); //remove the last character (which is comma)
} else if (trafficLabel.length >= 1) {
if (trafficLabel.charAt(trafficLabel.length-1) == ',') { //if last character is comma
trafficLabel = trafficLabel.substring(0, trafficLabel.length - 1); //remove the last character (which is comma)
}
}
}
}
}
var hypervisorAttr, trafficLabelStr;
switch (hypervisor) {
@ -503,10 +503,10 @@
nonSupportedHypervisors["Ovm3"] = 1;
}
if (args.context.zones[0]['network-model'] == "Advanced") { //CLOUDSTACK-7681: UI > zone wizard > Advanced zone > hypervisor => do not support BareMetal
nonSupportedHypervisors["BareMetal"] = 1;
if (args.context.zones[0]['network-model'] == "Advanced") { //CLOUDSTACK-7681: UI > zone wizard > Advanced zone > hypervisor => do not support BareMetal
nonSupportedHypervisors["BareMetal"] = 1;
}
if (items != null) {
for (var i = 0; i < items.length; i++) {
if (items[i].name in nonSupportedHypervisors)
@ -645,10 +645,10 @@
required: false
}
},
isdedicated: {
isdedicated: {
isBoolean: true,
label: 'label.dedicated',
isChecked: false
isChecked: false
},
domain: {
label: 'label.domain',
@ -963,7 +963,7 @@
if ($(this).val() == "VMware") {
//$('li[input_sub_group="external"]', $dialogAddCluster).show();
if (dvSwitchEnabled) {
/*
/*
$fields.filter('[rel=vSwitchPublicType]').css('display', 'inline-block');
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'inline-block');
@ -983,7 +983,7 @@
} else {
/*
/*
$form.find('.form-item[rel=vSwitchPublicType]').css('display', 'none');
$form.find('.form-item[rel=vSwitchGuestType]').css('display', 'none');
$form.find('.form-item[rel=vSwitchPublicName]').css('display','none');
@ -1139,7 +1139,7 @@
dependsOn: 'overridepublictraffic'
},
*/
/*
vSwitchPublicName: {
label: 'Public Traffic vSwitch Name',
@ -1147,7 +1147,7 @@
isHidden: true
},
*/
overrideguesttraffic: {
label: 'label.override.guest.traffic',
isBoolean: true,
@ -1221,7 +1221,7 @@
},
*/
/*
vSwitchGuestName: {
label: 'Guest Traffic vSwitch Name',
@ -1569,7 +1569,7 @@
items.push({
id: "nfs",
description: "nfs"
});
});
items.push({
id: "SharedMountPoint",
description: "SharedMountPoint"
@ -1590,7 +1590,7 @@
items.push({
id: "nfs",
description: "nfs"
});
});
items.push({
id: "PreSetup",
description: "PreSetup"
@ -1607,7 +1607,7 @@
items.push({
id: "nfs",
description: "nfs"
});
});
items.push({
id: "vmfs",
description: "vmfs"
@ -1615,8 +1615,8 @@
args.response.success({
data: items
});
} else if (selectedClusterObj.hypervisortype == "Hyperv") {
var items = [];
} else if (selectedClusterObj.hypervisortype == "Hyperv") {
var items = [];
items.push({
id: "SMB",
description: "SMB/CIFS"
@ -1629,7 +1629,7 @@
items.push({
id: "nfs",
description: "nfs"
});
});
items.push({
id: "ocfs2",
description: "ocfs2"
@ -1642,7 +1642,7 @@
items.push({
id: "nfs",
description: "nfs"
});
});
items.push({
id: "SharedMountPoint",
description: "SharedMountPoint"
@ -1675,154 +1675,154 @@
if (protocol == null)
return;
if (protocol == "nfs") {
$form.find('[rel=server]').css('display', 'block');
if (protocol == "nfs") {
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "SMB") { //"SMB" show almost the same fields as "nfs" does, except 3 more SMB-specific fields.
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').css('display', 'block');
$form.find('[rel=smbPassword]').css('display', 'block');
$form.find('[rel=smbDomain]').css('display', 'block');
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "ocfs2") { //ocfs2 is the same as nfs, except no server field.
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "PreSetup") {
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("localhost");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=path]').find(".name").find("label").html('<span class=\"field-required\">*</span>'+_l('label.SR.name')+':');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "iscsi") {
$form.find('[rel=server]').css('display', 'block');
} else if (protocol == "SMB") { //"SMB" show almost the same fields as "nfs" does, except 3 more SMB-specific fields.
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').hide();
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').css('display', 'block');
$form.find('[rel=smbPassword]').css('display', 'block');
$form.find('[rel=smbDomain]').css('display', 'block');
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "ocfs2") { //ocfs2 is the same as nfs, except no server field.
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "PreSetup") {
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("localhost");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=path]').find(".name").find("label").html('<span class=\"field-required\">*</span>'+_l('label.SR.name')+':');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "iscsi") {
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').hide();
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').css('display', 'block');
$form.find('[rel=lun]').css('display', 'block');
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if ($(this).val() == "clvm") {
$form.find('[rel=server]').hide();
} else if ($(this).val() == "clvm") {
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("localhost");
$form.find('[rel=path]').hide();
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').css('display', 'inline-block');
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "vmfs") {
$form.find('[rel=server]').css('display', 'block');
} else if (protocol == "vmfs") {
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').hide();
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').css('display', 'block');
$form.find('[rel=vCenterDataStore]').css('display', 'block');
$form.find('[rel=glustervolume]').hide();
} else if (protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does.
$form.find('[rel=server]').hide();
} else if (protocol == "SharedMountPoint") { //"SharedMountPoint" show the same fields as "nfs" does.
$form.find('[rel=server]').hide();
$form.find('[rel=server]').find(".value").find("input").val("localhost");
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=path]').css('display', 'block');
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
@ -1832,7 +1832,7 @@
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=path]').hide();
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
@ -1846,19 +1846,19 @@
$form.find('[rel=vCenterDataStore]').hide();
$form.find('[rel=glustervolume]').css('display', 'block');
} else {
$form.find('[rel=server]').css('display', 'block');
} else {
$form.find('[rel=server]').css('display', 'block');
$form.find('[rel=server]').find(".value").find("input").val("");
$form.find('[rel=smbUsername]').hide();
$form.find('[rel=smbPassword]').hide();
$form.find('[rel=smbDomain]').hide();
$form.find('[rel=iqn]').hide();
$form.find('[rel=lun]').hide();
$form.find('[rel=volumegroup]').hide();
$form.find('[rel=vCenterDataCenter]').hide();
$form.find('[rel=vCenterDataStore]').hide();
@ -1893,7 +1893,7 @@
required: true
},
isHidden: true
},
},
smbUsername: {
label: 'label.smb.username',
validation: {
@ -1909,8 +1909,8 @@
},
isHidden: true
},
//iscsi
iqn: {
label: 'label.target.iqn',
@ -1972,45 +1972,45 @@
}
},
secondaryStorage: {
fields: {
fields: {
provider: {
label: 'label.provider',
select: function(args) {
var storageproviders = [];
storageproviders.push({ id: '', description: ''});
var storageproviders = [];
storageproviders.push({ id: '', description: ''});
$.ajax({
url: createURL('listImageStores'),
data: {
provider: 'S3'
},
async: true,
success: function(json) {
success: function(json) {
var s3stores = json.listimagestoresresponse.imagestore;
if(s3stores != null && s3stores.length > 0) {
storageproviders.push({ id: 'S3', description: 'S3'}); //if (region-wide) S3 store exists already, only "S3" option should be included here. Any other type of store is not allowed to be created since cloudstack doesn't support multiple types of store at this point.
if(s3stores != null && s3stores.length > 0) {
storageproviders.push({ id: 'S3', description: 'S3'}); //if (region-wide) S3 store exists already, only "S3" option should be included here. Any other type of store is not allowed to be created since cloudstack doesn't support multiple types of store at this point.
} else {
/*
/*
UI no longer gets providers from "listStorageProviders&type=image" because:
(1) Not all of returned values are handled by UI (e.g. Provider "NetApp" is not handled by UI).
(2) Provider "SMB" which is handled by UI is not returned from "listStorageProviders&type=image"
(2) Provider "SMB" which is handled by UI is not returned from "listStorageProviders&type=image"
*/
storageproviders.push({ id: 'NFS', description: 'NFS'});
storageproviders.push({ id: 'SMB', description: 'SMB/CIFS'});
storageproviders.push({ id: 'S3', description: 'S3'});
storageproviders.push({ id: 'Swift', description: 'Swift'});
}
storageproviders.push({ id: 'Swift', description: 'Swift'});
}
args.response.success({
data: storageproviders
});
args.$select.change(function() {
});
args.$select.change(function() {
var $form = $(this).closest('form');
var $fields = $form.find('.field');
if ($(this).val() == "") {
$fields.filter('[rel=name]').hide();
//NFS
$fields.filter('[rel=zoneid]').hide();
$fields.filter('[rel=nfsServer]').hide();
@ -2020,7 +2020,7 @@
$fields.filter('[rel=smbUsername]').hide();
$fields.filter('[rel=smbPassword]').hide();
$fields.filter('[rel=smbDomain]').hide();
//S3
$fields.filter('[rel=accesskey]').hide();
$fields.filter('[rel=secretkey]').hide();
@ -2043,7 +2043,7 @@
$fields.filter('[rel=key]').hide();
} else if ($(this).val() == "NFS") {
$fields.filter('[rel=name]').css('display', 'inline-block');
//NFS
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
@ -2053,7 +2053,7 @@
$fields.filter('[rel=smbUsername]').hide();
$fields.filter('[rel=smbPassword]').hide();
$fields.filter('[rel=smbDomain]').hide();
//S3
$fields.filter('[rel=accesskey]').hide();
$fields.filter('[rel=secretkey]').hide();
@ -2076,7 +2076,7 @@
$fields.filter('[rel=key]').hide();
} else if ($(this).val() == "SMB") {
$fields.filter('[rel=name]').css('display', 'inline-block');
//NFS
$fields.filter('[rel=zoneid]').css('display', 'inline-block');
$fields.filter('[rel=nfsServer]').css('display', 'inline-block');
@ -2086,7 +2086,7 @@
$fields.filter('[rel=smbUsername]').css('display', 'inline-block');
$fields.filter('[rel=smbPassword]').css('display', 'inline-block');
$fields.filter('[rel=smbDomain]').css('display', 'inline-block');
//S3
$fields.filter('[rel=accesskey]').hide();
$fields.filter('[rel=secretkey]').hide();
@ -2109,15 +2109,15 @@
$fields.filter('[rel=key]').hide();
} else if ($(this).val() == "S3") {
$fields.filter('[rel=name]').css('display', 'inline-block');
if(s3stores != null && s3stores.length > 0) {
$fields.filter('[rel=name]').find('input').val(s3stores[0].name);
$fields.filter('[rel=name]').find('input').attr("disabled", "disabled");
} else {
//$fields.filter('[rel=name]').find('input').val("");
$fields.filter('[rel=name]').find('input').removeAttr("disabled");
}
}
//NFS
$fields.filter('[rel=zoneid]').hide();
$fields.filter('[rel=nfsServer]').hide();
@ -2127,7 +2127,7 @@
$fields.filter('[rel=smbUsername]').hide();
$fields.filter('[rel=smbPassword]').hide();
$fields.filter('[rel=smbDomain]').hide();
//S3
if(s3stores != null && s3stores.length > 0) {
$fields.filter('[rel=accesskey]').hide();
@ -2137,7 +2137,7 @@
$fields.filter('[rel=usehttps]').hide();
$fields.filter('[rel=connectiontimeout]').hide();
$fields.filter('[rel=maxerrorretry]').hide();
$fields.filter('[rel=sockettimeout]').hide();
$fields.filter('[rel=sockettimeout]').hide();
} else {
$fields.filter('[rel=accesskey]').css('display', 'inline-block');
$fields.filter('[rel=secretkey]').css('display', 'inline-block');
@ -2147,13 +2147,13 @@
$fields.filter('[rel=connectiontimeout]').css('display', 'inline-block');
$fields.filter('[rel=maxerrorretry]').css('display', 'inline-block');
$fields.filter('[rel=sockettimeout]').css('display', 'inline-block');
}
}
$fields.filter('[rel=createNfsCache]').find('input').attr('checked', 'checked');
$fields.filter('[rel=createNfsCache]').find('input').attr("disabled", "disabled"); //Create NFS staging is required for S3 at this moment. So, disallow user to uncheck "Create NFS Secondary Staging" checkbox
$fields.filter('[rel=createNfsCache]').css('display', 'inline-block');
$fields.filter('[rel=nfsCacheNfsServer]').css('display', 'inline-block');
$fields.filter('[rel=nfsCachePath]').css('display', 'inline-block');
//Swift
$fields.filter('[rel=url]').hide();
$fields.filter('[rel=account]').hide();
@ -2161,7 +2161,7 @@
$fields.filter('[rel=key]').hide();
} else if ($(this).val() == "Swift") {
$fields.filter('[rel=name]').css('display', 'inline-block');
//NFS
$fields.filter('[rel=zoneid]').hide();
$fields.filter('[rel=nfsServer]').hide();
@ -2171,7 +2171,7 @@
$fields.filter('[rel=smbUsername]').hide();
$fields.filter('[rel=smbPassword]').hide();
$fields.filter('[rel=smbDomain]').hide();
//S3
$fields.filter('[rel=accesskey]').hide();
$fields.filter('[rel=secretkey]').hide();
@ -2193,10 +2193,10 @@
$fields.filter('[rel=username]').css('display', 'inline-block');
$fields.filter('[rel=key]').css('display', 'inline-block');
}
});
args.$select.change();
});
args.$select.change();
}
});
});
}
},
@ -2204,7 +2204,7 @@
label: 'label.name',
isHidden: true
},
//NFS, SMB (begin)
nfsServer: {
label: 'label.server', //change label from "NFS Server" to "Server" since this field is also shown when provider "SMB/CIFS" is elected.
@ -2223,7 +2223,7 @@
//NFS, SMB (end)
//SMB (begin)
//SMB (begin)
smbDomain: {
label: 'label.smb.domain',
validation: {
@ -2242,9 +2242,9 @@
validation: {
required: true
}
},
},
//SMB (end)
//S3 (begin)
accesskey: {
label: 'label.s3.access_key',
@ -2272,7 +2272,7 @@
isHidden: true
},
usehttps: {
label: 'label.s3.use_https',
label: 'label.s3.use_https',
isBoolean: true,
isChecked: true,
isHidden: true
@ -2340,7 +2340,7 @@
}
},
action: function(args) {
action: function(args) {
var $wizard = args.wizard;
var formData = args.data;
var advZoneConfiguredVirtualRouterCount = 0; //for multiple physical networks in advanced zone. Each physical network has 2 virtual routers: regular one and VPC one.
@ -2408,29 +2408,29 @@
url: createURL("createZone" + array1.join("")),
dataType: "json",
async: false,
success: function(json) {
success: function(json) {
if (args.data.pluginFrom == null) { //from zone wizard, not from quick instsaller(args.data.pluginFrom != null && args.data.pluginFrom.name == 'installWizard') who doesn't have public checkbox
if(args.data.zone.isdedicated == 'on'){ //dedicated checkbox in zone wizard is checked
message(dictionary['message.dedicate.zone']);
if(args.data.zone.isdedicated == 'on'){ //dedicated checkbox in zone wizard is checked
message(dictionary['message.dedicate.zone']);
var data = {
zoneid: json.createzoneresponse.zone.id
};
if (args.data.zone.domain != null)
zoneid: json.createzoneresponse.zone.id
};
if (args.data.zone.domain != null)
$.extend(data, {
domainid: args.data.zone.domain
});
if (args.data.zone.account != "")
});
if (args.data.zone.account != "")
$.extend(data, {
account: args.data.zone.account
});
});
$.ajax({
url: createURL('dedicateZone'),
data: data,
success: function(json) {}
});
});
}
}
}
stepFns.addPhysicalNetworks({
data: $.extend(args.data, {
returnedZone: json.createzoneresponse.zone
@ -3664,7 +3664,7 @@
}
});
// ***** VPC Virtual Router ***** (end) *****
} else { //args.data.zone.sgEnabled == true //Advanced SG-enabled zone
} else { //args.data.zone.sgEnabled == true //Advanced SG-enabled zone
message(_l('message.enabling.security.group.provider'));
// get network service provider ID of Security Group
@ -4377,23 +4377,23 @@
if (args.data.cluster.vSwitchGuestType != "")
array1.push('&guestvswitchtype=' + args.data.cluster.vSwitchGuestType);
*/
/*
if (args.data.cluster.vSwitchGuestName != "")
array1.push("&guestvswitchname=" + args.data.cluster.vSwitchGuestName);
*/
if (args.data.cluster.vsmipaddress != null && args.data.cluster.vsmipaddress.length > 0) {
if (args.data.cluster.vsmipaddress != null && args.data.cluster.vsmipaddress.length > 0) {
array1.push('&vsmipaddress=' + args.data.cluster.vsmipaddress);
}
if(args.data.cluster.vsmusername != null && args.data.cluster.vsmusername.length > 0) {
array1.push('&vsmusername=' + args.data.cluster.vsmusername);
}
if(args.data.cluster.vsmpassword != null && args.data.cluster.vsmpassword.length > 0) {
array1.push('&vsmpassword=' + args.data.cluster.vsmpassword);
}
}
var hostname = args.data.cluster.vCenterHost;
var dcName = args.data.cluster.vCenterDatacenter;
@ -4459,7 +4459,7 @@
$.ajax({
url: createURL("addCluster" + array1.join("")),
dataType: "json",
type: "POST",
type: "POST",
success: function(json) {
stepFns.addHost({
data: $.extend(args.data, {
@ -4580,20 +4580,20 @@
//zone-wide-primary-storage is supported only for KVM and VMWare
if (args.data.primaryStorage.scope == "zone") { //hypervisor type of the hosts in zone that will be attached to this storage pool. KVM, VMware supported as of now.
if(args.data.cluster.hypervisor != undefined) {
array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor));
} else if(args.data.returnedCluster.hypervisortype != undefined) {
array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype));
if(args.data.cluster.hypervisor != undefined) {
array1.push("&hypervisor=" + todb(args.data.cluster.hypervisor));
} else if(args.data.returnedCluster.hypervisortype != undefined) {
array1.push("&hypervisor=" + todb(args.data.returnedCluster.hypervisortype));
} else {
cloudStack.dialog.notice({
message: "Error: args.data.cluster.hypervisor is undefined. So is args.data.returnedCluster.hypervisortype (zone-wide-primary-storage)"
});
});
}
}
var server = args.data.primaryStorage.server;
var url = null;
if (args.data.primaryStorage.protocol == "nfs") {
if (args.data.primaryStorage.protocol == "nfs") {
var path = args.data.primaryStorage.path;
if (path.substring(0, 1) != "/")
path = "/" + path;
@ -4606,33 +4606,33 @@
array1.push("&details[0].user=" + args.data.primaryStorage.smbUsername);
array1.push("&details[1].password=" + todb(args.data.primaryStorage.smbPassword));
array1.push("&details[2].domain=" + args.data.primaryStorage.smbDomain);
} else if (args.data.primaryStorage.protocol == "PreSetup") {
} else if (args.data.primaryStorage.protocol == "PreSetup") {
var path = args.data.primaryStorage.path;
if (path.substring(0, 1) != "/")
path = "/" + path;
url = presetupURL(server, path);
} else if (args.data.primaryStorage.protocol == "ocfs2") {
} else if (args.data.primaryStorage.protocol == "ocfs2") {
var path = args.data.primaryStorage.path;
if (path.substring(0, 1) != "/")
path = "/" + path;
url = ocfs2URL(server, path);
} else if (args.data.primaryStorage.protocol == "SharedMountPoint") {
} else if (args.data.primaryStorage.protocol == "SharedMountPoint") {
var path = args.data.primaryStorage.path;
if (path.substring(0, 1) != "/")
path = "/" + path;
url = SharedMountPointURL(server, path);
} else if (args.data.primaryStorage.protocol == "clvm") {
} else if (args.data.primaryStorage.protocol == "clvm") {
var vg = args.data.primaryStorage.volumegroup;
if (vg.substring(0, 1) != "/")
vg = "/" + vg;
url = clvmURL(vg);
} else if (args.data.primaryStorage.protocol == "vmfs") {
} else if (args.data.primaryStorage.protocol == "vmfs") {
var path = args.data.primaryStorage.vCenterDataCenter;
if (path.substring(0, 1) != "/")
path = "/" + path;
path += "/" + args.data.primaryStorage.vCenterDataStore;
url = vmfsURL("dummy", path);
} else {
} else {
var iqn = args.data.primaryStorage.iqn;
if (iqn.substring(0, 1) != "/")
iqn = "/" + iqn;
@ -4668,11 +4668,11 @@
if (args.data.secondaryStorage.provider == '') {
complete({
data: args.data
});
});
return; //skip addSecondaryStorage if provider dropdown is blank
}
message(_l('message.creating.secondary.storage'));
var data = {};
@ -4746,12 +4746,12 @@
});
}
});
} else if (args.data.secondaryStorage.provider == 'S3') {
if($wizard.find('form[rel=secondaryStorage]').find('div[rel=name]').find('input').attr("disabled") == "disabled") { //Name textbox is disabled (and populated with S3 image setore name) when S3 image store exists. In this case, do not call addImageStore to create S3 image store.
} else if (args.data.secondaryStorage.provider == 'S3') {
if($wizard.find('form[rel=secondaryStorage]').find('div[rel=name]').find('input').attr("disabled") == "disabled") { //Name textbox is disabled (and populated with S3 image setore name) when S3 image store exists. In this case, do not call addImageStore to create S3 image store.
complete({
data: args.data
});
} else { //Name textbox is not disabled when S3 image store does not exist. In this case, call addImageStore to create S3 image store.
});
} else { //Name textbox is not disabled when S3 image store does not exist. In this case, call addImageStore to create S3 image store.
$.extend(data, {
provider: args.data.secondaryStorage.provider,
'details[0].key': 'accesskey',
@ -4788,9 +4788,9 @@
$.ajax({
url: createURL('addImageStore'),
data: data,
success: function(json) {
success: function(json) {
g_regionsecondaryenabled = true;
complete({
data: $.extend(args.data, {
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
@ -4804,9 +4804,9 @@
args: args
});
}
});
});
}
//NFS Cache
if ($wizard.find('form[rel=secondaryStorage]').find('div[rel=createNfsCache]').find("input[type=checkbox]").is(':checked') == true) {
var zoneid = args.data.secondaryStorage.nfsCacheZoneid;
@ -4860,14 +4860,14 @@
$.ajax({
url: createURL('addImageStore'),
data: data,
success: function(json) {
success: function(json) {
g_regionsecondaryenabled = true;
complete({
data: $.extend(args.data, {
returnedSecondaryStorage: json.addimagestoreresponse.secondarystorage
})
});
});
},
error: function(XMLHttpResponse) {
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
@ -4878,7 +4878,7 @@
}
});
}
}
}
};
var complete = function(args) {