diff --git a/packages/playground/src/dashboard/components/public_config.vue b/packages/playground/src/dashboard/components/public_config.vue index 782d2789f5..4a75603e3f 100644 --- a/packages/playground/src/dashboard/components/public_config.vue +++ b/packages/playground/src/dashboard/components/public_config.vue @@ -28,7 +28,16 @@ @@ -42,7 +51,10 @@ @@ -52,7 +64,15 @@ @@ -139,6 +159,7 @@ import _ from "lodash"; import { onMounted, type PropType, ref, watch } from "vue"; import { gridProxyClient } from "@/clients"; +import type { RuleReturn } from "@/components/input_validator.vue"; import { useFormRef } from "@/hooks/form_validator"; import type { IPublicConfig } from "@/utils/types"; diff --git a/packages/playground/src/utils/validators.ts b/packages/playground/src/utils/validators.ts index 8f241278a3..d86819fa2f 100644 --- a/packages/playground/src/utils/validators.ts +++ b/packages/playground/src/utils/validators.ts @@ -705,6 +705,15 @@ export function isString(msg: string) { }; } +export function ipNotEqualGateway(ip: string, gw: string, msg: string) { + return (value: string) => { + const address = ip.split("/")[0]; + if (gw === address) { + return { message: msg, isNotEqualStrings: true }; + } + }; +} + export interface RegexPattern { pattern: string | RegExp; flags?: string | undefined;