cloudStack 3.0 new UI - zone chart - SRX device - implement Delete action.

This commit is contained in:
Jessica Wang 2011-11-23 15:23:23 -08:00
parent c962af67bc
commit 19f297577e

View File

@ -1691,20 +1691,7 @@
} }
} }
}, },
action: function(args) { action: function(args) {
/*
var zoneObj = args.context.zones[0];
$.ajax({
url: createURL("listPhysicalNetworks&zoneId=" + zoneObj.id),
dataType: "json",
async: false,
success: function(json) {
var items = json.listphysicalnetworksresponse.physicalnetwork;
selectedPhysicalNetworkObj = items[0];
}
});
*/
if(nspMap["srx"]== null) { if(nspMap["srx"]== null) {
$.ajax({ $.ajax({
url: createURL("addNetworkServiceProvider&name=JuniperSRX&physicalnetworkid=" + selectedPhysicalNetworkObj.id), url: createURL("addNetworkServiceProvider&name=JuniperSRX&physicalnetworkid=" + selectedPhysicalNetworkObj.id),
@ -1768,7 +1755,44 @@
}); });
}, },
detailView: { detailView: {
name: 'SRX details', name: 'SRX details',
actions: {
'delete': {
label: 'Delete SRX',
messages: {
confirm: function(args) {
return 'Are you sure you want to delete this SRX?';
},
success: function(args) {
return 'SRX is being deleted.';
},
notification: function(args) {
return 'Deleting SRX';
},
complete: function(args) {
return 'SRX has been deleted.';
}
},
action: function(args) {
$.ajax({
url: createURL("deleteSrcFirewall&fwdeviceid=" + args.context.srxProviders[0].fwdeviceid),
dataType: "json",
async: true,
success: function(json) {
var jid = json.deletesrxfirewallresponse.jobid;
args.response.success(
{_custom:
{jobId: jid}
}
);
}
});
},
notification: {
poll: pollAsyncJobResult
}
}
},
tabs: { tabs: {
details: { details: {
title: 'Details', title: 'Details',