mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
fix(docker/networks): load containers from target node [EE-5446] (#8928)
This commit is contained in:
parent
14fa60f6e6
commit
881fa01eb2
8 changed files with 97 additions and 73 deletions
|
@ -1,5 +1,8 @@
|
|||
import { ContainerId } from '@/react/docker/containers/types';
|
||||
import axios, { parseAxiosError } from '@/portainer/services/axios';
|
||||
import axios, {
|
||||
agentTargetHeader,
|
||||
parseAxiosError,
|
||||
} from '@/portainer/services/axios';
|
||||
import { EnvironmentId } from '@/react/portainer/environments/types';
|
||||
|
||||
import { NetworkId, DockerNetwork } from './types';
|
||||
|
@ -8,11 +11,19 @@ type NetworkAction = 'connect' | 'disconnect' | 'create';
|
|||
|
||||
export async function getNetwork(
|
||||
environmentId: EnvironmentId,
|
||||
networkId: NetworkId
|
||||
networkId: NetworkId,
|
||||
{ nodeName }: { nodeName?: string } = {}
|
||||
) {
|
||||
try {
|
||||
const { data: network } = await axios.get<DockerNetwork>(
|
||||
buildUrl(environmentId, networkId)
|
||||
buildUrl(environmentId, networkId),
|
||||
nodeName
|
||||
? {
|
||||
headers: {
|
||||
[agentTargetHeader]: nodeName,
|
||||
},
|
||||
}
|
||||
: undefined
|
||||
);
|
||||
return network;
|
||||
} catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue