diff --git a/app/components/container/container.html b/app/components/container/container.html index ee9bd2629..6617f5035 100644 --- a/app/components/container/container.html +++ b/app/components/container/container.html @@ -54,7 +54,7 @@ Created: - {{ container.Created }} + {{ container.Created | date: 'medium' }} Path: @@ -62,7 +62,9 @@ Args: - {{ container.Args }} + +
{{ container.Args.join(' ') || 'None' }}
+ Exposed Ports: @@ -80,6 +82,21 @@ + + Labels: + + + + + + + + + + +
KeyValue
{{ k }}{{ v }}
+ + Publish All: @@ -110,7 +127,9 @@ Entrypoint: - {{ container.Config.Entrypoint }} + +
{{ container.Config.Entrypoint.join(' ') }}
+ Volumes: @@ -127,7 +146,15 @@ State: - {{ container.State|getstatetext }} + + + + + + + Logs: diff --git a/app/components/startContainer/startContainerController.js b/app/components/startContainer/startContainerController.js index 46d8ba710..354d2d6a3 100644 --- a/app/components/startContainer/startContainerController.js +++ b/app/components/startContainer/startContainerController.js @@ -11,6 +11,7 @@ angular.module('startContainer', ['ui.bootstrap']) $scope.config = { Env: [], + Labels: [], Volumes: [], SecurityOpts: [], HostConfig: { @@ -66,6 +67,11 @@ angular.module('startContainer', ['ui.bootstrap']) config.Env = config.Env.map(function (envar) { return envar.name + '=' + envar.value; }); + var labels = {}; + config.Labels = config.Labels.forEach(function(label) { + labels[label.key] = label.value; + }); + config.Labels = labels; config.Volumes = getNames(config.Volumes); config.SecurityOpts = getNames(config.SecurityOpts); diff --git a/app/components/startContainer/startcontainer.html b/app/components/startContainer/startcontainer.html index 11647291a..26b3f1767 100644 --- a/app/components/startContainer/startcontainer.html +++ b/app/components/startContainer/startcontainer.html @@ -148,6 +148,32 @@ variable +
+ + +
+
+
+ + +
+
+ + +
+
+ +
+
+
+ +
diff --git a/app/shared/filters.js b/app/shared/filters.js index d4f18e232..894d7542f 100644 --- a/app/shared/filters.js +++ b/app/shared/filters.js @@ -51,7 +51,7 @@ angular.module('dockerui.filters', []) 'use strict'; return function (state) { if (state === undefined) { - return ''; + return 'label-default'; } if (state.Ghost && state.Running) { @@ -60,7 +60,7 @@ angular.module('dockerui.filters', []) if (state.Running) { return 'label-success'; } - return ''; + return 'label-default'; }; }) .filter('humansize', function () { diff --git a/test/unit/app/components/startContainerController.spec.js b/test/unit/app/components/startContainerController.spec.js index 57d898de1..2988b9066 100644 --- a/test/unit/app/components/startContainerController.spec.js +++ b/test/unit/app/components/startContainerController.spec.js @@ -111,6 +111,43 @@ describe('startContainerController', function () { }); }); + describe('Create and start a container with labels', function () { + it('should issue a correct create request to the Docker remote API', function () { + var controller = createController(); + var id = '6abd8bfba81cf8a05a76a4bdefcb36c4b66cd02265f4bfcd0e236468696ebc6c'; + var expectedBody = { + 'name': 'container-name', + 'Labels': { + "org.foo.bar": "Baz", + "com.biz.baz": "Boo" + } + }; + + expectGetContainers(); + + $httpBackend.expectPOST('dockerapi/containers/create?name=container-name', expectedBody).respond({ + 'Id': id, + 'Warnings': null + }); + $httpBackend.expectPOST('dockerapi/containers/' + id + '/start').respond({ + 'id': id, + 'Warnings': null + }); + + scope.config.name = 'container-name'; + scope.config.Labels = [{ + key: 'org.foo.bar', + value: 'Baz' + }, { + key: 'com.biz.baz', + value: 'Boo' + }]; + + scope.create(); + $httpBackend.flush(); + }); + }); + describe('Create and start a container with volumesFrom', function () { it('should issue a correct create request to the Docker remote API', function () { var controller = createController(); diff --git a/test/unit/app/shared/filters.spec.js b/test/unit/app/shared/filters.spec.js index 6ebfabe59..8005572f7 100644 --- a/test/unit/app/shared/filters.spec.js +++ b/test/unit/app/shared/filters.spec.js @@ -73,8 +73,8 @@ describe('filters', function () { }); describe('getstatelabel', function () { - it('should return an empty string when state is undefined', inject(function (getstatelabelFilter) { - expect(getstatelabelFilter(undefined)).toBe(''); + it('should return default when state is undefined', inject(function (getstatelabelFilter) { + expect(getstatelabelFilter(undefined)).toBe('label-default'); })); it('should return label-important when a ghost state is detected', inject(function (getstatelabelFilter) {