You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/docker/agent/queries/build-url.ts

18 lines
333 B

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;
}