From 812bc03d01801fd1620e18e6517c50e613484551 Mon Sep 17 00:00:00 2001 From: Nathanaƫl Jourdane Date: Tue, 13 Mar 2018 18:08:45 +0100 Subject: [PATCH] update job info on AMDAIntegration, fix toolip update bug --- js/app/controllers/JobsMgr.js | 2 ++ php/classes/AmdaAction.php | 40 +++------------------------------------- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/js/app/controllers/JobsMgr.js b/js/app/controllers/JobsMgr.js index 4091401..7098898 100644 --- a/js/app/controllers/JobsMgr.js +++ b/js/app/controllers/JobsMgr.js @@ -72,6 +72,7 @@ Ext.define('amdaDesktop.JobsMgr', { * @returns {void} */ function (res, error) { + console.log('JobsMgr: getJob', res); // TODO Errors processing var message, strDate, type if (error.status && res.success && res.jobsFinished) { @@ -187,6 +188,7 @@ Ext.define('amdaDesktop.JobsMgr', { // AKKA - use processid to find job nodeToMove = jobRootNode.findChild('id', job.id, false) nodeToMove.set('status', job.status) + nodeToMove.set('info', job.info) // TODO check if really job.status diff --git a/php/classes/AmdaAction.php b/php/classes/AmdaAction.php index 1fa4ed1..74a3b69 100644 --- a/php/classes/AmdaAction.php +++ b/php/classes/AmdaAction.php @@ -58,7 +58,6 @@ class AmdaAction * $obj = { id: node.id, nodeType: node.nodeType } */ public function getTree($obj) { - $node = $obj->node; $nodeType = $obj->nodeType; @@ -145,8 +144,6 @@ class AmdaAction $id = $child->getAttribute('xml:id'); $name = $child->getAttribute('name'); $help = $child->getAttribute('att'); - if ($child->hasAttribute('dataStart')) $dataStart = $child->getAttribute('dataStart'); - if ($child->hasAttribute('dataStop')) $dataStop = $child->getAttribute('dataStop'); $specialNode = false; $isParameter = false; @@ -159,34 +156,6 @@ class AmdaAction { case 'bkgWorks': $specialNode = true; - - $status = $child->getAttribute('status'); - $res_dir = USERWORKINGDIR . $child->getAttribute('folder') . '/'; - $fileSize = filesize ( glob($res_dir.'/' . $child->getAttribute('result') . '.*')[0]); - - $info = $child->getAttribute('info'); - if($status == 'done') { - $info .= 'Finished at: ' . $child->getAttribute('stop') . '
'; - - $start = new DateTime($child->getAttribute('start')); - $stop = new DateTime($child->getAttribute('stop')); - $interval = $stop->diff($start); - -// error_log(date('d-m-Y h:i:s', strtotime($child->getAttribute('stop')) - $child->getAttribute('start')); - $info .= 'Job duration: ' . $interval->format('%Hh %Im %Ss') . '
'; -// error_log(date_parse($child->getAttribute('stop')) - $child->getAttribute('start')); - if ($fileSize < 1024) { - $strSize = number_format($fileSize, 2, '.', ' ') . 'b'; - } else if($fileSize < 1024*1024) { - $strSize = number_format($fileSize/1024, 2, '.', ' ') . 'kb'; - } else if($fileSize < 1024*1024*1024) { - $strSize = number_format($fileSize/(1024*1024), 2, '.', ' ') . 'mb'; - } else { - $strSize = number_format($fileSize/(1024*1024*1024), 2, '.', ' ') . 'gb'; - } - $info .= 'File size: ' . $strSize; - } - $childrenToReturn[] = [ 'text' => $name, 'id' => $id, @@ -195,7 +164,7 @@ class AmdaAction 'pid' => $child->getAttribute('pid'), 'status' => $child->getAttribute('status'), 'jobType' => $child->getAttribute('jobType'), - 'info' => $info + 'info' => $child->getAttribute('info') ]; break; @@ -209,9 +178,7 @@ class AmdaAction $objplot = $objectMgr->getObject($id); for ($i=0; $i < count($objplot->children); $i++) { - for ($j=0; $j < count($objplot->children[$i]->children); $j++) - { -// $info = $info.' '.$objplot->children[$i]->children[$j]->name; + for ($j=0; $j < count($objplot->children[$i]->children); $j++) { $info = $info.' . '.$objplot->children[$i]->children[$j]->name; } } @@ -881,7 +848,7 @@ class AmdaAction */ public function getJobs() { - $obj = (object) array(); + $obj = (object) array(); return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); } @@ -945,7 +912,6 @@ class AmdaAction } catch (Exception $e) { return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage()); } - return $res; } -- libgit2 0.21.2