Commit 3945ae763a786ad60d71aab1bf9868fd740756cb
1 parent
efe25e99
Exists in
master
and in
64 other branches
Add error code on tooltip
Showing
1 changed file
with
8 additions
and
4 deletions
Show diff stats
src/InputOutput/IHMImpl/Tools/IHMJobsManagerClass.php
@@ -461,6 +461,10 @@ class IHMJobsManagerClass { | @@ -461,6 +461,10 @@ class IHMJobsManagerClass { | ||
461 | { | 461 | { |
462 | $job->setAttribute('stop', date('d-m-Y H:i:s', time())); | 462 | $job->setAttribute('stop', date('d-m-Y H:i:s', time())); |
463 | 463 | ||
464 | + $start = new DateTime($job->getAttribute('start')); | ||
465 | + $interval = (new DateTime('now'))->diff($start); | ||
466 | + $infos['Job duration'] = $interval->format('%Hh %Im %Ss'); | ||
467 | + | ||
464 | $res_dir = USERWORKINGDIR . $job->getAttribute('folder') . '/'; | 468 | $res_dir = USERWORKINGDIR . $job->getAttribute('folder') . '/'; |
465 | $fileSize = filesize ( glob($res_dir.'/' . $job->getAttribute('result') . '.*')[0]); | 469 | $fileSize = filesize ( glob($res_dir.'/' . $job->getAttribute('result') . '.*')[0]); |
466 | if ($fileSize < 1024) { | 470 | if ($fileSize < 1024) { |
@@ -474,13 +478,13 @@ class IHMJobsManagerClass { | @@ -474,13 +478,13 @@ class IHMJobsManagerClass { | ||
474 | } | 478 | } |
475 | $infos['File size'] = $strSize; | 479 | $infos['File size'] = $strSize; |
476 | 480 | ||
477 | - $start = new DateTime($job->getAttribute('start')); | ||
478 | - $interval = (new DateTime('now'))->diff($start); | ||
479 | - $infos['Job duration'] = $interval->format('%Hh %Im %Ss'); | ||
480 | - | ||
481 | $this->jobXml->getElementById($this->resRootNode[$job->getAttribute('jobType')])->appendChild($job); | 481 | $this->jobXml->getElementById($this->resRootNode[$job->getAttribute('jobType')])->appendChild($job); |
482 | } | 482 | } |
483 | 483 | ||
484 | + if($exitcode != 0) { | ||
485 | + $infos['Error code'] = $exitcode; | ||
486 | + } | ||
487 | + | ||
484 | $strInfo = $job->getAttribute('info'); | 488 | $strInfo = $job->getAttribute('info'); |
485 | foreach ($infos as $key => $info) { | 489 | foreach ($infos as $key => $info) { |
486 | $strInfo .= '<b>' . $key . '</b>: ' . $info . '<br/>'; | 490 | $strInfo .= '<b>' . $key . '</b>: ' . $info . '<br/>'; |