summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Coldrick <adam@sotk.co.uk>2015-09-26 18:20:06 +0100
committerAdam Coldrick <adam@sotk.co.uk>2015-09-28 20:24:57 +0100
commitf83d048b53a9c2ec858ee44ddb8a781732dff72d (patch)
tree2acb9115086a593d5d382e36c163e092dd807c8e
parentd4febb6aca849067d4347548e04ad245ab5a32c0 (diff)
downloadciat-ui-f83d048b53a9c2ec858ee44ddb8a781732dff72d.tar.gz
Allow selection
-rw-r--r--index.html16
-rw-r--r--js/main.js8
2 files changed, 17 insertions, 7 deletions
diff --git a/index.html b/index.html
index 1c69906..5c04113 100644
--- a/index.html
+++ b/index.html
@@ -8,19 +8,21 @@
</head>
<body ng-app="ciat">
<h1><em>Baserock</em> <span>|</span> CIAT</h1>
-
- <div class="visualisation" ng-controller="VisualisationController">
+ <div class="container" ng-controller="VisualisationController" ng-click="select()" style="height: 100%">
+ <div class="visualisation">
<div class="box"
- ng-class="{'pass': step.lastBuild.success, 'active': step.data.state == 'building', 'fail': !step.lastBuild.success}"
- ng-repeat="step in steps">
+ ng-class="{'pass': step.lastBuild.success, 'active': step.data.state == 'building', 'fail': step.lastBuild.failed}"
+ ng-repeat="step in steps"
+ ng-click="select(step, $event)">
{{step.name}}
</div>
- <div class="details"
+ <div class="detail"
ng-show="selected">
- <h3>{{step.name}}</h3>
- <em>State:</em> {{step.data.state}}
+ <h3>{{selected.name}}</h3>
+ <em>State:</em> {{selected.data.state}}
</div>
</div>
+ </div>
</body>
</html>
diff --git a/js/main.js b/js/main.js
index 1f366cd..162809e 100644
--- a/js/main.js
+++ b/js/main.js
@@ -48,6 +48,14 @@ app.controller('VisualisationController', function($scope, $http, $q, $interval)
});
}
+ $scope.selected = null;
+ $scope.select = function(step, e) {
+ if (e) {
+ e.stopPropagation();
+ }
+ $scope.selected = step;
+ };
+
function cancelRefresh() {
if (angular.isDefined(autorefresh)) {
$interval.cancel(autorefresh);