1
0
Fork 0
mirror of https://github.com/mmumshad/ansible-playable.git synced 2025-02-13 10:32:02 +00:00
ansible-playable/client/app/custom_modules/custom_modules.service.js
Mumshad Mannambeth 70cff75096 - Add fonts
2017-07-07 12:15:12 -04:00

30 lines
1.2 KiB
JavaScript

'use strict';
const angular = require('angular');
/*@ngInject*/
export function customModulesService($http,Projects) {
// AngularJS will instantiate a singleton by calling "new" on this function
var uri = '/api/custom_modules';
this.get = function(successCallback,errorCallback){
$http.post(uri + '/list',{ansibleEngine:Projects.selectedProject.ansibleEngine}).then(successCallback,errorCallback)
};
this.show = function(customModule,successCallback,errorCallback){
$http.post(uri+ '/' + customModule+'/get',{ansibleEngine:Projects.selectedProject.ansibleEngine}).then(successCallback,errorCallback)
};
this.test = function(customModule,module_args,successCallback,errorCallback){
$http.post(uri + '/' + customModule + '/test',{ansibleEngine:Projects.selectedProject.ansibleEngine,moduleArgs:module_args}).then(successCallback,errorCallback)
};
this.save = function(customModule,customModuleCode,successCallback,errorCallback){
$http.post(uri + '/' + customModule,{ansibleEngine:Projects.selectedProject.ansibleEngine,custom_module_code:customModuleCode}).then(successCallback,errorCallback)
}
}
export default angular.module('webAppApp.custom_modules_service', [])
.service('customModules', customModulesService)
.name;