mirror of
https://github.com/portainer/portainer.git
synced 2025-08-07 14:55:27 +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
|
@ -27,6 +27,8 @@ axios.interceptors.request.use(async (config) => {
|
|||
return newConfig;
|
||||
});
|
||||
|
||||
export const agentTargetHeader = 'X-PortainerAgent-Target';
|
||||
|
||||
export function agentInterceptor(config: AxiosRequestConfig) {
|
||||
if (!config.url || !config.url.includes('/docker/')) {
|
||||
return config;
|
||||
|
@ -35,7 +37,7 @@ export function agentInterceptor(config: AxiosRequestConfig) {
|
|||
const newConfig = { headers: config.headers || {}, ...config };
|
||||
const target = portainerAgentTargetHeader();
|
||||
if (target) {
|
||||
newConfig.headers['X-PortainerAgent-Target'] = target;
|
||||
newConfig.headers[agentTargetHeader] = target;
|
||||
}
|
||||
|
||||
if (portainerAgentManagerOperation()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue