mirror of https://github.com/apache/cloudstack.git
UI Plugin API: Implement 'apiCall' helper
Adds a helper method to standardize how plugin writers handle server calls, without having to directly invoke jQuery.ajax. It will correctly sanitize data and ensure all required parameters (e.g., session key data) are passed.
This commit is contained in:
parent
22636d520e
commit
5b8e4b9fd9
|
|
@ -12,6 +12,15 @@
|
|||
};
|
||||
|
||||
var pluginAPI = {
|
||||
apiCall: function(command, args) {
|
||||
$.ajax({
|
||||
url: createURL(command),
|
||||
success: args.success,
|
||||
error: function(json) {
|
||||
args.error(parseXMLHttpResponse(json));
|
||||
}
|
||||
})
|
||||
},
|
||||
addSection: function(section) {
|
||||
cloudStack.sections[section.id] = $.extend(section, {
|
||||
customIcon: 'plugins/' + section.id + '/icon.png'
|
||||
|
|
|
|||
Loading…
Reference in New Issue