feat: support custom shell generator (#49)

This commit is contained in:
ReaJason
2025-03-30 15:33:31 +08:00
parent b3780135bb
commit 5abaa5bbc1
18 changed files with 313 additions and 68 deletions
+12 -1
View File
@@ -5,7 +5,13 @@ import { Button } from "@/components/ui/button";
import { Form } from "@/components/ui/form.tsx";
import { env } from "@/config.ts";
import { FormSchema, formSchema } from "@/types/schema.ts";
import { APIErrorResponse, ConfigResponseType, GenerateResponse, GenerateResult } from "@/types/shell.ts";
import {
APIErrorResponse,
ConfigResponseType,
GenerateResponse,
GenerateResult,
ShellToolType,
} from "@/types/shell.ts";
import { transformToPostData } from "@/utils/transformer.ts";
import { zodResolver } from "@hookform/resolvers/zod";
import { useQuery } from "@tanstack/react-query";
@@ -76,6 +82,11 @@ function IndexComponent() {
toast.warning(t("tips.handlerUrlPattern"));
return false;
}
if (values.shellTool === ShellToolType.Custom && !values.shellClassBase64) {
toast.warning(t("tips.customShellClass"));
return false;
}
return true;
}