mirror of https://github.com/portainer/portainer
feat(ui): network creation support for standalone engine (#119)
parent
d0f57809d6
commit
145e45b4a8
|
@ -47,7 +47,7 @@
|
||||||
</div>
|
</div>
|
||||||
<!-- !subnet-gateway-inputs -->
|
<!-- !subnet-gateway-inputs -->
|
||||||
<!-- tag-note -->
|
<!-- tag-note -->
|
||||||
<div class="form-group">
|
<div class="form-group" ng-if="swarm">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<span class="small text-muted">Note: The network will be created using the overlay driver and will allow containers to communicate across the hosts of your cluster.</span>
|
<span class="small text-muted">Note: The network will be created using the overlay driver and will allow containers to communicate across the hosts of your cluster.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
angular.module('networks', [])
|
angular.module('networks', [])
|
||||||
.controller('NetworksController', ['$scope', '$state', 'Network', 'Messages', 'errorMsgFilter',
|
.controller('NetworksController', ['$scope', '$state', 'Network', 'Config', 'Messages', 'errorMsgFilter',
|
||||||
function ($scope, $state, Network, Messages, errorMsgFilter) {
|
function ($scope, $state, Network, Config, Messages, errorMsgFilter) {
|
||||||
$scope.state = {};
|
$scope.state = {};
|
||||||
$scope.state.selectedItemCount = 0;
|
$scope.state.selectedItemCount = 0;
|
||||||
$scope.state.advancedSettings = false;
|
$scope.state.advancedSettings = false;
|
||||||
|
@ -46,7 +46,9 @@ function ($scope, $state, Network, Messages, errorMsgFilter) {
|
||||||
function prepareNetworkConfiguration() {
|
function prepareNetworkConfiguration() {
|
||||||
var config = angular.copy($scope.config);
|
var config = angular.copy($scope.config);
|
||||||
prepareIPAMConfiguration(config);
|
prepareIPAMConfiguration(config);
|
||||||
|
if ($scope.swarm) {
|
||||||
config.Driver = 'overlay';
|
config.Driver = 'overlay';
|
||||||
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,5 +110,9 @@ function ($scope, $state, Network, Messages, errorMsgFilter) {
|
||||||
$('#loadNetworksSpinner').hide();
|
$('#loadNetworksSpinner').hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Config.$promise.then(function (c) {
|
||||||
|
$scope.swarm = c.swarm;
|
||||||
fetchNetworks();
|
fetchNetworks();
|
||||||
|
});
|
||||||
}]);
|
}]);
|
||||||
|
|
Loading…
Reference in New Issue