diff options
author | Alexandru DAMIAN <alexandru.damian@intel.com> | 2014-10-02 17:58:15 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-11-12 17:04:48 +0000 |
commit | 42afeb422ea0a5e226cef586353d194d0339bbd7 (patch) | |
tree | 86bc1c6716b6b60bb4f77ebd9fa9d044da0daf7a /bitbake/lib/toaster/toastergui/static/js | |
parent | 46f1fbe3abb3677861178b7008bf5edf73125197 (diff) | |
download | ast2050-yocto-poky-42afeb422ea0a5e226cef586353d194d0339bbd7.zip ast2050-yocto-poky-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')
-rw-r--r-- | bitbake/lib/toaster/toastergui/static/js/projectapp.js | 24 |
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 e674d8f..b347451 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) { $interpolateProvider.endSymbol("]}"); }); + +// add time interval to HH:mm filter +projectApp.filter('timediff', function() { + return function(input) { + function pad(j) { + if (parseInt(j) < 10) {return "0" + j} + return j; + } + seconds = parseInt(input); + minutes = Math.floor(seconds / 60); + seconds = seconds - minutes * 60; + hours = Math.floor(seconds / 3600); + seconds = seconds - hours * 3600; + return pad(hours) + ":" + pad(minutes) + ":" + pad(seconds); + } +}); + + // main controller for the project page projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $location, $cookies, $q, $sce) { @@ -150,7 +168,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc // identify canceled builds here, so we can display them. _diffArrays(oldbuilds, $scope.builds, - function (e,f) { return e.status == f.status && e.id == f.id }, // compare + function (e,f) { return e.id == f.id }, // compare undefined, // added function (e) { // deleted if (e.status == "deleted") return; @@ -421,7 +439,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc }).then( function () { $scope.toggle(elementid); if (data['projectVersion'] != undefined) { - alertText += "<b>" + $scope.release.name + "</b>"; + alertText += "<b>" + $scope.project.release.name + "</b>"; } $scope.displayAlert(alertZone, alertText, "alert-info"); }); @@ -506,7 +524,7 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc // init code // $scope.init = function() { - $scope.pollHandle = $interval(function () { $scope._makeXHRCall({method: "POST", url: $scope.urls.xhr_edit, data: undefined});}, 4000, 0); + $scope.pollHandle = $interval(function () { $scope._makeXHRCall({method: "GET", url: $scope.urls.xhr_edit, data: undefined});}, 4000, 0); } $scope.init(); |