mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
cloudStack 3.0 new UI - edit guest network - populate only network offerings that are available for this guest network.
This commit is contained in:
parent
a3d8291698
commit
aa9324855e
@ -743,10 +743,12 @@
|
|||||||
var array1 = [];
|
var array1 = [];
|
||||||
array1.push("&name=" + todb(args.data.name));
|
array1.push("&name=" + todb(args.data.name));
|
||||||
array1.push("&displaytext=" + todb(args.data.displaytext));
|
array1.push("&displaytext=" + todb(args.data.displaytext));
|
||||||
array1.push("&networkdomain=" + args.data.networkdomain);
|
array1.push("&networkdomain=" + args.data.networkdomain);
|
||||||
|
|
||||||
//if(selectedGuestNetworkObj.type != "Isolated")
|
//if(selectedGuestNetworkObj.type != "Isolated")
|
||||||
if(args.data.networkofferingid != null)
|
if(args.data.networkofferingid != null)
|
||||||
array1.push("&networkofferingid=" + todb(args.data.networkofferingid)); //???
|
array1.push("&networkofferingid=" + todb(args.data.networkofferingid)); //???
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
url: createURL("updateNetwork&id=" + args.context.networks[0].id + array1.join("")),
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
@ -812,7 +814,7 @@
|
|||||||
tabs: {
|
tabs: {
|
||||||
details: {
|
details: {
|
||||||
title: 'Details',
|
title: 'Details',
|
||||||
preFilter: function(args) { //???
|
preFilter: function(args) {
|
||||||
var hiddenFields = [];
|
var hiddenFields = [];
|
||||||
if(selectedZoneObj.networktype == "Basic") {
|
if(selectedZoneObj.networktype == "Basic") {
|
||||||
hiddenFields.push("account");
|
hiddenFields.push("account");
|
||||||
@ -853,34 +855,20 @@
|
|||||||
networkofferingid: {
|
networkofferingid: {
|
||||||
label: 'Network offering',
|
label: 'Network offering',
|
||||||
isEditable: true,
|
isEditable: true,
|
||||||
select: function(args){
|
select: function(args){
|
||||||
var items = [];
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL("listNetworkOfferings&networkid=" + selectedGuestNetworkObj.id), //???
|
url: createURL("listNetworkOfferings&networkid=" + selectedGuestNetworkObj.id), //???
|
||||||
dataType: "json",
|
dataType: "json",
|
||||||
async: false,
|
async: false,
|
||||||
success: function(json) {
|
success: function(json) {
|
||||||
var networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
|
var networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
|
||||||
|
var items = [];
|
||||||
$(networkOfferingObjs).each(function() {
|
$(networkOfferingObjs).each(function() {
|
||||||
items.push({id: this.id, description: this.displaytext});
|
items.push({id: this.id, description: this.displaytext});
|
||||||
});
|
});
|
||||||
|
args.response.success({data: items});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(items.length == 0) {
|
|
||||||
$.ajax({
|
|
||||||
url: createURL("listNetworkOfferings"),
|
|
||||||
dataType: "json",
|
|
||||||
async: false,
|
|
||||||
success: function(json) {
|
|
||||||
var networkOfferingObjs = json.listnetworkofferingsresponse.networkoffering;
|
|
||||||
$(networkOfferingObjs).each(function() {
|
|
||||||
if(this.id == selectedGuestNetworkObj.networkofferingid)
|
|
||||||
items.push({id: this.id, description: this.displaytext});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
args.response.success({data: items});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user