[bitbake-devel] [PATCH 06/12] toaster: Add machine selection notification

Alex DAMIAN alexandru.damian at intel.com
Tue Feb 24 17:20:54 UTC 2015


From: Michael Wood <michael.g.wood at intel.com>

This adds a notification to the project page to notify users of the
change in project configuration.

Signed-off-by: Michael Wood <michael.g.wood at intel.com>
---
 lib/toaster/toastergui/static/css/default.css    | 6 ++++++
 lib/toaster/toastergui/static/js/layerdetails.js | 2 +-
 lib/toaster/toastergui/static/js/machines.js     | 3 +--
 lib/toaster/toastergui/static/js/projectapp.js   | 9 +++++++++
 4 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/toaster/toastergui/static/css/default.css b/lib/toaster/toastergui/static/css/default.css
index f97e6c4..277888b 100644
--- a/lib/toaster/toastergui/static/css/default.css
+++ b/lib/toaster/toastergui/static/css/default.css
@@ -237,4 +237,10 @@ div.add-deps { margin-top: 15px; }
 .animate-repeat.ng-enter.ng-enter-active {
   opacity:1;
 }
+
+ at keyframes machines-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
+ at -webkit-keyframes machines-fade { 0% { background-color: #D9EDF7; } 25% { background-color: #D9EDF7; } 100% { background-color: white; } }
+
+.machines-highlight { -webkit-animation: machines-fade 7s 1; -moz-animation: machines-fade 7s 1; animation: machines-fade 7s 1; }
+
 .tab-pane table { margin-top: 10px; }
diff --git a/lib/toaster/toastergui/static/js/layerdetails.js b/lib/toaster/toastergui/static/js/layerdetails.js
index 2e713d5..22c40d9 100644
--- a/lib/toaster/toastergui/static/js/layerdetails.js
+++ b/lib/toaster/toastergui/static/js/layerdetails.js
@@ -133,7 +133,7 @@ function layerDetailsPageInit (ctx) {
     var data =  { machineName : $(this).data('machine-name') };
     libtoaster.editProject(ctx.xhrEditProjectUrl, ctx.projectId, data,
       function (){
-        window.location.replace(ctx.projectPageUrl);
+        window.location.replace(ctx.projectPageUrl+"#/machineselected");
     }, null);
   });
 
diff --git a/lib/toaster/toastergui/static/js/machines.js b/lib/toaster/toastergui/static/js/machines.js
index ee8c980..973a037 100644
--- a/lib/toaster/toastergui/static/js/machines.js
+++ b/lib/toaster/toastergui/static/js/machines.js
@@ -77,7 +77,6 @@ function machinesPageInit (ctx) {
           show_layer_deps_modal(ctx.projectId, layer, data.list, null, null, true, function () {
             /* Success add deps and layer */
             setLayerInCurrentPrj(btn, data.list);
-            console.log ("TODO SUCCESS");
           });
         }
       }, null);
@@ -87,7 +86,7 @@ function machinesPageInit (ctx) {
     var data =  { machineName : $(this).data('machine-name') };
     libtoaster.editProject(ctx.xhrEditProjectUrl, ctx.projectId, data,
       function (){
-        window.location.replace(ctx.projectPageUrl);
+        window.location.replace(ctx.projectPageUrl+"#/machineselected");
     }, null);
   });
 
diff --git a/lib/toaster/toastergui/static/js/projectapp.js b/lib/toaster/toastergui/static/js/projectapp.js
index 4d00f40..df811fb 100644
--- a/lib/toaster/toastergui/static/js/projectapp.js
+++ b/lib/toaster/toastergui/static/js/projectapp.js
@@ -665,6 +665,15 @@ projectApp.controller('prjCtrl', function($scope, $modal, $http, $interval, $loc
                     "\">select targets</a> you want to build.", "alert-success");
         });
 
+        _cmdExecuteWithParam("/machineselected", function () {
+            $scope.displayAlert($scope.zone2alerts, "You have changed the machine to: <strong>" + $scope.machine.name + "</strong>", "alert-info");
+            var machineDistro = angular.element("#machine-distro");
+
+            angular.element("html, body").animate({ scrollTop: machineDistro.position().top }, 700).promise().done(function() {
+              $animate.addClass(machineDistro, "machines-highlight");
+            });
+        });
+
         _cmdExecuteWithParam("/layerimported", function (layer) {
           var imported = $cookieStore.get("layer-imported-alert");
           var text;
-- 
1.9.1




More information about the bitbake-devel mailing list