mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-03 22:35:59 +00:00
Working on newt compat
This commit is contained in:
@@ -2,6 +2,13 @@ import { Target, TargetHealthCheck } from "@server/db";
|
||||
import { sendToClient } from "#dynamic/routers/ws";
|
||||
import logger from "@server/logger";
|
||||
import { canCompress } from "@server/lib/clientVersionChecks";
|
||||
import semver from "semver";
|
||||
|
||||
const NEWT_V2_TARGET_HEALTH_CHECK_VERSION = ">=1.12.0";
|
||||
|
||||
export function supportsTargetHealthChecksV2(version?: string | null) {
|
||||
return version ? semver.satisfies(version, NEWT_V2_TARGET_HEALTH_CHECK_VERSION) : false;
|
||||
}
|
||||
|
||||
export async function addTargets(
|
||||
newtId: string,
|
||||
@@ -83,8 +90,7 @@ export async function addTargets(
|
||||
}
|
||||
|
||||
return {
|
||||
id: target.targetId,
|
||||
hcId: hc.targetHealthCheckId,
|
||||
id: supportsTargetHealthChecksV2(version) ? target.targetId : hc.targetHealthCheckId,
|
||||
hcEnabled: hc.hcEnabled,
|
||||
hcPath: hc.hcPath,
|
||||
hcScheme: hc.hcScheme,
|
||||
|
||||
Reference in New Issue
Block a user