mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 07:49:41 +02:00
refactor(app): introduce new project structure for the frontend (#1623)
This commit is contained in:
parent
e6422a6d75
commit
27dceadba1
354 changed files with 1518 additions and 1755 deletions
36
app/docker/helpers/infoHelper.js
Normal file
36
app/docker/helpers/infoHelper.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
angular.module('portainer.docker')
|
||||
.factory('InfoHelper', [function InfoHelperFactory() {
|
||||
'use strict';
|
||||
return {
|
||||
determineEndpointMode: function(info) {
|
||||
var mode = {
|
||||
provider: '',
|
||||
role: ''
|
||||
};
|
||||
if (_.startsWith(info.ServerVersion, 'swarm')) {
|
||||
mode.provider = 'DOCKER_SWARM';
|
||||
if (info.SystemStatus[0][1] === 'primary') {
|
||||
mode.role = 'PRIMARY';
|
||||
} else {
|
||||
mode.role = 'REPLICA';
|
||||
}
|
||||
} else {
|
||||
if (!info.Swarm || _.isEmpty(info.Swarm.NodeID)) {
|
||||
if (info.ID === 'vSphere Integrated Containers') {
|
||||
mode.provider = 'VMWARE_VIC';
|
||||
} else {
|
||||
mode.provider = 'DOCKER_STANDALONE';
|
||||
}
|
||||
} else {
|
||||
mode.provider = 'DOCKER_SWARM_MODE';
|
||||
if (info.Swarm.ControlAvailable) {
|
||||
mode.role = 'MANAGER';
|
||||
} else {
|
||||
mode.role = 'WORKER';
|
||||
}
|
||||
}
|
||||
}
|
||||
return mode;
|
||||
}
|
||||
};
|
||||
}]);
|
Loading…
Add table
Add a link
Reference in a new issue