Files
kandev/apps/web/lib/settings/executor-settings-routes.ts
T
2026-09-02 13:50:03 +00:00

24 lines
765 B
TypeScript

type ExecutorRouteIdentity = {
id: string;
type?: string | null;
};
export function kubernetesExecutorSettingsPath(executorId: string): string {
return `/settings/executors/k8s/${encodeURIComponent(executorId)}`;
}
export function executorConnectionSettingsPath(executor: ExecutorRouteIdentity): string {
return executor.type === "k8s"
? kubernetesExecutorSettingsPath(executor.id)
: `/settings/executor/${encodeURIComponent(executor.id)}`;
}
export function executorProfileSettingsPath(
executor: ExecutorRouteIdentity,
profileId: string,
): string {
return executor.type === "k8s"
? `/settings/executors/${encodeURIComponent(profileId)}`
: `${executorConnectionSettingsPath(executor)}/profile/${encodeURIComponent(profileId)}`;
}