Built motion from commit f623a78c.|2.6.31
[motion2.git] / server / api / system / system.controller.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x251b=['params','then','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','SIGINT','status','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','../../config/logger','api','bluebird','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','json','catch','killProcess','components/import/cm','format'];(function(_0x350182,_0x2a9feb){var _0x4a0892=function(_0x2c994d){while(--_0x2c994d){_0x350182['push'](_0x350182['shift']());}};_0x4a0892(++_0x2a9feb);}(_0x251b,0x1af));var _0xb251=function(_0x4e6eb2,_0x16a451){_0x4e6eb2=_0x4e6eb2-0x0;var _0x4e0c1c=_0x251b[_0x4e6eb2];return _0x4e0c1c;};'use strict';var info=require(_0xb251('0x0'));var exec=require(_0xb251('0x1'))['exec'];var logger=require(_0xb251('0x2'))(_0xb251('0x3'));var util=require('util');var BPromise=require(_0xb251('0x4'));var _=require(_0xb251('0x5'));function handleError(_0x3feeb5,_0x4aff4b,_0x2c7f4d){_0x4aff4b=_0x4aff4b||0x1f4;return function(_0x57cedd){logger['error'](_0xb251('0x6'),_0x2c7f4d,_0x4aff4b,util[_0xb251('0x7')](_0x57cedd,{'showHidden':![],'depth':null}));delete _0x57cedd[_0xb251('0x8')];_0x3feeb5['status'](_0x4aff4b)[_0xb251('0x9')](_0x57cedd);};}exports[_0xb251('0xa')]=function(_0x2b522d,_0x3138db){return info[_0xb251('0xb')]()['then'](function(_0x3838c9){return _0x3138db['status'](0xc8)[_0xb251('0xc')](_0x3838c9);})[_0xb251('0xd')](function(_0x3eda94){return _0x3138db['status'](0x1f4)['json'](_0x3eda94);});};exports[_0xb251('0xe')]=function(_0x1ae7e3,_0x33c4b9){var _0x571ee1=[_0xb251('0xf')];return new BPromise(function(_0x45ad8f,_0x16d0fa){return exec(util[_0xb251('0x10')]('ps\x20-p\x20%s\x20-ww\x20-o\x20args',_0x1ae7e3[_0xb251('0x11')]['pid']),function(_0x1a1a75,_0x3d4751,_0x24ac47){if(_0x1a1a75){return _0x16d0fa(_0x1a1a75);}return _0x45ad8f(_0x3d4751);});})[_0xb251('0x12')](function(_0x5ac88f){var _0x5ae96c=![];var _0x12e1e9=_0x5ac88f[_0xb251('0x13')](/\n/);for(var _0x3367cc=0x0,_0x5a154d=_0x571ee1[_0xb251('0x14')];_0x3367cc<_0x5a154d,_0x5ae96c===![];_0x3367cc+=0x1){if(_0x5ac88f[_0xb251('0x15')](_0x571ee1[_0x3367cc])>=0x0){_0x5ae96c=!![];}}if(!_0x5ae96c){throw new Error(util[_0xb251('0x10')](_0xb251('0x16'),_0x1ae7e3[_0xb251('0x11')][_0xb251('0x17')]));}process[_0xb251('0x18')](_0x1ae7e3['params'][_0xb251('0x17')],_0xb251('0x19'));return _0x33c4b9[_0xb251('0x1a')](0xc8)[_0xb251('0xc')]({'message':util[_0xb251('0x10')](_0xb251('0x1b'),_0x1ae7e3[_0xb251('0x11')][_0xb251('0x17')])});})['catch'](handleError(_0x33c4b9,null,_0xb251('0xe')));};