summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/projectapp.js
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/toaster/toastergui/static/js/projectapp.js')
-rw-r--r--bitbake/lib/toaster/toastergui/static/js/projectapp.js24
1 files changed, 21 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/static/js/projectapp.js b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
index bee3c56be2..4d00f40ff1 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
@@ -136,6 +136,16 @@ projectApp.filter('timediff', function() {
136 } 136 }
137}); 137});
138 138
139// add "time to future" eta that computes time from now to a point in the future
140projectApp.filter('toeta', function() {
141 return function(input) {
142 var crtmiliseconds = new Date().getTime();
143 diff = (parseInt(input) - crtmiliseconds ) / 1000;
144 console.log("Debug: future time ", input, "crt time", crtmiliseconds, ":", diff);
145 return diff < 0 ? 300 : diff;
146 }
147});
148
139/** 149/**
140 * main controller for the project page 150 * main controller for the project page
141 */ 151 */
@@ -259,7 +269,14 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
259 var i = 0; 269 var i = 0;
260 for (i = 0 ; i < $scope.builds.length; i ++) { 270 for (i = 0 ; i < $scope.builds.length; i ++) {
261 if ($scope.builds[i].id > elem.id) continue; 271 if ($scope.builds[i].id > elem.id) continue;
262 if ($scope.builds[i].id == elem.id) { found=true; break;} 272 if ($scope.builds[i].id == elem.id) {
273 found=true;
274 // do deep data copy
275 for (var attr in elem) {
276 $scope.builds[i][attr] = elem[attr];
277 }
278 break;
279 }
263 if ($scope.builds[i].id < elem.id) break; 280 if ($scope.builds[i].id < elem.id) break;
264 } 281 }
265 if (!found) { 282 if (!found) {
@@ -272,8 +289,8 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
272 var found = false; 289 var found = false;
273 var i = 0; 290 var i = 0;
274 for (i = 0; i < $scope.builds.length; i ++) { 291 for (i = 0; i < $scope.builds.length; i ++) {
275 if ($scope.builds[i].id > elem.id) continue; 292 if ($scope.builds[i].id > elem.id) continue;
276 if ($scope.builds[i].id == elem.id) { found=true; break;} 293 if ($scope.builds[i].id == elem.id) { found=true; break; }
277 if ($scope.builds[i].id < elem.id) break; 294 if ($scope.builds[i].id < elem.id) break;
278 } 295 }
279 if (!found) { 296 if (!found) {
@@ -281,6 +298,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
281 } 298 }
282 }); 299 });
283 300
301
284 $scope.fetchLayersForTargets(); 302 $scope.fetchLayersForTargets();
285 } 303 }
286 if (_data.targets !== undefined) { 304 if (_data.targets !== undefined) {