mirror of https://github.com/portainer/portainer
fix(container-creation): populate logger config from existing container (#2602)
* refactor(container): change map function to lodash * style(container): add semicolonpull/2629/head
parent
42365a52b1
commit
fe63b4a156
|
@ -509,6 +509,7 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
$scope.fromContainer = fromContainer;
|
$scope.fromContainer = fromContainer;
|
||||||
$scope.config = ContainerHelper.configFromContainer(fromContainer.Model);
|
$scope.config = ContainerHelper.configFromContainer(fromContainer.Model);
|
||||||
loadFromContainerCmd(d);
|
loadFromContainerCmd(d);
|
||||||
|
loadFromContainerLogging(d);
|
||||||
loadFromContainerPortBindings(d);
|
loadFromContainerPortBindings(d);
|
||||||
loadFromContainerVolumes(d);
|
loadFromContainerVolumes(d);
|
||||||
loadFromContainerNetworkConfig(d);
|
loadFromContainerNetworkConfig(d);
|
||||||
|
@ -525,6 +526,17 @@ function ($q, $scope, $state, $timeout, $transition$, $filter, Container, Contai
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadFromContainerLogging(config) {
|
||||||
|
var logConfig = config.HostConfig.LogConfig;
|
||||||
|
$scope.formValues.LogDriverName = logConfig.Type;
|
||||||
|
$scope.formValues.LogDriverOpts = _.map(logConfig.Config, function (value, name) {
|
||||||
|
return {
|
||||||
|
name: name,
|
||||||
|
value: value
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function initView() {
|
function initView() {
|
||||||
var nodeName = $transition$.params().nodeName;
|
var nodeName = $transition$.params().nodeName;
|
||||||
$scope.formValues.NodeName = nodeName;
|
$scope.formValues.NodeName = nodeName;
|
||||||
|
|
Loading…
Reference in New Issue