mirror of
https://github.com/mmumshad/ansible-playable.git
synced 2025-03-09 23:38:54 +00:00
Feature - Integrate System API to view logs in UI
This commit is contained in:
parent
1690470269
commit
bf6c8743c5
15 changed files with 353 additions and 26 deletions
|
@ -15,6 +15,8 @@ import CustomModule from './custom_module.model';
|
|||
var ssh2_exec = require('../../components/ssh/ssh2_exec');
|
||||
var scp2_exec = require('../../components/scp/scp_exec');
|
||||
|
||||
const logger = require('../../components/logger/logger');
|
||||
|
||||
function respondWithResult(res, statusCode) {
|
||||
statusCode = statusCode || 200;
|
||||
return function(entity) {
|
||||
|
@ -88,20 +90,18 @@ export function index(req, res) {
|
|||
ansibleEngine
|
||||
);
|
||||
|
||||
/*return CustomModule.find().exec()
|
||||
.then(respondWithResult(res))
|
||||
.catch(handleError(res));*/
|
||||
}
|
||||
|
||||
// Gets a single CustomModule or a module_template from DB
|
||||
export function show(req, res) {
|
||||
console.log("Show " + req.params.custom_module);
|
||||
var ansibleEngine = req.body.ansibleEngine;
|
||||
|
||||
if(!ansibleEngine.customModules){
|
||||
return res.status(500).send("Custom Modules Folder not defined in Ansible Engine")
|
||||
}
|
||||
|
||||
logger.info('Show custom module ');
|
||||
|
||||
var command = 'cat "' + ansibleEngine.customModules + '"/' + req.params.custom_module;
|
||||
|
||||
// If request is for module template, return module_template from default path
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue