Skip to content
Snippets Groups Projects
Commit 4d0327df authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add timeline in actionlogs

parent a27af206
No related branches found
No related tags found
1 merge request!62V2.0
......@@ -347,10 +347,10 @@ class Actionlog
<div style="clear: both; margin-bottom: 1em;"></div>
<div id="tableLogactions"></div>
<!--
-->
<script src="/vendor/vis/4.21.0/vis.min.js"></script>
<link href="/vendor/vis/4.21.0/vis.min.css" rel="stylesheet" type="text/css" />
<div id="divTimeline"></div>
-->
</div>
<script>
var sMsgNolog="' . t("class-actionlog-nolog") . '";
......
......@@ -278,7 +278,7 @@ function updateActionlog() {
* @returns {undefined}
*/
function drawTimeline(aData) {
var sDataset = '';
var aDataset = [];
var container = document.getElementById('divTimeline');
if (!container) {
......@@ -292,10 +292,15 @@ function drawTimeline(aData) {
// 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.push({
"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);
......@@ -455,7 +460,7 @@ function filterTable() {
/**
* for project settings - generate api key
* @param {integer} length length of the key to generate
* @return {string}
* @returns {string}
*/
function generateSecret(length) {
......@@ -474,7 +479,8 @@ function generateSecret(length) {
* initialize a shellcmd plugin
* @param {string} sPlugin name of the shellcmd plugin
* @param {function} oRenderer rendering function for incoming data
* @param {integer} iTtl ttl in minutes
* @param {integer} iTtl ttl in seconds
* @returns {boolean}
*/
function shellcmd_plugin_init(sPlugin, oRenderer, iTtl){
var sDomid="divPluginshellcmd"+sPlugin;
......@@ -487,6 +493,9 @@ function shellcmd_plugin_init(sPlugin, oRenderer, iTtl){
"ttl": iTtl,
}
);
// oUbdLoad.render('waiting for first data...');
// oUbd.render('waiting for first data...');
oUbd.update();
return true;
}
// ----------------------------------------------------------------------
......@@ -654,6 +654,7 @@ input[type="checkbox"]:checked+label {
.visualprocess .process .details span {border-right: 3px solid #fff;}
/* ----- replacemets with templates ----- */
span.replace {
background: #fc8;
......@@ -661,13 +662,16 @@ span.replace {
}
/* ----- log table ----- */
div.vis-item{
border: 0px ;
}
.loglevel-info {}
.loglevel-warning {
div.loglevel-warning ,.loglevel-warning {
background: #fea;
}
.loglevel-error {
div.loglevel-error, .loglevel-error{
background: #fcc;
}
......@@ -681,6 +685,15 @@ div.logs {
text-align: left;
}
/* ----- log view : timeline ----- */
div.loglevel-info{
background: #ddd;
}
div.loglevel-success{
background: #8ea;
}
/* ----- valuestore browser ----- */
#tbldata{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment