mirror of https://github.com/apache/cloudstack.git
ui: create L2, Isolated network - filter offerings for domain
Signed-off-by: Abhishek Kumar <abhishek.kumar@shapeblue.com>
This commit is contained in:
parent
d75a26d38b
commit
9df8d7bc21
|
|
@ -504,12 +504,60 @@
|
|||
});
|
||||
}
|
||||
},
|
||||
domain: {
|
||||
label: 'label.domain',
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
},
|
||||
select: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL("listDomains&listAll=true"),
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
items.push({
|
||||
id: "",
|
||||
description: ""
|
||||
});
|
||||
var domainObjs = json.listdomainsresponse.domain;
|
||||
$(domainObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.path
|
||||
});
|
||||
});
|
||||
items.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
args.$select.change(function() {
|
||||
var $form = $(this).closest('form');
|
||||
if ($(this).val() == "") {
|
||||
$form.find('.form-item[rel=account]').hide();
|
||||
} else {
|
||||
$form.find('.form-item[rel=account]').css('display', 'inline-block');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
networkOfferingId: {
|
||||
label: 'label.network.offering',
|
||||
validation: {
|
||||
required: true
|
||||
},
|
||||
dependsOn: 'zoneId',
|
||||
dependsOn: ['zoneId', 'domain'],
|
||||
docID: 'helpGuestNetworkNetworkOffering',
|
||||
select: function(args) {
|
||||
var data = {
|
||||
|
|
@ -519,6 +567,12 @@
|
|||
state: 'Enabled'
|
||||
};
|
||||
|
||||
if (args.domain != undefined && args.domain != null) {
|
||||
$.extend(data, {
|
||||
domainid: args.domain
|
||||
});
|
||||
}
|
||||
|
||||
if ('vpc' in args.context) { //from VPC section
|
||||
$.extend(data, {
|
||||
forVpc: true
|
||||
|
|
@ -657,54 +711,6 @@
|
|||
networkDomain: {
|
||||
label: 'label.network.domain'
|
||||
},
|
||||
domain: {
|
||||
label: 'label.domain',
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
},
|
||||
select: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL("listDomains&listAll=true"),
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
items.push({
|
||||
id: "",
|
||||
description: ""
|
||||
});
|
||||
var domainObjs = json.listdomainsresponse.domain;
|
||||
$(domainObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.path
|
||||
});
|
||||
});
|
||||
items.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
args.$select.change(function() {
|
||||
var $form = $(this).closest('form');
|
||||
if ($(this).val() == "") {
|
||||
$form.find('.form-item[rel=account]').hide();
|
||||
} else {
|
||||
$form.find('.form-item[rel=account]').css('display', 'inline-block');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
account: {
|
||||
label: 'label.account',
|
||||
validation: {
|
||||
|
|
|
|||
|
|
@ -894,12 +894,60 @@ var addL2GuestNetwork = {
|
|||
});
|
||||
}
|
||||
},
|
||||
domain: {
|
||||
label: 'label.domain',
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
},
|
||||
select: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL("listDomains&listAll=true"),
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
items.push({
|
||||
id: "",
|
||||
description: ""
|
||||
});
|
||||
var domainObjs = json.listdomainsresponse.domain;
|
||||
$(domainObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.path
|
||||
});
|
||||
});
|
||||
items.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
args.$select.change(function() {
|
||||
var $form = $(this).closest('form');
|
||||
if ($(this).val() == "") {
|
||||
$form.find('.form-item[rel=account]').hide();
|
||||
} else {
|
||||
$form.find('.form-item[rel=account]').css('display', 'inline-block');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
networkOfferingId: {
|
||||
label: 'label.network.offering',
|
||||
validation: {
|
||||
required: true
|
||||
},
|
||||
dependsOn: 'zoneId',
|
||||
dependsOn: ['zoneId', 'domain'],
|
||||
docID: 'helpGuestNetworkNetworkOffering',
|
||||
select: function(args) {
|
||||
var data = {
|
||||
|
|
@ -908,6 +956,12 @@ var addL2GuestNetwork = {
|
|||
state: 'Enabled'
|
||||
};
|
||||
|
||||
if (args.domain != undefined && args.domain != null) {
|
||||
$.extend(data, {
|
||||
domainid: args.domain
|
||||
});
|
||||
}
|
||||
|
||||
if ('vpc' in args.context) { //from VPC section
|
||||
$.extend(data, {
|
||||
forVpc: true
|
||||
|
|
@ -988,55 +1042,6 @@ var addL2GuestNetwork = {
|
|||
label: 'label.bypass.vlan.overlap.check',
|
||||
isBoolean: true,
|
||||
isHidden: true
|
||||
},
|
||||
|
||||
domain: {
|
||||
label: 'label.domain',
|
||||
isHidden: function(args) {
|
||||
if (isAdmin() || isDomainAdmin())
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
},
|
||||
select: function(args) {
|
||||
if (isAdmin() || isDomainAdmin()) {
|
||||
$.ajax({
|
||||
url: createURL("listDomains&listAll=true"),
|
||||
success: function(json) {
|
||||
var items = [];
|
||||
items.push({
|
||||
id: "",
|
||||
description: ""
|
||||
});
|
||||
var domainObjs = json.listdomainsresponse.domain;
|
||||
$(domainObjs).each(function() {
|
||||
items.push({
|
||||
id: this.id,
|
||||
description: this.path
|
||||
});
|
||||
});
|
||||
items.sort(function(a, b) {
|
||||
return a.description.localeCompare(b.description);
|
||||
});
|
||||
args.response.success({
|
||||
data: items
|
||||
});
|
||||
}
|
||||
});
|
||||
args.$select.change(function() {
|
||||
var $form = $(this).closest('form');
|
||||
if ($(this).val() == "") {
|
||||
$form.find('.form-item[rel=account]').hide();
|
||||
} else {
|
||||
$form.find('.form-item[rel=account]').css('display', 'inline-block');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
args.response.success({
|
||||
data: null
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
account: {
|
||||
label: 'label.account',
|
||||
|
|
|
|||
Loading…
Reference in New Issue