mirror of
https://github.com/portainer/portainer.git
synced 2025-07-22 14:59:41 +02:00
feat(templates): add support for the network field (#583)
This commit is contained in:
parent
3089268d88
commit
e0b94e4ff7
2 changed files with 6 additions and 2 deletions
|
@ -68,6 +68,11 @@ function ($scope, $q, $state, $anchorScroll, Config, ContainerService, ImageServ
|
|||
selectedItem = idx;
|
||||
var selectedTemplate = $scope.templates[idx];
|
||||
$scope.state.selectedTemplate = selectedTemplate;
|
||||
if (selectedTemplate.Network) {
|
||||
$scope.formValues.network = _.find($scope.availableNetworks, function(o) { return o.Name === selectedTemplate.Network; });
|
||||
} else {
|
||||
$scope.formValues.network = _.find($scope.availableNetworks, function(o) { return o.Name === "bridge"; });
|
||||
}
|
||||
$anchorScroll('selectedTemplate');
|
||||
}
|
||||
|
||||
|
@ -94,8 +99,6 @@ function ($scope, $q, $state, $anchorScroll, Config, ContainerService, ImageServ
|
|||
networks = NetworkService.filterGlobalNetworks(networks);
|
||||
$scope.globalNetworkCount = networks.length;
|
||||
NetworkService.addPredefinedLocalNetworks(networks);
|
||||
} else {
|
||||
$scope.formValues.network = _.find(networks, function(o) { return o.Name === "bridge"; });
|
||||
}
|
||||
return networks;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue