feat(ui): network creation support for standalone engine (#119)

pull/128/head
Anthony Lapenna 2016-08-10 18:20:18 +12:00 committed by GitHub
parent d0f57809d6
commit 145e45b4a8
2 changed files with 11 additions and 5 deletions

View File

@ -47,7 +47,7 @@
</div>
<!-- !subnet-gateway-inputs -->
<!-- tag-note -->
<div class="form-group">
<div class="form-group" ng-if="swarm">
<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>
</div>

View File

@ -1,6 +1,6 @@
angular.module('networks', [])
.controller('NetworksController', ['$scope', '$state', 'Network', 'Messages', 'errorMsgFilter',
function ($scope, $state, Network, Messages, errorMsgFilter) {
.controller('NetworksController', ['$scope', '$state', 'Network', 'Config', 'Messages', 'errorMsgFilter',
function ($scope, $state, Network, Config, Messages, errorMsgFilter) {
$scope.state = {};
$scope.state.selectedItemCount = 0;
$scope.state.advancedSettings = false;
@ -46,7 +46,9 @@ function ($scope, $state, Network, Messages, errorMsgFilter) {
function prepareNetworkConfiguration() {
var config = angular.copy($scope.config);
prepareIPAMConfiguration(config);
config.Driver = 'overlay';
if ($scope.swarm) {
config.Driver = 'overlay';
}
return config;
}
@ -108,5 +110,9 @@ function ($scope, $state, Network, Messages, errorMsgFilter) {
$('#loadNetworksSpinner').hide();
});
}
fetchNetworks();
Config.$promise.then(function (c) {
$scope.swarm = c.swarm;
fetchNetworks();
});
}]);