mirror of https://github.com/portainer/portainer
18 lines
333 B
TypeScript
18 lines
333 B
TypeScript
import { EnvironmentId } from '@/react/portainer/environments/types';
|
|
|
|
export function buildAgentUrl(
|
|
environmentId: EnvironmentId,
|
|
apiVersion: number,
|
|
action: string
|
|
) {
|
|
let url = `/endpoints/${environmentId}/agent/docker`;
|
|
|
|
if (apiVersion > 1) {
|
|
url += `/v${apiVersion}`;
|
|
}
|
|
|
|
url += `/${action}`;
|
|
|
|
return url;
|
|
}
|