Skip to content
Snippets Groups Projects
Commit 896a25f1 authored by hahn's avatar hahn
Browse files

- update appmonitor client class

- simplify filter on top in the project overview
parent b0a32cac
No related branches found
No related tags found
No related merge requests found
......@@ -107,6 +107,7 @@ function updateActionlog(){
sHtml+='</tr>';
}
}
drawTimeline(aData);
if (!sHtml){
sHtml=sMsgNolog; // variable is set in actionlog.class.php
......@@ -123,6 +124,46 @@ function updateActionlog(){
});
}
/**
* render timeline with Visjs
*
* @param {array} aData
* @returns {undefined}
*/
function drawTimeline(aData){
var sDataset='';
var container = document.getElementById('divTimeline');
if(!container){
return false;
}
container.innerHTML=''; // empty the div
if (aData.length && aData[0]["id"]){
for (i=0; i<aData.length; i++){
// keys are
// var aTableitems=["id", "time", "loglevel", "ip", "user", "project", "action", "message"];
sLabel=aData[i]["project"]+'<br>'+aData[i]["action"];
sTitle=aData[i]["time"] + '<br>'+aData[i]["loglevel"]+'<br><br>Projekt: ' + aData[i]["project"] +'<br>User: ' + aData[i]["user"] + ' (' + aData[i]["ip"] +')<br>'+ aData[i]["message"] ;
sDataset+= (sDataset ? ', ': '' )
+ '{"id": '+i+', "content": "'+sLabel+'", "start": "'+aData[i]["time"].replace(/\ /, "T") +'", "title": "'+sTitle+'", "group": "'+aData[i]["project"]+'", "className": "loglevel-'+aData[i]["loglevel"]+'" }';
}
aDataset=JSON.parse('['+sDataset+']');
var items = new vis.DataSet(aDataset);
// Configuration for the Timeline
var options = {
// verticalScroll: false,
clickToUse: true
};
// Create a Timeline
var timeline = new vis.Timeline(container, items, options);
}
}
/**
* filter table with action logs by filtertext (input field)
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment