Merge branch 'ui-add-remove-nics' of https://git-wip-us.apache.org/repos/asf/cloudstack into ui-add-remove-nics

This commit is contained in:
Brian Federle 2013-04-26 12:29:54 -07:00
commit 3b758d176e
3 changed files with 20 additions and 5 deletions

View File

@ -14,6 +14,8 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
label.action.delete.nic=Remove NIC
message.action.delete.nic=Please confirm that want to remove this NIC, which will also remove the associated network from the VM.
label.add.affinity.group=Add new affinity group
message.delete.affinity.group=Please confirm that you would like to remove this affinity group.
label.delete.affinity.group=Delete Affinity Group

View File

@ -25,6 +25,8 @@ under the License.
<% long now = System.currentTimeMillis(); %>
<script language="javascript">
dictionary = {
'label.action.delete.nic': '<fmt:message key="label.action.delete.nic"/>',
'message.action.delete.nic': '<fmt:message key="message.action.delete.nic"/>',
'label.add.affinity.group': '<fmt:message key="label.add.affinity.group"/>',
'message.delete.affinity.group': '<fmt:message key="message.delete.affinity.group"/>',
'label.delete.affinity.group': '<fmt:message key="label.delete.affinity.group"/>',

View File

@ -1492,20 +1492,31 @@
// Remove NIC/Network from VM
destroy: {
label: 'label.action.delete.network',
label: 'label.action.delete.nic',
messages: {
confirm: function(args) {
return 'message.action.delete.network';
return 'message.action.delete.nic';
},
notification: function(args) {
return 'label.action.delete.network';
return 'label.action.delete.nic';
}
},
action: function(args) {
args.response.success();
$.ajax({
url: createURL('removeNicFromVirtualMachine'),
data: {
virtualmachineid: args.context.instances[0].id,
nicid: args.context.nics.id
},
success: function(json) {
args.response.success({
_custom: { jobId: json.removenicfromvirtualmachineresponse.jobid }
})
}
});
},
notification: {
poll: function(args) { args.complete(); }
poll: pollAsyncJobResult
}
}
},