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 72 * @returns {void}
73 73 */
74 74 function (res, error) {
  75 + console.log('JobsMgr: getJob', res);
75 76 // TODO Errors processing
76 77 var message, strDate, type
77 78 if (error.status && res.success && res.jobsFinished) {
... ... @@ -187,6 +188,7 @@ Ext.define('amdaDesktop.JobsMgr', {
187 188 // AKKA - use processid to find job
188 189 nodeToMove = jobRootNode.findChild('id', job.id, false)
189 190 nodeToMove.set('status', job.status)
  191 + nodeToMove.set('info', job.info)
190 192  
191 193 // TODO check if really job.status
192 194  
... ...
php/classes/AmdaAction.php
... ... @@ -58,7 +58,6 @@ class AmdaAction
58 58 * $obj = { id: node.id, nodeType: node.nodeType }
59 59 */
60 60 public function getTree($obj) {
61   -
62 61 $node = $obj->node;
63 62  
64 63 $nodeType = $obj->nodeType;
... ... @@ -145,8 +144,6 @@ class AmdaAction
145 144 $id = $child->getAttribute('xml:id');
146 145 $name = $child->getAttribute('name');
147 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 148 $specialNode = false;
152 149 $isParameter = false;
... ... @@ -159,34 +156,6 @@ class AmdaAction
159 156 {
160 157 case 'bkgWorks':
161 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 159 $childrenToReturn[] = [
191 160 'text' => $name,
192 161 'id' => $id,
... ... @@ -195,7 +164,7 @@ class AmdaAction
195 164 'pid' => $child->getAttribute('pid'),
196 165 'status' => $child->getAttribute('status'),
197 166 'jobType' => $child->getAttribute('jobType'),
198   - 'info' => $info
  167 + 'info' => $child->getAttribute('info')
199 168 ];
200 169 break;
201 170  
... ... @@ -209,9 +178,7 @@ class AmdaAction
209 178 $objplot = $objectMgr->getObject($id);
210 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 182 $info = $info.' . '.$objplot->children[$i]->children[$j]->name;
216 183 }
217 184 }
... ... @@ -881,7 +848,7 @@ class AmdaAction
881 848 */
882 849 public function getJobs()
883 850 {
884   - $obj = (object) array();
  851 + $obj = (object) array();
885 852 return $this->executeRequest($obj, FunctionTypeEnumClass::PROCESSRUNNINGINFO);
886 853 }
887 854  
... ... @@ -945,7 +912,6 @@ class AmdaAction
945 912 } catch (Exception $e) {
946 913 return array('success' => false, 'message' => 'Exception detected : '.$e->getMessage());
947 914 }
948   -
949 915 return $res;
950 916 }
951 917  
... ...