mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 18:43:26 +01:00
UI: Update IP address server calls to support per-NIC IPs
Update the following actions on IP address section to support per-NIC IP addresses: - List IPs -> listNics - Add IP -> addIpToNic - Remove IP -> removeIpFromNic These API calls will be conditionally invoked in place of the existing calls if a NIC is selected -- i.e., args.context.nics is present
This commit is contained in:
parent
b652d2e4ba
commit
6c8182b6f4
@ -1585,6 +1585,22 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.context.nics) {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('addIpToNic'),
|
||||||
|
data: {
|
||||||
|
nicId: args.context.nics[0].id
|
||||||
|
},
|
||||||
|
success: function(json) {
|
||||||
|
args.response.success({
|
||||||
|
_custom: {
|
||||||
|
jobId: json.addiptonicresponse.jobid
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('associateIpAddress'),
|
url: createURL('associateIpAddress'),
|
||||||
data: dataObj,
|
data: dataObj,
|
||||||
@ -1609,6 +1625,7 @@
|
|||||||
args.response.error(parseXMLHttpResponse(json));
|
args.response.error(parseXMLHttpResponse(json));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
notification: {
|
notification: {
|
||||||
@ -1643,6 +1660,20 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (args.context.nics) {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('listNics'),
|
||||||
|
data: {
|
||||||
|
nicId: args.context.nics[0].id,
|
||||||
|
vmId: args.context.instances[0].id
|
||||||
|
},
|
||||||
|
success: function(json) {
|
||||||
|
args.response.success({
|
||||||
|
data: json.listnicsresponse.nic[0].ipAddresses
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('listPublicIpAddresses'),
|
url: createURL('listPublicIpAddresses'),
|
||||||
data: data,
|
data: data,
|
||||||
@ -1664,6 +1695,7 @@
|
|||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// Detail view
|
// Detail view
|
||||||
@ -2017,6 +2049,19 @@
|
|||||||
remove: {
|
remove: {
|
||||||
label: 'label.action.release.ip',
|
label: 'label.action.release.ip',
|
||||||
action: function(args) {
|
action: function(args) {
|
||||||
|
if (args.context.nics) {
|
||||||
|
$.ajax({
|
||||||
|
url: createURL('removeIpFromNic'),
|
||||||
|
data: {
|
||||||
|
id: args.context.ipAddresses[0].id
|
||||||
|
},
|
||||||
|
success: function(json) {
|
||||||
|
args.response.success({
|
||||||
|
_custom: { jobId: json.removeipfromnicresponse.jobid }
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: createURL('disassociateIpAddress'),
|
url: createURL('disassociateIpAddress'),
|
||||||
data: {
|
data: {
|
||||||
@ -2050,6 +2095,7 @@
|
|||||||
args.response.error(parseXMLHttpResponse(data));
|
args.response.error(parseXMLHttpResponse(data));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
messages: {
|
messages: {
|
||||||
confirm: function(args) {
|
confirm: function(args) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user