Skip to content

Commit

Permalink
#5 Optimized results dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Westergaard Lassen committed Mar 23, 2013
1 parent c0844f0 commit 4849e8f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/mapred.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1>MapReduce</h1>
<form ng-submit="performMapReduce()" class="form-horizontal">
<form class="form-horizontal">
<div class="control-group">
<label class="control-label" for="buckets">Bucket:</label>
<div class="controls">
Expand Down Expand Up @@ -40,18 +40,19 @@ <h2>Queries</h2>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary">Execute</button>
<a ng-click="performMapReduce()" class="btn btn-primary">Execute <i class="icon-play"></i></a>
</div>
</div>
</form>
<div modal="result" close="close()">
<div modal="showResultDialog" close="close()" options="{dialogFade: true, backdropFade: true}">
<div class="modal-header">
<h4>Map reduce job result</h4>
<h1>Map reduce job result</h1>
</div>
<div class="modal-body">
<p>{{result|json}}</p>
<p ng-hide="result" style="text-align: center"><i class="icon-spinner icon-4x icon-spin"></i></p>
<pre ng-show="result">{{result|json}}</pre>
</div>
<div class="modal-footer">
<button class="btn" ng-click="result=''">Close</button>
<button class="btn" ng-click="showResultDialog=false">Close</button>
</div>
</div>
8 changes: 8 additions & 0 deletions src/ngriakadmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ function MapRedCtrl($scope, $routeParams, $http) {
else if (phase.reduce) {
return phase.reduce;
}
else if (phase.link) {
return phase.link;
}
}
$scope.getPhaseType = function(phase) {
if (phase.map) {
Expand All @@ -144,9 +147,14 @@ function MapRedCtrl($scope, $routeParams, $http) {
else if (phase.reduce) {
return "Reduce";
}
else if (phase.link) {
return "Link";
}
}

$scope.performMapReduce = function() {
$scope.showResultDialog = true;
$scope.result = '';
$http({method: 'POST', data: $scope.job, url:'/mapred'}).success(function(data, status, headers, config) {
$scope.result = data;
})
Expand Down

0 comments on commit 4849e8f

Please sign in to comment.