Skip to content

Commit

Permalink
Update JobModel.php
Browse files Browse the repository at this point in the history
Add an id to each joblog entry to fix the sorting problem on the details page.
  • Loading branch information
tikoflano committed May 8, 2020
1 parent ed49f36 commit eda19fc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions webui/module/Job/src/Job/Model/JobModel.php
Expand Up @@ -175,6 +175,7 @@ public function getJobLog(&$bsock=null, $id=null)
$cmd = 'list joblog jobid='.$id.'';
$limit = 1000;
$offset = 0;
$id = 1;
$retval = array();
while (true) {
$result = $bsock->send_command($cmd . ' limit=' . $limit . ' offset=' . $offset, 2);
Expand All @@ -190,6 +191,9 @@ public function getJobLog(&$bsock=null, $id=null)
if ( empty($log['result']['joblog']) && $log['result']['meta']['range']['filtered'] === 0 ) {
return $retval;
} else {
foreach($log['result']['joblog'] as &$joblog) {
$joblog["id"] = $id++;
}
$retval = array_merge($retval, $log['result']['joblog']);
}
}
Expand Down

0 comments on commit eda19fc

Please sign in to comment.