diff --git a/web/src/components/copyable-field.tsx b/web/src/components/copyable-field.tsx index 1937e894..606ab76a 100644 --- a/web/src/components/copyable-field.tsx +++ b/web/src/components/copyable-field.tsx @@ -39,7 +39,7 @@ export function CopyableField({ label, value, text }: Readonly {value && ( - + diff --git a/web/src/components/main-config-card.tsx b/web/src/components/main-config-card.tsx index 74b62956..84179387 100644 --- a/web/src/components/main-config-card.tsx +++ b/web/src/components/main-config-card.tsx @@ -1,4 +1,12 @@ -import { FormControl, FormDescription, FormField, FormItem, FormLabel } from "@/components/ui/form.tsx"; +import { + FormControl, + FormDescription, + FormField, + FormFieldItem, + FormFieldLabel, + FormItem, + FormLabel, +} from "@/components/ui/form.tsx"; import { Label } from "@/components/ui/label.tsx"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select.tsx"; import { Switch } from "@/components/ui/switch.tsx"; @@ -203,8 +211,8 @@ export function MainConfigCard({ control={form.control} name="server" render={({ field }) => ( - - {t("mainConfig.server")} + + {t("mainConfig.server")} { if (Number.parseInt(v) >= 53) { @@ -260,7 +268,7 @@ export function MainConfigCard({ value={field.value} > - + @@ -272,7 +280,7 @@ export function MainConfigCard({ ))} - + )} /> diff --git a/web/src/components/package-config-card.tsx b/web/src/components/package-config-card.tsx index d6916fd2..7e2b2adf 100644 --- a/web/src/components/package-config-card.tsx +++ b/web/src/components/package-config-card.tsx @@ -70,7 +70,7 @@ export function PackageConfigCard({ name="packingMethod" render={({ field }) => ( - {t("packageConfig.title")} + {t("packageConfig.title")} ) { const showCode = packMethod === "JSP"; const packMethods = Object.keys(allPackResults ?? {}); const [selectedMethod, setSelectedMethod] = useState(packMethods[0]); @@ -26,38 +25,36 @@ export function MultiPackResult({ }, [allPackResults]); return ( - - - - ({packResult?.length}) - - } - wrapLongLines={!showCode} - showLineNumbers={showCode} - language={showCode ? "java" : "text"} - height={350} - /> - + + + ({packResult?.length}) + + } + wrapLongLines={!showCode} + showLineNumbers={showCode} + language={showCode ? "java" : "text"} + height={350} + /> ); } diff --git a/web/src/components/shell-result.tsx b/web/src/components/shell-result.tsx index e42e2de9..c13b67b5 100644 --- a/web/src/components/shell-result.tsx +++ b/web/src/components/shell-result.tsx @@ -32,7 +32,7 @@ export function ShellResult({ {t("generateResult.title2")} {t("generateResult.title3")} - + ( - - + + {t("shellToolConfig.antSwordPass")} {t("optional")} - - - + + + )} />
@@ -40,22 +40,22 @@ export function AntSwordTabContent({ control={form.control} name="headerName" render={({ field }) => ( - - {t("shellToolConfig.headerName")} - - + + {t("shellToolConfig.headerName")} + + )} /> ( - - + + {t("shellToolConfig.headerValue")} {t("optional")} - - - + + + )} />
diff --git a/web/src/components/tools/behinder-tab.tsx b/web/src/components/tools/behinder-tab.tsx index cd7f71c6..218cf16b 100644 --- a/web/src/components/tools/behinder-tab.tsx +++ b/web/src/components/tools/behinder-tab.tsx @@ -2,7 +2,7 @@ import { FormSchema } from "@/types/schema"; import { FormProvider, UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { Card, CardContent } from "../ui/card"; -import { FormField, FormItem, FormLabel } from "../ui/form"; +import { FormField, FormFieldItem, FormFieldLabel } from "../ui/form"; import { Input } from "../ui/input"; import { TabsContent } from "../ui/tabs"; import { OptionalClassFormField } from "./classname-field"; @@ -27,12 +27,12 @@ export function BehinderTabContent({ control={form.control} name="behinderPass" render={({ field }) => ( - - + + {t("shellToolConfig.behinderPass")} {t("optional")} - - - + + + )} />
@@ -40,22 +40,22 @@ export function BehinderTabContent({ control={form.control} name="headerName" render={({ field }) => ( - - {t("shellToolConfig.headerName")} - - + + {t("shellToolConfig.headerName")} + + )} /> ( - - + + {t("shellToolConfig.headerValue")} {t("optional")} - - - + + + )} />
diff --git a/web/src/components/tools/classname-field.tsx b/web/src/components/tools/classname-field.tsx index 3ba5cac9..cf071b9c 100644 --- a/web/src/components/tools/classname-field.tsx +++ b/web/src/components/tools/classname-field.tsx @@ -1,37 +1,58 @@ -import { FormField, FormItem, FormLabel } from "@/components/ui/form.tsx"; +import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form.tsx"; import { Input } from "@/components/ui/input.tsx"; import { FormSchema } from "@/types/schema.ts"; +import { ChevronDown, ChevronUp, Settings } from "lucide-react"; +import { Fragment, useState } from "react"; import { FormProvider, UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; +import { Button } from "../ui/button"; export function OptionalClassFormField({ form }: Readonly<{ form: UseFormReturn }>) { const { t } = useTranslation(); + const [showAdvanced, setShowAdvanced] = useState(false); return ( - - ( - - - {t("mainConfig.shellClassName")} {t("optional")} - - - - )} - /> - ( - - - {t("mainConfig.injectorClassName")} {t("optional")} - - - - )} - /> - + +
+ +
+ {showAdvanced && ( + + ( + + + {t("mainConfig.shellClassName")} {t("optional")} + + + + )} + /> + ( + + + {t("mainConfig.injectorClassName")} {t("optional")} + + + + )} + /> + + )} +
); } diff --git a/web/src/components/tools/command-tab.tsx b/web/src/components/tools/command-tab.tsx index d4cb84f0..2f7d180f 100644 --- a/web/src/components/tools/command-tab.tsx +++ b/web/src/components/tools/command-tab.tsx @@ -4,7 +4,7 @@ import { useQuery } from "@tanstack/react-query"; import { FormProvider, UseFormReturn } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { Card, CardContent } from "../ui/card"; -import { FormControl, FormField, FormItem, FormLabel } from "../ui/form"; +import { FormControl, FormField, FormFieldItem, FormFieldLabel } from "../ui/form"; import { Input } from "../ui/input"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../ui/select"; import { TabsContent } from "../ui/tabs"; @@ -34,30 +34,30 @@ export function CommandTabContent({ + ( + + + {t("shellToolConfig.paramName")} {t("optional")} + + + + + + )} + />
- ( - - - {t("shellToolConfig.paramName")} {t("optional")} - - - - - - )} - /> ( - - {t("shellToolConfig.encryptor")} + + {t("shellToolConfig.encryptor")} - + )} /> ( - - {t("shellToolConfig.implementationClass")} + + {t("shellToolConfig.implementationClass")} - + )} />
diff --git a/web/src/components/tools/custom-tab.tsx b/web/src/components/tools/custom-tab.tsx index 86c5180c..ccbfc88a 100644 --- a/web/src/components/tools/custom-tab.tsx +++ b/web/src/components/tools/custom-tab.tsx @@ -4,7 +4,7 @@ import { FormSchema } from "@/types/schema"; import { t } from "i18next"; import { useState } from "react"; import { FormProvider, UseFormReturn } from "react-hook-form"; -import { FormControl, FormField, FormItem, FormLabel } from "../ui/form"; +import { FormControl, FormField, FormFieldItem, FormFieldLabel, FormMessage } from "../ui/form"; import { Input } from "../ui/input"; import { Label } from "../ui/label"; import { RadioGroup, RadioGroupItem } from "../ui/radio-group"; @@ -32,8 +32,8 @@ export default function CustomTabContent({ control={form.control} name="shellClassBase64" render={({ field }) => ( - - {t("shellToolConfig.base64String")} + + {t("shellToolConfig.base64String")} { @@ -73,7 +73,8 @@ export default function CustomTabContent({