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