mirror of https://github.com/apache/cloudstack.git
bug 12536
Fix enable static NAT to only show instances in network
This commit is contained in:
parent
9c4f009c69
commit
9fcbfc7abc
|
|
@ -219,7 +219,36 @@
|
|||
action: {
|
||||
noAdd: true,
|
||||
custom: cloudStack.uiCustom.enableStaticNAT({
|
||||
listView: cloudStack.sections.instances,
|
||||
listView: $.extend(true, {}, cloudStack.sections.instances, {
|
||||
listView: {
|
||||
dataProvider: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listVirtualMachines'),
|
||||
data: {
|
||||
networkid: args.context.networks[0].id
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
args.response.success({
|
||||
data: $.grep(
|
||||
data.listvirtualmachinesresponse.virtualmachine ?
|
||||
data.listvirtualmachinesresponse.virtualmachine : [],
|
||||
function(instance) {
|
||||
return $.inArray(instance.state, [
|
||||
'Destroyed'
|
||||
]) == -1;
|
||||
}
|
||||
)
|
||||
});
|
||||
},
|
||||
error: function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}),
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('enableStaticNat'),
|
||||
|
|
@ -525,7 +554,36 @@
|
|||
action: {
|
||||
noAdd: true,
|
||||
custom: cloudStack.uiCustom.enableStaticNAT({
|
||||
listView: cloudStack.sections.instances,
|
||||
listView: $.extend(true, {}, cloudStack.sections.instances, {
|
||||
listView: {
|
||||
dataProvider: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('listVirtualMachines'),
|
||||
data: {
|
||||
networkid: args.context.networks[0].id
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
args.response.success({
|
||||
data: $.grep(
|
||||
data.listvirtualmachinesresponse.virtualmachine ?
|
||||
data.listvirtualmachinesresponse.virtualmachine : [],
|
||||
function(instance) {
|
||||
return $.inArray(instance.state, [
|
||||
'Destroyed'
|
||||
]) == -1;
|
||||
}
|
||||
)
|
||||
});
|
||||
},
|
||||
error: function(data) {
|
||||
args.response.error(parseXMLHttpResponse(data));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}),
|
||||
action: function(args) {
|
||||
$.ajax({
|
||||
url: createURL('enableStaticNat'),
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@
|
|||
cloudStack.uiCustom.enableStaticNAT = function(args) {
|
||||
var listView = args.listView;
|
||||
var action = args.action;
|
||||
|
||||
|
||||
return function(args) {
|
||||
var context = args.context;
|
||||
var $instanceRow = args.$instanceRow;
|
||||
|
||||
var vmList = function(args) {
|
||||
// Create a listing of instances, based on limited information
|
||||
// from main instances list view
|
||||
var $listView;
|
||||
var instances = $.extend(true, {}, args.listView, {
|
||||
context: context,
|
||||
uiCustom: true
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue