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

small changes: status column

parent e3d30ff9
No related branches found
No related tags found
No related merge requests found
...@@ -43,7 +43,7 @@ class cronlogrenderer extends cronlog{ ...@@ -43,7 +43,7 @@ class cronlogrenderer extends cronlog{
/** /**
* show date of last data and last access; used in rendering methods to display it on top * show date of last data and last access; used in rendering methods to display it on top
* @param type $iLast timestamp of last log entry * @param integer $iLast unix timestamp of last log entry
* @return string * @return string
*/ */
protected function _renderAccessAndAge($iLast){ protected function _renderAccessAndAge($iLast){
...@@ -97,13 +97,22 @@ class cronlogrenderer extends cronlog{ ...@@ -97,13 +97,22 @@ class cronlogrenderer extends cronlog{
$iNextRunErr=$aEntry['SCRIPTSTARTTIME']+(((int)$aEntry['SCRIPTTTL']+(int)$this->_iExpiredJobsFailAfter)*60); $iNextRunErr=$aEntry['SCRIPTSTARTTIME']+(((int)$aEntry['SCRIPTTTL']+(int)$this->_iExpiredJobsFailAfter)*60);
if($iNextRunErr < date("U")){ if($iNextRunErr < date("U")){
$aErrors[]='outdated since ' . date("Y-m-d H:i", $iNextRunErr) . ' (+'.$this->_iExpiredJobsFailAfter.'min)'; $aErrors[]=[
'Abgelaufen',
'Job wurde nicht mehr gestartet oder kein Sync zum Logserver',
];
} }
if($aEntry['SCRIPTRC']>0){ if($aEntry['SCRIPTRC']>0){
$aErrors[]='exitcode is '.(int)$aEntry['SCRIPTRC'].' (<>0)'; $aErrors[]=[
'Exitcode '.(int)$aEntry['SCRIPTRC'].' (<>0)',
'The command finished with a non error status'
];
} }
if(!$aEntry['SCRIPTLABEL']){ if(!$aEntry['SCRIPTLABEL']){
$aErrors[]='no label?'; $aErrors[]=[
'Kein Label?',
'No label was detected for this job. Check the scheduled cronjob on server.'
];
} }
...@@ -122,6 +131,15 @@ class cronlogrenderer extends cronlog{ ...@@ -122,6 +131,15 @@ class cronlogrenderer extends cronlog{
} }
$sTtlHr=$sTtlHr ? '('.$sTtlHr.')' : ''; $sTtlHr=$sTtlHr ? '('.$sTtlHr.')' : '';
$sColStatus='';
if (count($aErrors)){
foreach($aErrors as $aErr){
$sColStatus.='<li><abbr title="'.$aErr[1].'">FEHLER: '.$aErr[0].'</abbr></li>';
}
$sColStatus='<ul>'.$sColStatus.'</ul>';
} else {
$sColStatus.='OK';
}
// render table of last logfile per cron job // render table of last logfile per cron job
$sHtml.='<tr onclick="showFile(\''.$aEntry['logfile'].'\');" title="Klick=['.$aEntry['logfile'].'] anzeigen ">' $sHtml.='<tr 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>'
...@@ -147,9 +165,9 @@ class cronlogrenderer extends cronlog{ ...@@ -147,9 +165,9 @@ class cronlogrenderer extends cronlog{
? ($iNextRunErr < date("U") ? 'message-error' : 'message-warning') ? ($iNextRunErr < date("U") ? 'message-error' : 'message-warning')
: '' ).'">' : '' ).'">'
. date("Y-m-d H:i", $iNextRun).'</td>' . date("Y-m-d H:i", $iNextRun).'</td>'
. '<td'.(count($aErrors) ? ' class="message-error" title="- '.implode("\n- ", $aErrors).'"' : '' ).'>' . '<td'.(count($aErrors) ? ' class="message-error" title=""' : '' ).'>'
// .(count($aErrors) ? 'FEHLER:<br>*'.implode('<br>*', $aErrors) : 'OK').'</td>' .$sColStatus.'</td>'
.(count($aErrors) ? 'FEHLER' : 'OK').'</td>' // .(count($aErrors) ? 'FEHLER' : 'OK').'</td>'
// . '<td><button onclick="showFile(\''.$aEntry['logfile'].'\');">Ansehen</button></td>' // . '<td><button onclick="showFile(\''.$aEntry['logfile'].'\');">Ansehen</button></td>'
. '</tr>' . '</tr>'
; ;
......
...@@ -71,6 +71,8 @@ table.dataTable tbody tr.message-error, .message-error{background:#fdd; color: ...@@ -71,6 +71,8 @@ table.dataTable tbody tr.message-error, .message-error{background:#fdd; color:
table.dataTable tbody tr.message-warning, .message-warning{background:#fec; color:#876 !important;} table.dataTable tbody tr.message-warning, .message-warning{background:#fec; color:#876 !important;}
table.dataTable tbody tr:hover{background:rgba(0,0,0,0.1);} table.dataTable tbody tr:hover{background:rgba(0,0,0,0.1);}
table.dataTable tbody td ul{margin: 0; padding-left: 0.8em;}
/* timeline /* timeline
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment