feat(global): change the strategy used to determine if swarm mode is used

pull/227/head
Anthony Lapenna 2016-09-23 18:02:03 +12:00
parent fe63f9939a
commit e27282de3c
7 changed files with 7 additions and 7 deletions

View File

@ -152,7 +152,7 @@ function ($scope, Container, ContainerHelper, Info, Settings, Messages, Config)
$scope.swarm = c.swarm;
if (c.swarm) {
Info.get({}, function (d) {
if (d.Swarm) {
if (!_.startsWith(d.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
} else {
$scope.swarm_hosts = retrieveSwarmHostsInfo(d);

View File

@ -56,7 +56,7 @@ function ($scope, $state, Config, Info, Container, Image, Volume, Network, Messa
Config.$promise.then(function (c) {
var swarm = c.swarm;
Info.get({}, function(info) {
if (swarm && info.Swarm) {
if (swarm && !_.startsWith(info.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
}
});

View File

@ -64,7 +64,7 @@ function ($scope, $q, Config, Container, ContainerHelper, Image, Network, Volume
function prepareInfoData(d) {
var info = d;
$scope.infoData = info;
if ($scope.swarm && info.Swarm) {
if ($scope.swarm && !_.startsWith(info.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
}
}

View File

@ -15,7 +15,7 @@ function ($scope, $cookieStore, Settings, Config, Info) {
Config.$promise.then(function (c) {
$scope.swarm = c.swarm;
Info.get({}, function(d) {
if ($scope.swarm && d.Swarm) {
if ($scope.swarm && !_.startsWith(d.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
$scope.swarm_manager = false;
if (d.Swarm.ControlAvailable) {

View File

@ -22,7 +22,7 @@ function ($scope, Info, Version, Node) {
Info.get({}, function (d) {
$scope.info = d;
if (d.Swarm) {
if (!_.startsWith(d.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
Node.query({}, function(d) {
$scope.nodes = d;

View File

@ -166,7 +166,7 @@ function ($scope, $q, $state, $filter, Config, Info, Container, ContainerHelper,
Config.$promise.then(function (c) {
$scope.swarm = c.swarm;
Info.get({}, function(info) {
if ($scope.swarm && info.Swarm) {
if ($scope.swarm && !_.startsWith(info.ServerVersion, 'swarm')) {
$scope.swarm_mode = true;
}
});

View File

@ -274,7 +274,7 @@ module.exports = function (grunt) {
command: [
'docker stop portainer',
'docker rm portainer',
'docker run -d -p 9000:9000 -v /tmp/portainer:/data --name portainer portainer -H tcp://10.0.7.10:2375 --swarm -d /data'
'docker run -d -p 9000:9000 -v /tmp/portainer:/data --name portainer portainer -H tcp://10.0.7.10:4000 --swarm -d /data'
].join(';')
},
runSsl: {