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
Branches
No related tags found
No related merge requests found
...@@ -74,7 +74,7 @@ class cronlogrenderer extends cronlog{ ...@@ -74,7 +74,7 @@ class cronlogrenderer extends cronlog{
$sClass='message-ok'; $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>'.date("Y-m-d H:i:s", $aEntry['SCRIPTSTARTTIME']).'</td>'
// . '<td>'.$aEntry['SCRIPTNAME'].'</td>' // . '<td>'.$aEntry['SCRIPTNAME'].'</td>'
. '<td>'.$aEntry['SCRIPTLABEL'].'</td>' . '<td>'.$aEntry['SCRIPTLABEL'].'</td>'
...@@ -221,6 +221,18 @@ class cronlogrenderer extends cronlog{ ...@@ -221,6 +221,18 @@ class cronlogrenderer extends cronlog{
$this->_writeCacheData($sTaskId, $sHtml); $this->_writeCacheData($sTaskId, $sHtml);
return $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 * get html code for a timeline with events of executed cronjobs
* *
...@@ -300,6 +312,18 @@ class cronlogrenderer extends cronlog{ ...@@ -300,6 +312,18 @@ class cronlogrenderer extends cronlog{
return $sHtml; 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 * show a single log file
* *
...@@ -323,7 +347,7 @@ class cronlogrenderer extends cronlog{ ...@@ -323,7 +347,7 @@ class cronlogrenderer extends cronlog{
if ($fileHandle = fopen($sMyFile, "r")) { 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) { while (($line = fgets($fileHandle)) !== false) {
# do same stuff with the $line # do same stuff with the $line
$bIsComment=strstr($line, 'REM '); $bIsComment=strstr($line, 'REM ');
...@@ -347,7 +371,9 @@ class cronlogrenderer extends cronlog{ ...@@ -347,7 +371,9 @@ class cronlogrenderer extends cronlog{
// remove terminal color // remove terminal color
$sValue=preg_replace('/(\[[0-9]{1,3}m)/', '', $sValue); $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>'; $sHtml.='</pre></div>';
......
...@@ -21,7 +21,11 @@ if($sServer){ ...@@ -21,7 +21,11 @@ if($sServer){
} }
switch ($sItem){ switch ($sItem){
case 'crontable': case 'crontable':
if($sServer==='ALL'){
$sHtml.=$oCL->renderJoblistOfAllServers();
} else {
$sHtml.=$oCL->renderJoblist(); $sHtml.=$oCL->renderJoblist();
}
break; break;
case 'cronlogs': case 'cronlogs':
if($sServer==='ALL'){ if($sServer==='ALL'){
...@@ -31,7 +35,11 @@ switch ($sItem){ ...@@ -31,7 +35,11 @@ switch ($sItem){
} }
break; break;
case 'graph': case 'graph':
if($sServer==='ALL'){
$sHtml.=$oCL->renderJobGraphOfAllServers();
} else {
$sHtml.=$oCL->renderJobGraph(); $sHtml.=$oCL->renderJobGraph();
}
break; break;
case 'selectserver': case 'selectserver':
$sHtml.=$oCL->renderServerlist($sServer); $sHtml.=$oCL->renderServerlist($sServer);
......
File moved
...@@ -42,6 +42,10 @@ td{padding:0.3em;} ...@@ -42,6 +42,10 @@ td{padding:0.3em;}
#crontable,#cronlogs,#graph{display: none;} #crontable,#cronlogs,#graph{display: none;}
#tabcontent div.active{display: block;} #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 */ /* ----- override datatable defaukts */
.dataTables_wrapper{clear: none;float: left; margin: auto 1px;} .dataTables_wrapper{clear: none;float: left; margin: auto 1px;}
...@@ -50,12 +54,10 @@ table.dataTable{margin: 0; width: auto;} ...@@ -50,12 +54,10 @@ table.dataTable{margin: 0; width: auto;}
table.dataTable tbody td{padding: 3px;} table.dataTable tbody td{padding: 3px;}
.message{border: 1px solid rgba(0,0,0,0.1); padding: 1em; float: right;} .message{border: 1px solid rgba(0,0,0,0.1); padding: 1em; float: right;}
.message-ok{background:#cfc !important; color:#080 !important;} table.dataTable tbody tr.message-ok, .message-ok{background:#cfc; color:#080 !important;}
.message-error{background:#fee !important; color:#800 !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 /* timeline
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment