7e246f4551dcdb13588e83d44fc5ef9397fa0481
[motion.git] / server / api / metric / metric.socket.js
1 var _0x79e9=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x2E\x2F\x6D\x65\x74\x72\x69\x63\x2E\x65\x76\x65\x6E\x74\x73","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x73\x61\x76\x65","\x72\x65\x6D\x6F\x76\x65","\x72\x65\x67\x69\x73\x74\x65\x72","\x6C\x65\x6E\x67\x74\x68","\x6D\x65\x74\x72\x69\x63\x3A","\x6F\x6E","\x64\x69\x73\x63\x6F\x6E\x6E\x65\x63\x74","\x65\x6D\x69\x74","\x6D\x65\x74\x72\x69\x63\x3A\x73\x61\x76\x65","\x6D\x65\x74\x72\x69\x63\x3A\x75\x70\x64\x61\x74\x65","\x6D\x65\x74\x72\x69\x63\x3A\x72\x65\x6D\x6F\x76\x65","\x72\x65\x6D\x6F\x76\x65\x4C\x69\x73\x74\x65\x6E\x65\x72","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x6D\x65\x74\x72\x69\x63","\x69\x64","\x75\x70\x64\x61\x74\x65"];_0x79e9[0];const MetricEvents=require(_0x79e9[1]);const ReportField=require(_0x79e9[3])[_0x79e9[2]];var events=[_0x79e9[4],_0x79e9[5]];exports[_0x79e9[6]]= function(_0x993dx4){for(var _0x993dx5=0,_0x993dx6=events[_0x79e9[7]];_0x993dx5< _0x993dx6;_0x993dx5++){var _0x993dx7=events[_0x993dx5];var _0x993dx8=createListener(_0x79e9[8]+ _0x993dx7,_0x993dx4);MetricEvents[_0x79e9[9]](_0x993dx7,_0x993dx8);_0x993dx4[_0x79e9[9]](_0x79e9[10],removeListener(_0x993dx7,_0x993dx8))}};function createListener(_0x993dx7,_0x993dx4){return function(_0x993dxa){switch(_0x993dx7){case _0x79e9[12]:_0x993dx4[_0x79e9[11]](_0x993dx7,_0x993dxa);break;case _0x79e9[13]:updateFields(_0x993dxa);break;case _0x79e9[14]:_0x993dx4[_0x79e9[11]](_0x993dx7,_0x993dxa);break;default:}}}function removeListener(_0x993dx7,_0x993dx8){return function(){MetricEvents[_0x79e9[15]](_0x993dx7,_0x993dx8)}}function updateFields(_0x993dxa){return ReportField[_0x79e9[20]]({field:_0x993dxa[_0x79e9[18]]},{where:{MetricId:_0x993dxa[_0x79e9[19]]}})[_0x79e9[17]](function(_0x993dxd){console[_0x79e9[16]](_0x993dxd)})}