Built motion from commit 7e022ab.|2.0.13
[motion2.git] / server / api / pm2 / pm2.controller.js
index 9aeca3c..a3eb95c 100644 (file)
@@ -1 +1 @@
-var _0x1e7d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x70\x6D\x32","\x70\x6D\x32","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x70\x6D\x32\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x65\x6E\x74\x69\x74\x79\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x65\x72\x72\x6F\x72","\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x65\x6E\x74\x69\x74\x79\x20\x66\x6F\x75\x6E\x64","\x69\x6E\x66\x6F","\x70\x6D\x32\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x64\x65\x62\x75\x67","\x6A\x73\x6F\x6E","\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x69\x6E\x64\x65\x78","\x6C\x69\x73\x74","\x63\x61\x74\x63\x68","\x65\x78\x70\x72\x65\x73\x73","\x6D\x6F\x74\x69\x6F\x6E\x32","\x72\x65\x6A\x65\x63\x74","\x6C\x65\x6E\x67\x74\x68","\x74\x68\x65\x6E","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x75\x70\x64\x61\x74\x65","\x62\x6F\x64\x79","\x72\x65\x73\x74\x61\x72\x74","\x73\x74\x6F\x70","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x73\x74\x61\x74\x75\x73"];_0x1e7d[0];var _=require(_0x1e7d[1]);var pm2=require(_0x1e7d[2]);var logger=require(_0x1e7d[4])(_0x1e7d[3]);function handleEntityNotFound(_0x5190x5,_0x5190x6,_0x5190x7){return function(_0x5190x8){if(!_0x5190x8){logger[_0x1e7d[7]](_0x1e7d[5],_0x5190x7,404,_0x1e7d[6]);_0x5190x5[_0x1e7d[9]](404)[_0x1e7d[8]]();return null};return _0x5190x8}}function respondWithResult(_0x5190x5,_0x5190x6,_0x5190x7){_0x5190x6= _0x5190x6|| 200;return function(_0x5190x8){if(_0x5190x8){logger[_0x1e7d[11]](_0x1e7d[5],_0x5190x7,_0x5190x6,_0x1e7d[10]);logger[_0x1e7d[14]](_0x1e7d[12],_0x5190x7,_0x5190x6,_0x1e7d[10],JSON[_0x1e7d[13]](_0x5190x8));return _0x5190x5[_0x1e7d[9]](_0x5190x6)[_0x1e7d[15]](_0x5190x8)};return null}}function handleError(_0x5190x5,_0x5190x6,_0x5190x7){_0x5190x6= _0x5190x6|| 500;return function(_0x5190xb){logger[_0x1e7d[7]](_0x1e7d[5],_0x5190x7,_0x5190x6,JSON[_0x1e7d[13]](_0x5190xb));delete _0x5190xb[_0x1e7d[16]];_0x5190x5[_0x1e7d[9]](_0x5190x6)[_0x1e7d[17]](_0x5190xb)}}exports[_0x1e7d[18]]= function(_0x5190xc,_0x5190x5){logger[_0x1e7d[11]](_0x1e7d[19]);return pm2[_0x1e7d[19]]()[_0x1e7d[25]](function(_0x5190xd){if(_0x5190xd){logger[_0x1e7d[11]](_0x1e7d[5],_0x1e7d[18],200,_0x1e7d[10]);logger[_0x1e7d[14]](_0x1e7d[12],_0x1e7d[18],200,_0x1e7d[10],JSON[_0x1e7d[13]](_0x5190xd));var _0x5190xe=_[_0x1e7d[23]](_0x5190xd,function(_0x5190xf){return _0x5190xf[_0x1e7d[16]]=== _0x1e7d[21]|| _0x5190xf[_0x1e7d[16]]=== _0x1e7d[22]});return _0x5190x5[_0x1e7d[9]](200)[_0x1e7d[15]]({rows:_0x5190xe,count:_0x5190xe[_0x1e7d[24]]})};return null})[_0x1e7d[20]](handleError(_0x5190x5,null,_0x1e7d[18]))};exports[_0x1e7d[26]]= function(_0x5190xc,_0x5190x5){return pm2[_0x1e7d[29]](_0x5190xc[_0x1e7d[28]][_0x1e7d[27]])[_0x1e7d[25]](function(_0x5190x8){if(_0x5190x8){logger[_0x1e7d[11]](_0x1e7d[5],_0x1e7d[26],200,_0x1e7d[10]);logger[_0x1e7d[14]](_0x1e7d[12],_0x1e7d[26],200,_0x1e7d[10],JSON[_0x1e7d[13]](_0x5190x8));return _0x5190x5[_0x1e7d[9]](200)[_0x1e7d[15]](_0x5190x8)};return null})[_0x1e7d[25]](handleEntityNotFound(_0x5190x5,null,_0x1e7d[26]))[_0x1e7d[20]](handleError(_0x5190x5,null,_0x1e7d[26]))};exports[_0x1e7d[30]]= function(_0x5190xc,_0x5190x5){if(_0x5190xc[_0x1e7d[31]][_0x1e7d[27]]){delete _0x5190xc[_0x1e7d[31]][_0x1e7d[27]]};var _0x5190x10={online:_0x1e7d[32],stopped:_0x1e7d[33]};logger[_0x1e7d[11]](JSON[_0x1e7d[13]](_0x5190xc[_0x1e7d[31]]));logger[_0x1e7d[11]](JSON[_0x1e7d[13]](_0x5190xc[_0x1e7d[28]]));if(_0x5190x10[_0x1e7d[34]](_0x5190xc[_0x1e7d[31]][_0x1e7d[9]])){return pm2[_0x5190x10[_0x5190xc[_0x1e7d[31]][_0x1e7d[9]]]](_0x5190xc[_0x1e7d[28]][_0x1e7d[27]])[_0x1e7d[25]](respondWithResult(_0x5190x5,200,_0x1e7d[30]))[_0x1e7d[20]](handleError(_0x5190x5,null,_0x1e7d[30]))}else {logger[_0x1e7d[7]](_0x1e7d[5],_0x1e7d[30],500,_0x1e7d[6]);return _0x5190x5[_0x1e7d[9]](500)[_0x1e7d[17]]({message:_0x1e7d[35]})}}
\ No newline at end of file
+var _0x526a=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x70\x6D\x32","\x70\x6D\x32","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x6C\x6F\x67\x67\x65\x72","\x70\x6D\x32\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x65\x6E\x74\x69\x74\x79\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x65\x72\x72\x6F\x72","\x65\x6E\x64","\x73\x74\x61\x74\x75\x73","\x65\x6E\x74\x69\x74\x79\x20\x66\x6F\x75\x6E\x64","\x69\x6E\x66\x6F","\x70\x6D\x32\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73\x2C\x20\x25\x73","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x64\x65\x62\x75\x67","\x6A\x73\x6F\x6E","\x6E\x61\x6D\x65","\x73\x65\x6E\x64","\x69\x6E\x64\x65\x78","\x6C\x69\x73\x74","\x63\x61\x74\x63\x68","\x65\x78\x70\x72\x65\x73\x73","\x6D\x6F\x74\x69\x6F\x6E\x32","\x72\x65\x6A\x65\x63\x74","\x6C\x65\x6E\x67\x74\x68","\x74\x68\x65\x6E","\x73\x68\x6F\x77","\x69\x64","\x70\x61\x72\x61\x6D\x73","\x64\x65\x73\x63\x72\x69\x62\x65","\x75\x70\x64\x61\x74\x65","\x62\x6F\x64\x79","\x72\x65\x73\x74\x61\x72\x74","\x73\x74\x6F\x70","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x55\x6E\x6B\x6E\x6F\x77\x6E\x20\x73\x74\x61\x74\x75\x73"];_0x526a[0];var _=require(_0x526a[1]);var pm2=require(_0x526a[2]);var logger=require(_0x526a[4])(_0x526a[3]);function handleEntityNotFound(_0x8ca4x5,_0x8ca4x6,_0x8ca4x7){return function(_0x8ca4x8){if(!_0x8ca4x8){logger[_0x526a[7]](_0x526a[5],_0x8ca4x7,404,_0x526a[6]);_0x8ca4x5[_0x526a[9]](404)[_0x526a[8]]();return null};return _0x8ca4x8}}function respondWithResult(_0x8ca4x5,_0x8ca4x6,_0x8ca4x7){_0x8ca4x6= _0x8ca4x6|| 200;return function(_0x8ca4x8){if(_0x8ca4x8){logger[_0x526a[11]](_0x526a[5],_0x8ca4x7,_0x8ca4x6,_0x526a[10]);logger[_0x526a[14]](_0x526a[12],_0x8ca4x7,_0x8ca4x6,_0x526a[10],JSON[_0x526a[13]](_0x8ca4x8));return _0x8ca4x5[_0x526a[9]](_0x8ca4x6)[_0x526a[15]](_0x8ca4x8)};return null}}function handleError(_0x8ca4x5,_0x8ca4x6,_0x8ca4x7){_0x8ca4x6= _0x8ca4x6|| 500;return function(_0x8ca4xb){logger[_0x526a[7]](_0x526a[5],_0x8ca4x7,_0x8ca4x6,JSON[_0x526a[13]](_0x8ca4xb));delete _0x8ca4xb[_0x526a[16]];_0x8ca4x5[_0x526a[9]](_0x8ca4x6)[_0x526a[17]](_0x8ca4xb)}}exports[_0x526a[18]]= function(_0x8ca4xc,_0x8ca4x5){logger[_0x526a[11]](_0x526a[19]);return pm2[_0x526a[19]]()[_0x526a[25]](function(_0x8ca4xd){if(_0x8ca4xd){logger[_0x526a[11]](_0x526a[5],_0x526a[18],200,_0x526a[10]);logger[_0x526a[14]](_0x526a[12],_0x526a[18],200,_0x526a[10],JSON[_0x526a[13]](_0x8ca4xd));var _0x8ca4xe=_[_0x526a[23]](_0x8ca4xd,function(_0x8ca4xf){return _0x8ca4xf[_0x526a[16]]=== _0x526a[21]|| _0x8ca4xf[_0x526a[16]]=== _0x526a[22]});return _0x8ca4x5[_0x526a[9]](200)[_0x526a[15]]({rows:_0x8ca4xe,count:_0x8ca4xe[_0x526a[24]]})};return null})[_0x526a[20]](handleError(_0x8ca4x5,null,_0x526a[18]))};exports[_0x526a[26]]= function(_0x8ca4xc,_0x8ca4x5){return pm2[_0x526a[29]](_0x8ca4xc[_0x526a[28]][_0x526a[27]])[_0x526a[25]](function(_0x8ca4x8){if(_0x8ca4x8){logger[_0x526a[11]](_0x526a[5],_0x526a[26],200,_0x526a[10]);logger[_0x526a[14]](_0x526a[12],_0x526a[26],200,_0x526a[10],JSON[_0x526a[13]](_0x8ca4x8));return _0x8ca4x5[_0x526a[9]](200)[_0x526a[15]](_0x8ca4x8)};return null})[_0x526a[25]](handleEntityNotFound(_0x8ca4x5,null,_0x526a[26]))[_0x526a[20]](handleError(_0x8ca4x5,null,_0x526a[26]))};exports[_0x526a[30]]= function(_0x8ca4xc,_0x8ca4x5){if(_0x8ca4xc[_0x526a[31]][_0x526a[27]]){delete _0x8ca4xc[_0x526a[31]][_0x526a[27]]};var _0x8ca4x10={online:_0x526a[32],stopped:_0x526a[33]};logger[_0x526a[11]](JSON[_0x526a[13]](_0x8ca4xc[_0x526a[31]]));logger[_0x526a[11]](JSON[_0x526a[13]](_0x8ca4xc[_0x526a[28]]));if(_0x8ca4x10[_0x526a[34]](_0x8ca4xc[_0x526a[31]][_0x526a[9]])){return pm2[_0x8ca4x10[_0x8ca4xc[_0x526a[31]][_0x526a[9]]]](_0x8ca4xc[_0x526a[28]][_0x526a[27]])[_0x526a[25]](respondWithResult(_0x8ca4x5,200,_0x526a[30]))[_0x526a[20]](handleError(_0x8ca4x5,null,_0x526a[30]))}else {logger[_0x526a[7]](_0x526a[5],_0x526a[30],500,_0x526a[6]);return _0x8ca4x5[_0x526a[9]](500)[_0x526a[17]]({message:_0x526a[35]})}}
\ No newline at end of file