From 22df6f6175dc1821b15f920f0ef35d5febfd72cb Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 5 Mar 2014 18:32:30 -0500 Subject: [PATCH] composeui: Add UI to home page, add footer --- composeui/app.js | 2 +- composeui/controllers.js | 28 ++++++++++++++++++++++++++++ composeui/dashboard.css | 4 ---- composeui/index.html | 10 ++++++---- 4 files changed, 35 insertions(+), 9 deletions(-) diff --git a/composeui/app.js b/composeui/app.js index ee618230..b73157d2 100644 --- a/composeui/app.js +++ b/composeui/app.js @@ -10,7 +10,7 @@ $routeProvider. when('/', { templateUrl: 'partials/home.html', - controller: 'rpmostreeRefsCtrl' + controller: 'rpmostreeHomeCtrl' }). when('/repoweb', { templateUrl: 'partials/repoweb-overview.html', diff --git a/composeui/controllers.js b/composeui/controllers.js index 6a888e0e..5269e054 100644 --- a/composeui/controllers.js +++ b/composeui/controllers.js @@ -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 = []; diff --git a/composeui/dashboard.css b/composeui/dashboard.css index 37805f9e..edf285f4 100644 --- a/composeui/dashboard.css +++ b/composeui/dashboard.css @@ -7,10 +7,6 @@ body { padding-top: 50px; } -footer { - padding-top: 20px; -} - /* * Global add-ons */ diff --git a/composeui/index.html b/composeui/index.html index 9db64c65..d11fa22d 100644 --- a/composeui/index.html +++ b/composeui/index.html @@ -35,14 +35,16 @@
+
+
+ This site is maintained in the rpm-ostree git module. +
+ + -
-