Ports list now using HostConfig.PortBindings

pull/2/head
Roman Usachev 9 years ago
parent 35dbacdfff
commit fc0dedfda7

@ -141,14 +141,14 @@
<div ng-show="!edit"> <div ng-show="!edit">
<button class="btn btn-default btn-xs pull-right" ng-click="toggleEdit()"><i class="glyphicon glyphicon-pencil"></i></button> <button class="btn btn-default btn-xs pull-right" ng-click="toggleEdit()"><i class="glyphicon glyphicon-pencil"></i></button>
<ul> <ul>
<li ng-repeat="(containerport, hostports) in container.NetworkSettings.Ports"> <li ng-repeat="(containerport, hostports) in container.HostConfig.PortBindings">
{{ containerport }} => {{ containerport }} =>
<span class="label label-default" style="margin-right: 5px;" ng-repeat="(k,v) in hostports">{{ v.HostIp }}:{{ v.HostPort }}</span> <span class="label label-default" style="margin-right: 5px;" ng-repeat="(k,v) in hostports">{{ v.HostIp }}:{{ v.HostPort }}</span>
</li> </li>
</ul> </ul>
</div> </div>
<div ng-show="edit"> <div ng-show="edit">
<div ng-repeat="(containerport, hostports) in newCfg.NetworkSettings.Ports" style="margin-bottom: 5px;"> <div ng-repeat="(containerport, hostports) in newCfg.Ports" style="margin-bottom: 5px;">
<label>{{ containerport }}</label> <label>{{ containerport }}</label>
<div style="margin-left: 20px;"> <div style="margin-left: 20px;">
<div ng-repeat="(k,v) in hostports" class="form-group form-inline"> <div ng-repeat="(k,v) in hostports" class="form-group form-inline">

@ -5,7 +5,7 @@ angular.module('container', [])
$scope.edit = false; $scope.edit = false;
$scope.newCfg = { $scope.newCfg = {
Env: [], Env: [],
NetworkSettings: {} Ports: {}
}; };
var update = function () { var update = function () {
@ -17,8 +17,8 @@ angular.module('container', [])
$scope.newCfg.Env = d.Config.Env.map(function(entry) { $scope.newCfg.Env = d.Config.Env.map(function(entry) {
return {name: entry.split('=')[0], value: entry.split('=')[1]}; return {name: entry.split('=')[0], value: entry.split('=')[1]};
}); });
$scope.newCfg.NetworkSettings.Ports = angular.copy(d.NetworkSettings.Ports) || []; $scope.newCfg.Ports = angular.copy(d.HostConfig.PortBindings) || [];
angular.forEach($scope.newCfg.NetworkSettings.Ports, function(conf, port, arr) { arr[port] = conf || []; }); angular.forEach($scope.newCfg.Ports, function(conf, port, arr) { arr[port] = conf || []; });
ViewSpinner.stop(); ViewSpinner.stop();
}, function (e) { }, function (e) {
@ -76,7 +76,7 @@ angular.module('container', [])
return entry.name+"="+entry.value; return entry.name+"="+entry.value;
}); });
var portBindings = angular.copy($scope.newCfg.NetworkSettings.Ports); var portBindings = angular.copy($scope.newCfg.Ports);
ViewSpinner.spin(); ViewSpinner.spin();

Loading…
Cancel
Save