[gnome-continuous] b.g.o: Add "log" page which shows bdiffs



commit cec3e96b4de470156e2da2b9ec876d17ff35e840
Author: Colin Walters <walters verbum org>
Date:   Sun Dec 29 12:41:48 2013 -0500

    b.g.o: Add "log" page which shows bdiffs

 extras/build.gnome.org/app.js                      |    4 +++
 extras/build.gnome.org/controllers.js              |   27 ++++++++++++++++++++
 .../partials/gnome-continuous-log.html             |   22 ++++++++++++++++
 3 files changed, 53 insertions(+), 0 deletions(-)
---
diff --git a/extras/build.gnome.org/app.js b/extras/build.gnome.org/app.js
index 3c07e10..945936e 100644
--- a/extras/build.gnome.org/app.js
+++ b/extras/build.gnome.org/app.js
@@ -22,6 +22,10 @@
                 templateUrl: 'partials/gnome-continuous-build.html',
                 controller: 'ContinuousBuildViewCtrl',
             }).
+            when('/gnome-continuous/log/:year/:month/:day', {
+                templateUrl: 'partials/gnome-continuous-log.html',
+                controller: 'ContinuousLogCtrl',
+            }).
             otherwise({
                 redirectTo: '/',
             });
diff --git a/extras/build.gnome.org/controllers.js b/extras/build.gnome.org/controllers.js
index 7d4d8e8..b0e0526 100644
--- a/extras/build.gnome.org/controllers.js
+++ b/extras/build.gnome.org/controllers.js
@@ -154,4 +154,31 @@
        });
     });
 
+    bgoControllers.controller('ContinuousLogCtrl', function($scope, $http, $routeParams) {
+        var year = $routeParams.year;
+        var month = $routeParams.month;
+        var day = $routeParams.day;
+       var dayBaseUrl = ROOT + 'builds/' + year + '/' + month + '/' + day + '/';
+       var indexPath =  dayBaseUrl + 'index.json';
+       var snapshots = [];
+       $scope.snapshots = snapshots;
+       $scope.commitLimit = 10;
+        $http.get(indexPath).success(function(data) {
+           if (data.length == 0)
+               return;
+           var children = data['subdirs'];
+           children.sort(function(a,b) { return parseInt(a) - parseInt(b) });
+           for (var i = 0; i < children.length; i++) {
+               var baseHref = dayBaseUrl + children[i];
+               var version = relpathToVersion('builds/' + year + '/' + month + '/' + day + '/' + 
children[i]);
+               snapshots[i] = {'version': version,
+                               'href': baseHref,
+                               'bdiff': null};
+               $http.get(baseHref + '/bdiff.json').success(function(data) {
+                   this.snapshots[this.i]['bdiff'] = data;
+               }.bind({'snapshots': snapshots, 'i': i}));
+           }
+       });
+    });
+
 })(window);
diff --git a/extras/build.gnome.org/partials/gnome-continuous-log.html 
b/extras/build.gnome.org/partials/gnome-continuous-log.html
new file mode 100644
index 0000000..9daecd0
--- /dev/null
+++ b/extras/build.gnome.org/partials/gnome-continuous-log.html
@@ -0,0 +1,22 @@
+<article>
+  <h1>GNOME-Continuous (resolve log)</h1>
+  <p>This page shows all the resolved snapshots for a particular day.</p>
+
+  <div ng-repeat="snapshot in snapshots">
+    <a href="{{ snapshot.href }}">Build {{ snapshot.version }}</a>:
+    <span ng-if="snapshot.bdiff != null">
+      <div ng-repeat="modified in snapshot.bdiff.modified">
+       <span ng-init="expand=false" ng-click="expand=!expand">{{ modified.previous.name }}: {{ 
modified.gitlog.length }} commits <span style="text-decoration: underline"><span 
ng-show="expand">[Hide]</span><span ng-show="!expand">[Show]</span></span>
+       <span ng-show="expand">
+         <pre>{{ modified.diffstat }}</pre>
+         <div ng-repeat="commit in modified.gitlog | limitTo:commitLimit">
+           <span>{{ commit.From }} : {{ commit.Subject }}</span>
+         </div>
+         <div ng-if="modified.gitlog.length > commitLimit">... {{ commitLimit - modified.gitlog.length }} 
more</div>
+       </span>
+      </div>
+    </span>
+    <span ng-if="snapshot.bdiff == null">(No bdiff generated)</span>
+    <br>
+  </div>
+</article>


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