cluedin-widget
Version:
This project contains all the pages needed for browsing entities and searching them. The aim is to replace the CluedIn.Webapp project with this one when all the pages ( including the Admin page ) will be ported to REACT.
23 lines (20 loc) • 629 B
JavaScript
var _car = window._car || {};
_car.allActions = [];
var postAction = function(data) {
var xmlhttp = new XMLHttpRequest(); // new HttpRequest instance
xmlhttp.open("POST", "/stats");
xmlhttp.setRequestHeader("Content-Type", "application/json;charset=UTF-8");
xmlhttp.send(JSON.stringify(data));
};
_car.push = function(action) {
if(action.type && action.userName && action.orgName) {
_car.allActions.push(action);
}
};
setInterval(function(){
if(_car.allActions && _car.allActions.length > 0) {
var allAction = _car.allActions.slice(0);
_car.allActions = [];
postAction(allAction);
}
}, 5000);