Add changes to container display

pull/2/head
Michael Crosby 2013-06-08 15:50:42 -09:00
parent 6853a9cefa
commit 353751ea4e
5 changed files with 41 additions and 4 deletions

View File

@ -96,11 +96,20 @@ var ContainerController = (function (_super) {
$scope.remove = function () { $scope.remove = function () {
return _this.remove($scope, $routeParams, Container); return _this.remove($scope, $routeParams, Container);
}; };
$scope.changes = [];
$scope.getChanges = function () {
Container.changes({
id: $routeParams.id
}, function (d) {
$scope.changes = d;
});
};
Container.get({ Container.get({
id: $routeParams.id id: $routeParams.id
}, function (d) { }, function (d) {
$scope.container = d; $scope.container = d;
}); });
$scope.getChanges();
} }
return ContainerController; return ContainerController;
})(ContainerControllerBase); })(ContainerControllerBase);

View File

@ -87,10 +87,19 @@ class ContainerController extends ContainerControllerBase {
$scope.start = () => this.start($scope, $routeParams, Container); $scope.start = () => this.start($scope, $routeParams, Container);
$scope.stop = () => this.stop($scope, $routeParams, Container); $scope.stop = () => this.stop($scope, $routeParams, Container);
$scope.remove = () => this.remove($scope, $routeParams, Container); $scope.remove = () => this.remove($scope, $routeParams, Container);
$scope.changes = [];
$scope.getChanges = () => {
Container.changes({id: $routeParams.id}, (d) => {
$scope.changes = d;
});
};
Container.get({id: $routeParams.id}, (d) => { Container.get({id: $routeParams.id}, (d) => {
$scope.container = d; $scope.container = d;
}); });
$scope.getChanges();
} }
} }

View File

@ -47,8 +47,9 @@ angular.module('dockerui.services', [
changes: { changes: {
method: 'GET', method: 'GET',
params: { params: {
action: 'chagnes' action: 'changes'
} },
isArray: true
}, },
create: { create: {
method: 'POST', method: 'POST',

View File

@ -13,7 +13,7 @@ angular.module('dockerui.services', ['ngResource'])
stop: {method: 'POST', params: {t: 5, action: 'stop'}}, stop: {method: 'POST', params: {t: 5, action: 'stop'}},
restart: {method: 'POST', params: {t: 5, action: 'restart' }}, restart: {method: 'POST', params: {t: 5, action: 'restart' }},
kill :{method: 'POST', params: {action:'kill'}}, kill :{method: 'POST', params: {action:'kill'}},
changes :{method: 'GET', params: {action:'chagnes'}}, changes :{method: 'GET', params: {action:'changes'}, isArray: true},
create :{method: 'POST', params: {action:'create'}}, create :{method: 'POST', params: {action:'create'}},
remove :{method: 'DELETE', params: {v:0}} remove :{method: 'DELETE', params: {v:0}}
}); });

View File

@ -33,10 +33,28 @@
<td>Running:</td> <td>Running:</td>
<td>{{ container.State.Running }}</td> <td>{{ container.State.Running }}</td>
</tr> </tr>
</tbody> </tbody>
</table> </table>
<div class="row-fluid">
<div class="span1">
Changes:
</div>
<div class="span5">
<i class="icon-refresh" style="width:32px;height:32px;" ng-click="getChanges()"></i>
</div>
</div>
<div class="well well-large">
<ul>
<li ng-repeat="change in changes">
<strong>{{ change.Path }}</strong> {{ change.Kind }}
</li>
</ul>
</div>
<hr />
<div class="btn-remove"> <div class="btn-remove">
<button class="btn btn-large btn-block btn-primary btn-danger" ng-click="remove()">Remove Container</button> <button class="btn btn-large btn-block btn-primary btn-danger" ng-click="remove()">Remove Container</button>
</div> </div>