Commit 812bc03d01801fd1620e18e6517c50e613484551

Authored by Nathanael Jourdane
1 parent 47b7f2ed

update job info on AMDAIntegration, fix toolip update bug

Showing 2 changed files with 5 additions and 37 deletions   Show diff stats
js/app/controllers/JobsMgr.js
@@ -72,6 +72,7 @@ Ext.define('amdaDesktop.JobsMgr', { @@ -72,6 +72,7 @@ Ext.define('amdaDesktop.JobsMgr', {
72 * @returns {void} 72 * @returns {void}
73 */ 73 */
74 function (res, error) { 74 function (res, error) {
  75 + console.log('JobsMgr: getJob', res);
75 // TODO Errors processing 76 // TODO Errors processing
76 var message, strDate, type 77 var message, strDate, type
77 if (error.status && res.success && res.jobsFinished) { 78 if (error.status && res.success && res.jobsFinished) {
@@ -187,6 +188,7 @@ Ext.define('amdaDesktop.JobsMgr', { @@ -187,6 +188,7 @@ Ext.define('amdaDesktop.JobsMgr', {
187 // AKKA - use processid to find job 188 // AKKA - use processid to find job
188 nodeToMove = jobRootNode.findChild('id', job.id, false) 189 nodeToMove = jobRootNode.findChild('id', job.id, false)
189 nodeToMove.set('status', job.status) 190 nodeToMove.set('status', job.status)
  191 + nodeToMove.set('info', job.info)
190 192
191 // TODO check if really job.status 193 // TODO check if really job.status
192 194
php/classes/AmdaAction.php
@@ -58,7 +58,6 @@ class AmdaAction @@ -58,7 +58,6 @@ class AmdaAction
58 * $obj = { id: node.id, nodeType: node.nodeType } 58 * $obj = { id: node.id, nodeType: node.nodeType }
59 */ 59 */
60 public function getTree($obj) { 60 public function getTree($obj) {
61 -  
62 $node = $obj->node; 61 $node = $obj->node;
63 62
64 $nodeType = $obj->nodeType; 63 $nodeType = $obj->nodeType;
@@ -145,8 +144,6 @@ class AmdaAction @@ -145,8 +144,6 @@ class AmdaAction
145 $id = $child->getAttribute('xml:id'); 144 $id = $child->getAttribute('xml:id');
146 $name = $child->getAttribute('name'); 145 $name = $child->getAttribute('name');
147 $help = $child->getAttribute('att'); 146 $help = $child->getAttribute('att');
148 - if ($child->hasAttribute('dataStart')) $dataStart = $child->getAttribute('dataStart');  
149 - if ($child->hasAttribute('dataStop')) $dataStop = $child->getAttribute('dataStop');  
150 147
151 $specialNode = false; 148 $specialNode = false;
152 $isParameter = false; 149 $isParameter = false;
@@ -159,34 +156,6 @@ class AmdaAction @@ -159,34 +156,6 @@ class AmdaAction
159 { 156 {
160 case 'bkgWorks': 157 case 'bkgWorks':
161 $specialNode = true; 158 $specialNode = true;
162 -  
163 - $status = $child->getAttribute('status');  
164 - $res_dir = USERWORKINGDIR . $child->getAttribute('folder') . '/';  
165 - $fileSize = filesize ( glob($res_dir.'/' . $child->getAttribute('result') . '.*')[0]);  
166 -  
167 - $info = $child->getAttribute('info');  
168 - if($status == 'done') {  
169 - $info .= '<b>Finished at</b>: ' . $child->getAttribute('stop') . '<br/>';  
170 -  
171 - $start = new DateTime($child->getAttribute('start'));  
172 - $stop = new DateTime($child->getAttribute('stop'));  
173 - $interval = $stop->diff($start);  
174 -  
175 -// error_log(date('d-m-Y h:i:s', strtotime($child->getAttribute('stop')) - $child->getAttribute('start'));  
176 - $info .= '<b>Job duration</b>: ' . $interval->format('%Hh %Im %Ss') . '<br/>';  
177 -// error_log(date_parse($child->getAttribute('stop')) - $child->getAttribute('start'));  
178 - if ($fileSize < 1024) {  
179 - $strSize = number_format($fileSize, 2, '.', ' ') . 'b';  
180 - } else if($fileSize < 1024*1024) {  
181 - $strSize = number_format($fileSize/1024, 2, '.', ' ') . 'kb';  
182 - } else if($fileSize < 1024*1024*1024) {  
183 - $strSize = number_format($fileSize/(1024*1024), 2, '.', ' ') . 'mb';  
184 - } else {  
185 - $strSize = number_format($fileSize/(1024*1024*1024), 2, '.', ' ') . 'gb';  
186 - }  
187 - $info .= '<b>File size</b>: ' . $strSize;  
188 - }  
189 -  
190 $childrenToReturn[] = [ 159 $childrenToReturn[] = [
191 'text' => $name, 160 'text' => $name,
192 'id' => $id, 161 'id' => $id,
@@ -195,7 +164,7 @@ class AmdaAction @@ -195,7 +164,7 @@ class AmdaAction
195 'pid' => $child->getAttribute('pid'), 164 'pid' => $child->getAttribute('pid'),
196 'status' => $child->getAttribute('status'), 165 'status' => $child->getAttribute('status'),
197 'jobType' => $child->getAttribute('jobType'), 166 'jobType' => $child->getAttribute('jobType'),
198 - 'info' => $info 167 + 'info' => $child->getAttribute('info')
199 ]; 168 ];
200 break; 169 break;
201 170
@@ -209,9 +178,7 @@ class AmdaAction @@ -209,9 +178,7 @@ class AmdaAction
209 $objplot = $objectMgr->getObject($id); 178 $objplot = $objectMgr->getObject($id);
210 for ($i=0; $i < count($objplot->children); $i++) 179 for ($i=0; $i < count($objplot->children); $i++)
211 { 180 {
212 - for ($j=0; $j < count($objplot->children[$i]->children); $j++)  
213 - {  
214 -// $info = $info.' '.$objplot->children[$i]->children[$j]->name; 181 + for ($j=0; $j < count($objplot->children[$i]->children); $j++) {
215 $info = $info.' . '.$objplot->children[$i]->children[$j]->name; 182 $info = $info.' . '.$objplot->children[$i]->children[$j]->name;
216 } 183 }
217 } 184 }
@@ -881,7 +848,7 @@ class AmdaAction @@ -881,7 +848,7 @@ class AmdaAction
881 */ 848 */
882 public function getJobs() 849 public function getJobs()
883 { 850 {
884 - $obj = (object) array(); 851 + $obj = (object) array();
885 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO); 852 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO);
886 } 853 }
887 854
@@ -945,7 +912,6 @@ class AmdaAction @@ -945,7 +912,6 @@ class AmdaAction
945 } catch (Exception $e) { 912 } catch (Exception $e) {
946 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage()); 913 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage());
947 } 914 }
948 -  
949 return $res; 915 return $res;
950 } 916 }
951 917