refactor: rename

1. 将枚举 Server 改为字符串常量,使得 memshell 和 probeshell 都能共用
2. 移除 memshell 模块直接内置在 generator 中
3. 通用类从 memshell 移动至 javaweb 下,命名修改,增加辨识度
This commit is contained in:
ReaJason
2025-08-13 23:53:40 +08:00
parent a513e44c96
commit b2c614eea4
354 changed files with 1094 additions and 1387 deletions
@@ -1,41 +1,41 @@
import {
ArrowUpRightIcon,
AxeIcon,
CommandIcon,
NetworkIcon,
ServerIcon,
ShieldOffIcon,
SwordIcon,
WaypointsIcon,
ZapIcon,
ArrowUpRightIcon,
AxeIcon,
CommandIcon,
NetworkIcon,
ServerIcon,
ShieldOffIcon,
SwordIcon,
WaypointsIcon,
ZapIcon,
} from "lucide-react";
import { type JSX, useCallback, useEffect, useId, useState } from "react";
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { AntSwordTabContent } from "@/components/memshell/tabs/antsword-tab";
import { BehinderTabContent } from "@/components/memshell/tabs/behinder-tab";
import { CommandTabContent } from "@/components/memshell/tabs/command-tab";
import {type JSX, useCallback, useEffect, useId, useState} from "react";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {AntSwordTabContent} from "@/components/memshell/tabs/antsword-tab";
import {BehinderTabContent} from "@/components/memshell/tabs/behinder-tab";
import {CommandTabContent} from "@/components/memshell/tabs/command-tab";
import CustomTabContent from "@/components/memshell/tabs/custom-tab";
import { GodzillaTabContent } from "@/components/memshell/tabs/godzilla-tab";
import { NeoRegTabContent } from "@/components/memshell/tabs/neoreg-tab";
import { Suo5TabContent } from "@/components/memshell/tabs/suo5-tab";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
import {GodzillaTabContent} from "@/components/memshell/tabs/godzilla-tab";
import {NeoRegTabContent} from "@/components/memshell/tabs/neoreg-tab";
import {Suo5TabContent} from "@/components/memshell/tabs/suo5-tab";
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card.tsx";
import {
FormControl,
FormDescription,
FormField,
FormFieldItem,
FormFieldLabel,
FormItem,
FormLabel,
FormMessage,
FormControl,
FormDescription,
FormField,
FormFieldItem,
FormFieldLabel,
FormItem,
FormLabel,
FormMessage,
} 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";
import { Tabs, TabsList, TabsTrigger } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema.ts";
import { type MainConfig, type ServerConfig, ShellToolType } from "@/types/shell.ts";
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";
import {Tabs, TabsList, TabsTrigger} from "@/components/ui/tabs";
import {type MainConfig, type ServerConfig, ShellToolType} from "@/types/memshell";
import type {MemShellFormSchema} from "@/types/schema.ts";
const shellToolIcons: Record<ShellToolType, JSX.Element> = {
[ShellToolType.Behinder]: <ShieldOffIcon className="h-4 w-4" />,
@@ -60,7 +60,7 @@ export default function MainConfigCard({
servers,
}: Readonly<{
mainConfig: MainConfig | undefined;
form: UseFormReturn<ShellFormSchema>;
form: UseFormReturn<MemShellFormSchema>;
servers?: ServerConfig;
}>) {
const [shellToolMap, setShellToolMap] = useState<{
@@ -1,12 +1,12 @@
import { PackageIcon } from "lucide-react";
import { useEffect, useState } from "react";
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
import { FormControl, FormField, FormItem, FormLabel } from "@/components/ui/form.tsx";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group.tsx";
import type { ShellFormSchema } from "@/types/schema.ts";
import type { PackerConfig } from "@/types/shell.ts";
import {PackageIcon} from "lucide-react";
import {useEffect, useState} from "react";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card.tsx";
import {FormControl, FormField, FormItem, FormLabel} from "@/components/ui/form.tsx";
import {RadioGroup, RadioGroupItem} from "@/components/ui/radio-group.tsx";
import type {PackerConfig} from "@/types/memshell";
import type {MemShellFormSchema} from "@/types/schema.ts";
type Option = {
name: string;
@@ -18,7 +18,7 @@ export default function PackageConfigCard({
form,
}: Readonly<{
packerConfig: PackerConfig | undefined;
form: UseFormReturn<ShellFormSchema>;
form: UseFormReturn<MemShellFormSchema>;
}>) {
const [options, setOptions] = useState<Array<Option>>([]);
@@ -1,16 +1,16 @@
import { ScrollTextIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
import { downloadBytes, formatBytes } from "@/lib/utils";
import type { GenerateResult } from "@/types/shell";
import {ScrollTextIcon} from "lucide-react";
import {useTranslation} from "react-i18next";
import {Button} from "@/components/ui/button";
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
import {Separator} from "@/components/ui/separator";
import {downloadBytes, formatBytes} from "@/lib/utils";
import type {MemShellResult} from "@/types/memshell";
export function AgentResult({
packMethod,
packResult,
generateResult,
}: Readonly<{ packMethod: string; packResult: string; generateResult?: GenerateResult }>) {
}: Readonly<{ packMethod: string; packResult: string; generateResult?: MemShellResult }>) {
const { t } = useTranslation();
const isPureAgent = packMethod === "AgentJar";
return (
@@ -1,22 +1,22 @@
import { FileTextIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
import { Separator } from "@/components/ui/separator";
import { shouldHidden } from "@/lib/utils";
import {FileTextIcon} from "lucide-react";
import {useTranslation} from "react-i18next";
import {Card, CardContent, CardHeader, CardTitle} from "@/components/ui/card";
import {Separator} from "@/components/ui/separator";
import {shouldHidden} from "@/lib/utils";
import {
type AntSwordShellToolConfig,
type BehinderShellToolConfig,
type CommandShellToolConfig,
type GenerateResult,
type GodzillaShellToolConfig,
type NeoreGeorgShellToolConfig,
ShellToolType,
type Suo5ShellToolConfig,
} from "@/types/shell";
import { CopyableField } from "../../copyable-field";
import { FeedbackAlert } from "./feedback-alert";
type AntSwordShellToolConfig,
type BehinderShellToolConfig,
type CommandShellToolConfig,
type GodzillaShellToolConfig,
type MemShellResult,
type NeoreGeorgShellToolConfig,
ShellToolType,
type Suo5ShellToolConfig,
} from "@/types/memshell";
import {CopyableField} from "../../copyable-field";
import {FeedbackAlert} from "./feedback-alert";
export function BasicInfo({ generateResult }: Readonly<{ generateResult?: GenerateResult }>) {
export function BasicInfo({ generateResult }: Readonly<{ generateResult?: MemShellResult }>) {
const { t } = useTranslation();
return (
<Card>
@@ -1,12 +1,12 @@
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { downloadBytes } from "@/lib/utils";
import type { GenerateResult } from "@/types/shell";
import {useTranslation} from "react-i18next";
import {Button} from "@/components/ui/button";
import {downloadBytes} from "@/lib/utils";
import type {MemShellResult} from "@/types/memshell";
export function JarResult({
packResult,
generateResult,
}: Readonly<{ packResult: string; generateResult?: GenerateResult }>) {
}: Readonly<{ packResult: string; generateResult?: MemShellResult }>) {
const { t } = useTranslation();
return (
<div className="flex items-center justify-center">
@@ -1,9 +1,9 @@
import { useTranslation } from "react-i18next";
import {useTranslation} from "react-i18next";
import CodeViewer from "@/components/code-viewer";
import type { GenerateResult } from "@/types/shell";
import { AgentResult } from "./agent";
import { JarResult } from "./jar-result";
import { MultiPackResult } from "./multi-packer";
import type {MemShellResult} from "@/types/memshell";
import {AgentResult} from "./agent";
import {JarResult} from "./jar-result";
import {MultiPackResult} from "./multi-packer";
export function ResultComponent({
packResult,
@@ -14,7 +14,7 @@ export function ResultComponent({
packResult: string | undefined;
allPackResults: Map<string, string> | undefined;
packMethod: string;
generateResult?: GenerateResult;
generateResult?: MemShellResult;
}>) {
const showCode = packMethod === "JSP";
const isAgent = packMethod.startsWith("Agent");
+11 -11
View File
@@ -1,15 +1,15 @@
import { DownloadIcon } from "lucide-react";
import { useTranslation } from "react-i18next";
import { toast } from "sonner";
import {DownloadIcon} from "lucide-react";
import {useTranslation} from "react-i18next";
import {toast} from "sonner";
import { QuickUsage } from "@/components/memshell/quick-usage";
import { Button } from "@/components/ui/button.tsx";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs.tsx";
import { downloadBytes } from "@/lib/utils.ts";
import type { GenerateResult } from "@/types/shell.ts";
import {QuickUsage} from "@/components/memshell/quick-usage";
import {Button} from "@/components/ui/button.tsx";
import {Tabs, TabsContent, TabsList, TabsTrigger} from "@/components/ui/tabs.tsx";
import {downloadBytes} from "@/lib/utils.ts";
import type {MemShellResult} from "@/types/memshell";
import CodeViewer from "../code-viewer";
import { BasicInfo } from "./results/basic-info";
import { ResultComponent } from "./results/result-component";
import {BasicInfo} from "./results/basic-info";
import {ResultComponent} from "./results/result-component";
export default function ShellResult({
packResult,
@@ -20,7 +20,7 @@ export default function ShellResult({
packResult: string | undefined;
allPackResults: Map<string, string> | undefined;
packMethod: string;
generateResult?: GenerateResult;
generateResult?: MemShellResult;
}>) {
const { t } = useTranslation();
if (!generateResult) {
@@ -1,18 +1,18 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormControl, FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { TabsContent } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormControl, FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {TabsContent} from "@/components/ui/tabs";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function AntSwordTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
@@ -1,18 +1,18 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { TabsContent } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {TabsContent} from "@/components/ui/tabs";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function BehinderTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
@@ -1,13 +1,13 @@
import { ChevronDown, ChevronUp, Settings } from "lucide-react";
import { Fragment, useId, useState } from "react";
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Button } from "@/components/ui/button";
import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form.tsx";
import { Input } from "@/components/ui/input.tsx";
import type { ShellFormSchema } from "@/types/schema.ts";
import {ChevronDown, ChevronUp, Settings} from "lucide-react";
import {Fragment, useId, useState} from "react";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Button} from "@/components/ui/button";
import {FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form.tsx";
import {Input} from "@/components/ui/input.tsx";
import type {MemShellFormSchema} from "@/types/schema.ts";
export function OptionalClassFormField({ form }: Readonly<{ form: UseFormReturn<ShellFormSchema> }>) {
export function OptionalClassFormField({ form }: Readonly<{ form: UseFormReturn<MemShellFormSchema> }>) {
const { t } = useTranslation();
const [showAdvanced, setShowAdvanced] = useState(false);
const shellClassNameId = useId();
@@ -1,21 +1,21 @@
import { useQuery } from "@tanstack/react-query";
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormControl, FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
import { TabsContent } from "@/components/ui/tabs";
import { env } from "@/config";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {useQuery} from "@tanstack/react-query";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormControl, FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select";
import {TabsContent} from "@/components/ui/tabs";
import {env} from "@/config";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function CommandTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
const { data } = useQuery<{ encryptors: Array<string>; implementationClasses: Array<string> }>({
queryKey: ["commandConfigs"],
+15 -15
View File
@@ -1,22 +1,22 @@
import { t } from "i18next";
import { useId, useState } from "react";
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { Card, CardContent } from "@/components/ui/card";
import { FormControl, FormField, FormFieldItem, FormFieldLabel, FormMessage } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import { TabsContent } from "@/components/ui/tabs";
import { Textarea } from "@/components/ui/textarea";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {t} from "i18next";
import {useId, useState} from "react";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {Card, CardContent} from "@/components/ui/card";
import {FormControl, FormField, FormFieldItem, FormFieldLabel, FormMessage} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {Label} from "@/components/ui/label";
import {RadioGroup, RadioGroupItem} from "@/components/ui/radio-group";
import {TabsContent} from "@/components/ui/tabs";
import {Textarea} from "@/components/ui/textarea";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export default function CustomTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const [isFile, setIsFile] = useState(false);
const optionOneId = useId();
const optionTwoId = useId();
@@ -1,18 +1,18 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { TabsContent } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {TabsContent} from "@/components/ui/tabs";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function GodzillaTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
+11 -11
View File
@@ -1,18 +1,18 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { TabsContent } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {TabsContent} from "@/components/ui/tabs";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function NeoRegTabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
@@ -1,13 +1,13 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { FormControl, FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form.tsx";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select.tsx";
import type { ShellFormSchema } from "@/types/schema.ts";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {FormControl, FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form.tsx";
import {Select, SelectContent, SelectItem, SelectTrigger, SelectValue} from "@/components/ui/select.tsx";
import type {MemShellFormSchema} from "@/types/schema.ts";
export function ShellTypeFormField({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
+11 -11
View File
@@ -1,18 +1,18 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { Card, CardContent } from "@/components/ui/card";
import { FormField, FormFieldItem, FormFieldLabel } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { TabsContent } from "@/components/ui/tabs";
import type { ShellFormSchema } from "@/types/schema";
import { OptionalClassFormField } from "./classname-field";
import { ShellTypeFormField } from "./shelltype-field";
import { UrlPatternFormField } from "./urlpattern-field";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {Card, CardContent} from "@/components/ui/card";
import {FormField, FormFieldItem, FormFieldLabel} from "@/components/ui/form";
import {Input} from "@/components/ui/input";
import {TabsContent} from "@/components/ui/tabs";
import type {MemShellFormSchema} from "@/types/schema";
import {OptionalClassFormField} from "./classname-field";
import {ShellTypeFormField} from "./shelltype-field";
import {UrlPatternFormField} from "./urlpattern-field";
export function Suo5TabContent({
form,
shellTypes,
}: Readonly<{ form: UseFormReturn<ShellFormSchema>; shellTypes: Array<string> }>) {
}: Readonly<{ form: UseFormReturn<MemShellFormSchema>; shellTypes: Array<string> }>) {
const { t } = useTranslation();
return (
<FormProvider {...form}>
@@ -1,11 +1,11 @@
import { FormProvider, type UseFormReturn } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { FormField, FormFieldItem, FormFieldLabel, FormMessage } from "@/components/ui/form.tsx";
import { Input } from "@/components/ui/input.tsx";
import { shouldHidden } from "@/lib/utils";
import type { ShellFormSchema } from "@/types/schema.ts";
import {FormProvider, type UseFormReturn} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {FormField, FormFieldItem, FormFieldLabel, FormMessage} from "@/components/ui/form.tsx";
import {Input} from "@/components/ui/input.tsx";
import {shouldHidden} from "@/lib/utils";
import type {MemShellFormSchema} from "@/types/schema.ts";
export function UrlPatternFormField({ form }: Readonly<{ form: UseFormReturn<ShellFormSchema> }>) {
export function UrlPatternFormField({ form }: Readonly<{ form: UseFormReturn<MemShellFormSchema> }>) {
const { t } = useTranslation();
const shellType = form.watch("shellType");
return (