summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/static/js/projectapp.js
diff options
context:
space:
mode:
authorAlexandru DAMIAN <alexandru.damian@intel.com>2014-10-02 17:58:15 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-11-12 17:04:48 +0000
commit42afeb422ea0a5e226cef586353d194d0339bbd7 (patch)
tree86bc1c6716b6b60bb4f77ebd9fa9d044da0daf7a /bitbake/lib/toaster/toastergui/static/js/projectapp.js
parent46f1fbe3abb3677861178b7008bf5edf73125197 (diff)
downloadpoky-42afeb422ea0a5e226cef586353d194d0339bbd7.tar.gz
bitbake: toastergui: Various fixes for projects, layers and targets page
This is a combined set of fixes for the project, layers and targets pages in the project section of toaster. The fixes correct behaviour and look in various parts of the page, including submitting XHR commands and updating the DOM with the correct info. (Bitbake rev: 96d7738f964784871c928c376cb9fbc9a275cf00) Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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 e674d8ffd1..b347451e88 100644
--- a/bitbake/lib/toaster/toastergui/static/js/projectapp.js
+++ b/bitbake/lib/toaster/toastergui/static/js/projectapp.js
@@ -92,6 +92,24 @@ projectApp.config(function($interpolateProvider) {
92 $interpolateProvider.endSymbol("]}"); 92 $interpolateProvider.endSymbol("]}");
93}); 93});
94 94
95
96// add time interval to HH:mm filter
97projectApp.filter('timediff', function() {
98 return function(input) {
99 function pad(j) {
100 if (parseInt(j) < 10) {return "0" + j}
101 return j;
102 }
103 seconds = parseInt(input);
104 minutes = Math.floor(seconds / 60);
105 seconds = seconds - minutes * 60;
106 hours = Math.floor(seconds / 3600);
107 seconds = seconds - hours * 3600;
108 return pad(hours) + ":" + pad(minutes) + ":" + pad(seconds);
109 }
110});
111
112
95// main controller for the project page 113// main controller for the project page
96projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $location, $cookies, $q, $sce) { 114projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $location, $cookies, $q, $sce) {
97 115
@@ -150,7 +168,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
150 168
151 // identify canceled builds here, so we can display them. 169 // identify canceled builds here, so we can display them.
152 _diffArrays(oldbuilds, $scope.builds, 170 _diffArrays(oldbuilds, $scope.builds,
153 function (e,f) { return e.status == f.status && e.id == f.id }, // compare 171 function (e,f) { return e.id == f.id }, // compare
154 undefined, // added 172 undefined, // added
155 function (e) { // deleted 173 function (e) { // deleted
156 if (e.status == "deleted") return; 174 if (e.status == "deleted") return;
@@ -421,7 +439,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
421 }).then( function () { 439 }).then( function () {
422 $scope.toggle(elementid); 440 $scope.toggle(elementid);
423 if (data['projectVersion'] != undefined) { 441 if (data['projectVersion'] != undefined) {
424 alertText += "<b>" + $scope.release.name + "</b>"; 442 alertText += "<b>" + $scope.project.release.name + "</b>";
425 } 443 }
426 $scope.displayAlert(alertZone, alertText, "alert-info"); 444 $scope.displayAlert(alertZone, alertText, "alert-info");
427 }); 445 });
@@ -506,7 +524,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
506 // init code 524 // init code
507 // 525 //
508 $scope.init = function() { 526 $scope.init = function() {
509 $scope.pollHandle = $interval(function () { $scope._makeXHRCall({method: "POST", url: $scope.urls.xhr_edit, data: undefined});}, 4000, 0); 527 $scope.pollHandle = $interval(function () { $scope._makeXHRCall({method: "GET", url: $scope.urls.xhr_edit, data: undefined});}, 4000, 0);
510 } 528 }
511 529
512 $scope.init(); 530 $scope.init();