mirror of
				https://github.com/mmumshad/ansible-playable.git
				synced 2025-03-09 23:38:54 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
	
		
			1.2 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			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 + '/query',{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;
 |