Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Cronlog-viewer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Cronlog-viewer
Commits
00424e6d
Commit
00424e6d
authored
2 years ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
small changes: status column
parent
e3d30ff9
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
classes/cronlog-renderer.class.php
+25
-7
25 additions, 7 deletions
classes/cronlog-renderer.class.php
main.css
+2
-0
2 additions, 0 deletions
main.css
with
27 additions
and
7 deletions
classes/cronlog-renderer.class.php
+
25
−
7
View file @
00424e6d
...
@@ -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>'
;
;
...
...
This diff is collapsed.
Click to expand it.
main.css
+
2
−
0
View file @
00424e6d
...
@@ -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
*/
*/
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment