mirror of
https://github.com/portainer/portainer.git
synced 2025-08-06 06:15:22 +02:00
fix(wizard): count swarm agent as local environment EE-6215 (#10684)
This commit is contained in:
parent
450c167461
commit
92c18843b2
2 changed files with 21 additions and 2 deletions
|
@ -103,6 +103,8 @@ function getTypeLabel(type?: EnvironmentType) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EnvironmentType.Docker:
|
case EnvironmentType.Docker:
|
||||||
return 'Docker';
|
return 'Docker';
|
||||||
|
case EnvironmentType.AgentOnDocker:
|
||||||
|
return 'Docker Agent';
|
||||||
case EnvironmentType.KubernetesLocal:
|
case EnvironmentType.KubernetesLocal:
|
||||||
return 'Kubernetes';
|
return 'Kubernetes';
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -74,7 +74,11 @@ function useFetchLocalEnvironment() {
|
||||||
{
|
{
|
||||||
page: 0,
|
page: 0,
|
||||||
pageLimit: 1,
|
pageLimit: 1,
|
||||||
types: [EnvironmentType.Docker, EnvironmentType.KubernetesLocal],
|
types: [
|
||||||
|
EnvironmentType.Docker,
|
||||||
|
EnvironmentType.AgentOnDocker,
|
||||||
|
EnvironmentType.KubernetesLocal,
|
||||||
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
refetchInterval: false,
|
refetchInterval: false,
|
||||||
|
@ -82,8 +86,21 @@ function useFetchLocalEnvironment() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
let environment: Environment | undefined;
|
||||||
|
environments.forEach((value) => {
|
||||||
|
if (!environment) {
|
||||||
|
if (value.Type === EnvironmentType.AgentOnDocker) {
|
||||||
|
if (value.Name === 'primary' && value.Id === 1) {
|
||||||
|
environment = value;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
environment = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
isLoading,
|
isLoading,
|
||||||
environment: environments.length > 0 ? environments[0] : undefined,
|
environment,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue