Skip to content

Commit

Permalink
Change bucket properties. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Westergaard Lassen committed Feb 11, 2013
1 parent 0fe05a1 commit 65659e7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/bucket.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1>{{bucketName}}</h1>
<h2>Properties</h2>
<p>Leave r, w and dw empty for quorum</p>
<form class="form-horizontal">
<form class="form-horizontal" ng-submit="saveProps()">
<div class="control-group">
<label class="control-label" for="nVal">n:</label>
<div class="controls">
Expand Down Expand Up @@ -56,6 +56,12 @@ <h2>Properties</h2>
</label>
</div>
</div>
<div class="control-group">
<div class="form-actions">
<input type="submit" class="btn btn-primary" value="Save"/>
<button type="reset" class="btn">Reset</button>
</div>
</div>
</form>

<h2>Keys</h2>
Expand Down
8 changes: 8 additions & 0 deletions src/ngriakadmin.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ function BucketsCtrl($scope, $http) {
}

function BucketCtrl($scope, $routeParams, $http) {
$scope.bucketName = $routeParams.bucket
$http({method: 'GET', url: '/buckets/' + $routeParams.bucket + "/props"}).
success(function(data, status, headers, config) {
$scope.props = data.props;
Expand All @@ -43,4 +44,11 @@ function BucketCtrl($scope, $routeParams, $http) {
success(function(data, status, headers, config) {
$scope.keys = data.keys;
});

$scope.saveProps = function() {
$http({method: 'PUT', url: '/buckets/' + $scope.bucketName + '/props', data: {props: $scope.props} }).
success(function(data, status, headers, config) {
console.log('status: ' + status);
});
};
}

0 comments on commit 65659e7

Please sign in to comment.