From 42afeb422ea0a5e226cef586353d194d0339bbd7 Mon Sep 17 00:00:00 2001 From: Alexandru DAMIAN Date: Thu, 2 Oct 2014 17:58:15 +0100 Subject: 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 Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/static/js/projectapp.js | 24 +++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/static/js/projectapp.js') 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) { $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 += "" + $scope.release.name + ""; + alertText += "" + $scope.project.release.name + ""; } $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(); -- cgit v1.2.3-54-g00ecf