composeui: Add UI to home page, add footer

This commit is contained in:
Colin Walters 2014-03-05 18:32:30 -05:00
parent 7f3fa0d60b
commit 22df6f6175
4 changed files with 35 additions and 9 deletions

View File

@ -10,7 +10,7 @@
$routeProvider.
when('/', {
templateUrl: 'partials/home.html',
controller: 'rpmostreeRefsCtrl'
controller: 'rpmostreeHomeCtrl'
}).
when('/repoweb', {
templateUrl: 'partials/repoweb-overview.html',

View File

@ -3,6 +3,34 @@
var rpmostreeControllers = angular.module('rpmostreeControllers', []);
rpmostreeControllers.controller('rpmostreeHomeCtrl', function($scope, $http, $location) {
var builds = [];
$http.get(window.location.pathname + '../autobuilder-status.json').success(function(status) {
var text;
if (status.running.length > 0)
text = 'Running: ' + status.running.join(' ') + '; load=' + status.systemLoad[0];
else
text = 'Idle, awaiting packages';
$scope.runningState = text;
});
var latestSmoketestPath = window.location.pathname + '../results/tasks/smoketest';
var productsBuiltPath = latestSmoketestPath + '/products-built.json';
console.log("Retrieving products-built.json");
$http.get(productsBuiltPath).success(function(data) {
var trees = data['trees'];
for (var ref in trees) {
var treeData = trees[ref];
var refUnix = ref.replace(/\//g, '-');
treeData.refUnix = refUnix;
treeData.screenshotUrl = latestSmoketestPath + '/smoketest/work-' + refUnix + '/screenshot-final.png';
}
$scope.trees = trees;
});
});
rpmostreeControllers.controller('rpmostreeRefsCtrl', function($scope, $http, $location) {
var builds = [];

View File

@ -7,10 +7,6 @@ body {
padding-top: 50px;
}
footer {
padding-top: 20px;
}
/*
* Global add-ons
*/

View File

@ -35,14 +35,16 @@
</div>
<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
<div ng-view class="content"></div>
</div>
</div>
</div>
<hr>
<footer>
This site is maintained in the <a href="https://github.com/cgwalters/rpm-ostree">rpm-ostree</a> git module.
</footer>
</div>
</div>
</div>
<script src="jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>