Built motion from commit 12b39f1.|0.0.105
[motion.git] / server / api / metric / metric.socket.js
1 var _0x949e=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x4D\x65\x74\x72\x69\x63","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x46\x69\x65\x6C\x64","\x72\x65\x67\x69\x73\x74\x65\x72","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x6D\x65\x74\x72\x69\x63\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x6D\x65\x74\x72\x69\x63\x3A\x72\x65\x6D\x6F\x76\x65","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x6D\x65\x74\x72\x69\x63","\x69\x64","\x75\x70\x64\x61\x74\x65"];_0x949e[0];var Metric=require(_0x949e[2])[_0x949e[1]];var ReportField=require(_0x949e[2])[_0x949e[3]];exports[_0x949e[4]]=function(_0xbf88x3){Metric[_0x949e[5]](function(_0xbf88x4){onSave(_0xbf88x3,_0xbf88x4)});Metric[_0x949e[6]](function(_0xbf88x4){updateFields(_0xbf88x4)});Metric[_0x949e[7]](function(_0xbf88x4){onRemove(_0xbf88x3,_0xbf88x4)})};function onSave(_0xbf88x3,_0xbf88x4,_0xbf88x6){_0xbf88x3[_0x949e[9]](_0x949e[8],_0xbf88x4)}function onRemove(_0xbf88x3,_0xbf88x4,_0xbf88x6){_0xbf88x3[_0x949e[9]](_0x949e[10],_0xbf88x4)}function updateFields(_0xbf88x4){return ReportField[_0x949e[15]]({field:_0xbf88x4[_0x949e[13]]},{where:{MetricId:_0xbf88x4[_0x949e[14]]}})[_0x949e[12]](function(_0xbf88x9){console[_0x949e[11]](_0xbf88x9)})}