mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-21 22:50:42 +08:00
feat: support probe paramName optional
This commit is contained in:
@@ -41,6 +41,7 @@ export interface SleepConfig {
|
||||
export interface ResponseBodyConfig {
|
||||
server: string;
|
||||
reqParamName: string;
|
||||
commandTemplate: string;
|
||||
}
|
||||
|
||||
export interface PayloadFormValues {
|
||||
|
||||
@@ -189,7 +189,6 @@ export const useYupValidationProbeResolver = (
|
||||
})) as ProbeShellFormSchema;
|
||||
|
||||
const host: keyof ProbeShellFormSchema = "host";
|
||||
const reqParamName: keyof ProbeShellFormSchema = "reqParamName";
|
||||
const errors = {} as any;
|
||||
|
||||
if (values.probeMethod === "DNSLog" && !values.host) {
|
||||
@@ -198,13 +197,6 @@ export const useYupValidationProbeResolver = (
|
||||
message: t("probeshell:tips.dnslog.host.required"),
|
||||
};
|
||||
}
|
||||
|
||||
if (values.probeMethod === "ResponseBody" && !values.reqParamName) {
|
||||
errors[reqParamName] = {
|
||||
type: "custom",
|
||||
message: t("probeshell:tips.response.reqParamName.required"),
|
||||
};
|
||||
}
|
||||
return {
|
||||
values,
|
||||
errors,
|
||||
|
||||
Reference in New Issue
Block a user