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

history and timeline for all servers

parent 38368b5a
No related branches found
No related tags found
No related merge requests found
......@@ -74,7 +74,7 @@ class cronlogrenderer extends cronlog{
$sClass='message-ok';
}
$sHtml.='<tr class="'.$sClass.'" onclick="showFile(\''.$aEntry['logfile'].'\');">'
$sHtml.='<tr class="'.$sClass.'" onclick="showFile(\''.$aEntry['logfile'].'\');" title="Klick=['.$aEntry['logfile'].'] anzeigen ">'
. '<td>'.date("Y-m-d H:i:s", $aEntry['SCRIPTSTARTTIME']).'</td>'
// . '<td>'.$aEntry['SCRIPTNAME'].'</td>'
. '<td>'.$aEntry['SCRIPTLABEL'].'</td>'
......@@ -221,6 +221,18 @@ class cronlogrenderer extends cronlog{
$this->_writeCacheData($sTaskId, $sHtml);
return $sHtml;
}
public function renderJoblistOfAllServers(){
$aData=array();
foreach (array_keys($this->getServers()) as $sServer){
$this->setServer($sServer);
$aData=array_merge($aData, $this->getServerJobHistory());
}
$this->setServer('ALL');
// echo '<pre>'.print_r($aData, 1).'</pre>';
return $this->renderJoblist($aData);
}
/**
* get html code for a timeline with events of executed cronjobs
*
......@@ -300,6 +312,18 @@ class cronlogrenderer extends cronlog{
return $sHtml;
}
public function renderJobGraphOfAllServers(){
$aData=array();
foreach (array_keys($this->getServers()) as $sServer){
$this->setServer($sServer);
$aData=array_merge($aData, $this->getServerJobHistory());
}
$this->setServer('ALL');
// echo '<pre>'.print_r($aData, 1).'</pre>';
return $this->renderJobGraph($aData);
}
/**
* show a single log file
*
......@@ -323,7 +347,7 @@ class cronlogrenderer extends cronlog{
if ($fileHandle = fopen($sMyFile, "r")) {
$sHtml.='<div style="float: left;" onclick="showFileBack();"><pre>';
$sHtml.='<div style="float: left;" onclick="showFileBack();" title="Klick=zur&uuml;ck"><pre>';
while (($line = fgets($fileHandle)) !== false) {
# do same stuff with the $line
$bIsComment=strstr($line, 'REM ');
......@@ -347,7 +371,9 @@ class cronlogrenderer extends cronlog{
// remove terminal color
$sValue=preg_replace('/(\[[0-9]{1,3}m)/', '', $sValue);
$sHtml.='<div'.($sDivClass ? ' class="'.$sDivClass.'"' : '').'><span class="log-var">'.$sKey.'</span>=<span class="log-value">'.$sValue.'</span></div>';
$sHtml.='<div'.($sDivClass ? ' class="'.$sDivClass.'"' : '')
// . ' title="'.$sKey.'='.$sValue.'" '
. '><span class="log-var">'.$sKey.'</span>=<span class="log-value">'.$sValue.'</span></div>';
}
}
$sHtml.='</pre></div>';
......
......@@ -21,7 +21,11 @@ if($sServer){
}
switch ($sItem){
case 'crontable':
if($sServer==='ALL'){
$sHtml.=$oCL->renderJoblistOfAllServers();
} else {
$sHtml.=$oCL->renderJoblist();
}
break;
case 'cronlogs':
if($sServer==='ALL'){
......@@ -31,7 +35,11 @@ switch ($sItem){
}
break;
case 'graph':
if($sServer==='ALL'){
$sHtml.=$oCL->renderJobGraphOfAllServers();
} else {
$sHtml.=$oCL->renderJobGraph();
}
break;
case 'selectserver':
$sHtml.=$oCL->renderServerlist($sServer);
......
File moved
......@@ -42,6 +42,10 @@ td{padding:0.3em;}
#crontable,#cronlogs,#graph{display: none;}
#tabcontent div.active{display: block;}
.log-rem{color:#aaa; font-style: italic;}
.log-var{color:#088;}
.log-value{color:#008;}
pre div:hover{background:rgba(0,0,0,0.1);}
/* ----- override datatable defaukts */
.dataTables_wrapper{clear: none;float: left; margin: auto 1px;}
......@@ -50,12 +54,10 @@ table.dataTable{margin: 0; width: auto;}
table.dataTable tbody td{padding: 3px;}
.message{border: 1px solid rgba(0,0,0,0.1); padding: 1em; float: right;}
.message-ok{background:#cfc !important; color:#080 !important;}
.message-error{background:#fee !important; color:#800 !important;}
table.dataTable tbody tr.message-ok, .message-ok{background:#cfc; color:#080 !important;}
table.dataTable tbody tr.message-error, .message-error{background:#fdd; color:#800 !important;}
table.dataTable tbody tr:hover{background:rgba(0,0,0,0.1);}
.log-rem{color:#aaa; font-style: italic;}
.log-var{color:#088;}
.log-value{color:#008;}
/* timeline
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment