network offering page - remove actions from listView since they are already available in detailView.

This commit is contained in:
Jessica Wang 2012-01-30 17:43:51 -08:00
parent 36017cf968
commit f072899583

View File

@ -1378,105 +1378,6 @@
return 'Added network offering';
}
}
},
enable: {
label: 'Enable network offering',
messages: {
confirm: function(args) {
return 'Are you sure you want to enable this network offering?';
},
notification: function(args) {
return 'Enabling network offering';
}
},
action: function(args) {
$.ajax({
url: createURL("updateNetworkOffering&id=" + args.context.networkOfferings[0].id + "&state=Enabled"),
dataType: "json",
async: true,
success: function(json) {
var item = json.updatenetworkofferingresponse.networkoffering;
args.response.success();
},
error: function(data) {
args.response.error(parseXMLHttpResponse(data));
}
});
},
notification: {
poll: function(args) {
args.complete({
data: { state: 'Enabled' }
});
}
}
},
disable: {
label: 'Disable network offering',
messages: {
confirm: function(args) {
return 'Are you sure you want to disable this network offering?';
},
notification: function(args) {
return 'Disabling network offering';
}
},
action: function(args) {
$.ajax({
url: createURL("updateNetworkOffering&id=" + args.context.networkOfferings[0].id + "&state=Disabled"),
dataType: "json",
async: true,
success: function(json) {
var item = json.updatenetworkofferingresponse.networkoffering;
args.response.success();
},
error: function(data) {
args.response.error(parseXMLHttpResponse(data));
}
});
},
notification: {
poll: function(args) {
args.complete({ data: { state: 'Disabled' }});
}
}
},
destroy: {
label: 'Remove network offering',
action: function(args) {
$.ajax({
url: createURL('deleteNetworkOffering'),
data: {
id: args.context.networkOfferings[0].id
},
success: function(json) {
if(args.context.networkOfferings[0].availability == "Required")
requiredNetworkOfferingExists = false; //since only one or zero Required network offering can exist
args.response.success();
},
error: function(data) {
args.response.error(parseXMLHttpResponse(data));
}
});
},
messages: {
confirm: function() { return 'Are you sure you want to remove this network offering?'; },
notification: function() { return 'Remove network offering'; }
},
notification: {
poll: function(args) {
args.complete({
data: {
state: 'Destroyed'
},
actionFilter: networkOfferingActionfilter
});
}
}
}
},