[gnome-continuous] Add build status to the overview page



commit 00c8d71902f137728d5d9644c4031da46954dd2b
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Nov 12 12:54:45 2013 -0500

    Add build status to the overview page

 extras/build.gnome.org/app.js             |    2 +-
 extras/build.gnome.org/controllers.js     |   14 ++++++++++++--
 extras/build.gnome.org/partials/home.html |    2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/extras/build.gnome.org/app.js b/extras/build.gnome.org/app.js
index 13d2b00..3ae0488 100644
--- a/extras/build.gnome.org/app.js
+++ b/extras/build.gnome.org/app.js
@@ -16,7 +16,7 @@
             }).
             when('/gnome-continuous', {
                 templateUrl: 'partials/gnome-continuous.html',
-                controller: 'GnomeContinuousCtrl',
+                controller: 'ContinuousTaskViewCtrl',
             }).
             otherwise({
                 redirectTo: '/',
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index e6af3a5..ec70eba 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -10,7 +10,17 @@
             window.location.pathname + 'continuous/buildmaster/' + suffix;
     }
 
-    bgoControllers.controller('GnomeContinuousCtrl', function($scope, $http) {
+    function getContinuousTask($http, taskName) {
+        return $http.get(getUrl('results/tasks/' + taskName + '/' + taskName + '/meta.json'));
+    }
+
+    bgoControllers.controller('ContinuousStatusCtrl', function($scope, $http) {
+        getContinuousTask($http, 'build').success(function(data) {
+            $scope.status = data.success ? 'good' : 'bad';
+        });
+    });
+
+    bgoControllers.controller('ContinuousTaskViewCtrl', function($scope, $http) {
         $scope.getUrl = getUrl;
 
         $http.get(getUrl('autobuilder-status.json')).success(function(status) {
@@ -25,7 +35,7 @@
 
         var tasks = [];
         taskNames.forEach(function(taskName) {
-            $http.get(getUrl('results/tasks/' + taskName + '/' + taskName + 
'/meta.json')).success(function(data) {
+            getContinuousTask($http, taskName).success(function(data) {
                 // Mangle the data a bit so we can render it better
                 data['name'] = taskName;
 
diff --git a/extras/build.gnome.org/partials/home.html b/extras/build.gnome.org/partials/home.html
index fbc2863..b28bf6d 100644
--- a/extras/build.gnome.org/partials/home.html
+++ b/extras/build.gnome.org/partials/home.html
@@ -4,7 +4,7 @@
     <h3>jhbuild (Ubuntu Raring)</h3>
     <p>This builder uses JHBuild on Ubuntu Raring.</p>
   </a>
-  <a class="machine" href="#/gnome-continuous">
+  <a class="machine" ng-controller="ContinuousStatusCtrl" ng-class="status" href="#/gnome-continuous">
     <h3>GNOME-Continuous</h3>
     <p>Custom build system; produces disk images that can be updated from an OSTree repository.</p>
   </a>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]