mirror of https://github.com/portainer/portainer
Merge pull request #37 from nazar-pc/master
Added possibility to specify name at container creationpull/2/head
commit
e3eb617be4
|
@ -395,6 +395,7 @@ function ImageController($scope, $q, $routeParams, $location, Image, Container,
|
|||
function StartContainerController($scope, $routeParams, $location, Container, Messages) {
|
||||
$scope.template = 'partials/startcontainer.html';
|
||||
$scope.config = {
|
||||
name: '',
|
||||
memory: 0,
|
||||
memorySwap: 0,
|
||||
env: '',
|
||||
|
@ -415,6 +416,7 @@ function StartContainerController($scope, $routeParams, $location, Container, Me
|
|||
|
||||
Container.create({
|
||||
Image: id,
|
||||
name: $scope.config.name,
|
||||
Memory: $scope.config.memory,
|
||||
MemorySwap: $scope.config.memorySwap,
|
||||
Cmd: cmds,
|
||||
|
|
|
@ -4,7 +4,9 @@ angular.module('dockerui.services', ['ngResource'])
|
|||
.factory('Container', function($resource, Settings) {
|
||||
// Resource for interacting with the docker containers
|
||||
// http://docs.docker.io/en/latest/api/docker_remote_api.html#containers
|
||||
return $resource(Settings.url + '/containers/:id/:action', {}, {
|
||||
return $resource(Settings.url + '/containers/:id/:action', {
|
||||
name: '@name'
|
||||
}, {
|
||||
query: {method: 'GET', params:{ all: 0, action: 'json'}, isArray: true},
|
||||
get :{method: 'GET', params: { action:'json'}},
|
||||
start: {method: 'POST', params: {id: '@id', action: 'start'}},
|
||||
|
|
|
@ -11,6 +11,10 @@
|
|||
<label>Cmd:</label>
|
||||
<input type="text" placeholder="{{ commandPlaceholder }}" ng-model="config.commands"/>
|
||||
<small>Input commands as an array</small>
|
||||
|
||||
<label>Name:</label>
|
||||
<input type="text" ng-model="config.name"/>
|
||||
|
||||
<label>Memory:</label>
|
||||
<input type="number" ng-model="config.memory"/>
|
||||
|
||||
|
|
Loading…
Reference in New Issue