mirror of https://github.com/portainer/portainer
Added possibility to specify name at container creation
parent
5075995129
commit
29df9cf226
|
@ -214,13 +214,13 @@ function ContainerController($scope, $routeParams, $location, Container, Message
|
||||||
// Controller for the list of containers
|
// Controller for the list of containers
|
||||||
function ContainersController($scope, Container, Settings, Messages, ViewSpinner) {
|
function ContainersController($scope, Container, Settings, Messages, ViewSpinner) {
|
||||||
$scope.predicate = '-Created';
|
$scope.predicate = '-Created';
|
||||||
$scope.toggle = false;
|
$scope.toggle = false;
|
||||||
$scope.displayAll = Settings.displayAll;
|
$scope.displayAll = Settings.displayAll;
|
||||||
|
|
||||||
var update = function(data) {
|
var update = function(data) {
|
||||||
ViewSpinner.spin();
|
ViewSpinner.spin();
|
||||||
Container.query(data, function(d) {
|
Container.query(data, function(d) {
|
||||||
$scope.containers = d.map(function(item) {
|
$scope.containers = d.map(function(item) {
|
||||||
return new ContainerViewModel(item); });
|
return new ContainerViewModel(item); });
|
||||||
ViewSpinner.stop();
|
ViewSpinner.stop();
|
||||||
});
|
});
|
||||||
|
@ -258,7 +258,7 @@ function ContainersController($scope, Container, Settings, Messages, ViewSpinner
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.toggleGetAll = function() {
|
$scope.toggleGetAll = function() {
|
||||||
Settings.displayAll = $scope.displayAll;
|
Settings.displayAll = $scope.displayAll;
|
||||||
update({all: Settings.displayAll ? 1 : 0});
|
update({all: Settings.displayAll ? 1 : 0});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -395,6 +395,7 @@ function ImageController($scope, $q, $routeParams, $location, Image, Container,
|
||||||
function StartContainerController($scope, $routeParams, $location, Container, Messages) {
|
function StartContainerController($scope, $routeParams, $location, Container, Messages) {
|
||||||
$scope.template = 'partials/startcontainer.html';
|
$scope.template = 'partials/startcontainer.html';
|
||||||
$scope.config = {
|
$scope.config = {
|
||||||
|
name: '',
|
||||||
memory: 0,
|
memory: 0,
|
||||||
memorySwap: 0,
|
memorySwap: 0,
|
||||||
env: '',
|
env: '',
|
||||||
|
@ -415,6 +416,7 @@ function StartContainerController($scope, $routeParams, $location, Container, Me
|
||||||
|
|
||||||
Container.create({
|
Container.create({
|
||||||
Image: id,
|
Image: id,
|
||||||
|
name: $scope.config.name,
|
||||||
Memory: $scope.config.memory,
|
Memory: $scope.config.memory,
|
||||||
MemorySwap: $scope.config.memorySwap,
|
MemorySwap: $scope.config.memorySwap,
|
||||||
Cmd: cmds,
|
Cmd: cmds,
|
||||||
|
|
|
@ -4,7 +4,9 @@ angular.module('dockerui.services', ['ngResource'])
|
||||||
.factory('Container', function($resource, Settings) {
|
.factory('Container', function($resource, Settings) {
|
||||||
// Resource for interacting with the docker containers
|
// Resource for interacting with the docker containers
|
||||||
// http://docs.docker.io/en/latest/api/docker_remote_api.html#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},
|
query: {method: 'GET', params:{ all: 0, action: 'json'}, isArray: true},
|
||||||
get :{method: 'GET', params: { action:'json'}},
|
get :{method: 'GET', params: { action:'json'}},
|
||||||
start: {method: 'POST', params: {id: '@id', action: 'start'}},
|
start: {method: 'POST', params: {id: '@id', action: 'start'}},
|
||||||
|
|
|
@ -11,6 +11,10 @@
|
||||||
<label>Cmd:</label>
|
<label>Cmd:</label>
|
||||||
<input type="text" placeholder="{{ commandPlaceholder }}" ng-model="config.commands"/>
|
<input type="text" placeholder="{{ commandPlaceholder }}" ng-model="config.commands"/>
|
||||||
<small>Input commands as an array</small>
|
<small>Input commands as an array</small>
|
||||||
|
|
||||||
|
<label>Name:</label>
|
||||||
|
<input type="text" ng-model="config.name"/>
|
||||||
|
|
||||||
<label>Memory:</label>
|
<label>Memory:</label>
|
||||||
<input type="number" ng-model="config.memory"/>
|
<input type="number" ng-model="config.memory"/>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue