mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 23:11:52 +08:00
style(web): format code
This commit is contained in:
@@ -1,41 +1,56 @@
|
||||
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, 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 {
|
||||
FormControl,
|
||||
FormDescription,
|
||||
FormField,
|
||||
FormFieldItem,
|
||||
FormFieldLabel,
|
||||
FormItem,
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card.tsx";
|
||||
import {
|
||||
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 MainConfig, type ServerConfig, ShellToolType} from "@/types/memshell";
|
||||
import type {MemShellFormSchema} from "@/types/schema.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" />,
|
||||
@@ -79,7 +94,9 @@ export default function MainConfigCard({
|
||||
const shellTool = form.watch("shellTool");
|
||||
const { t } = useTranslation();
|
||||
|
||||
const [serverVersionOptions, setServerVersionOptions] = useState(defaultServerVersionOptions);
|
||||
const [serverVersionOptions, setServerVersionOptions] = useState(
|
||||
defaultServerVersionOptions,
|
||||
);
|
||||
|
||||
// 处理一下 shellTypes 由于 server 或 shellTool 变更时无法正常为 form.shellType 赋值的问题
|
||||
useEffect(() => {
|
||||
@@ -95,7 +112,10 @@ export default function MainConfigCard({
|
||||
setShellToolMap(newShellToolMap);
|
||||
|
||||
const newShellTools = Object.keys(newShellToolMap);
|
||||
setShellTools([...newShellTools.map((tool) => tool as ShellToolType), ShellToolType.Custom]);
|
||||
setShellTools([
|
||||
...newShellTools.map((tool) => tool as ShellToolType),
|
||||
ShellToolType.Custom,
|
||||
]);
|
||||
|
||||
const currentShellTool = form.getValues("shellTool");
|
||||
|
||||
@@ -233,10 +253,6 @@ export default function MainConfigCard({
|
||||
[form, servers, shellToolMap],
|
||||
);
|
||||
|
||||
const debugId = useId();
|
||||
const bypassId = useId();
|
||||
const shrinkId = useId();
|
||||
|
||||
return (
|
||||
<FormProvider {...form}>
|
||||
<Card>
|
||||
|
||||
@@ -1,12 +1,22 @@
|
||||
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";
|
||||
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;
|
||||
@@ -49,7 +59,10 @@ export default function PackageConfigCard({
|
||||
|
||||
setOptions(mappedOptions);
|
||||
const currentValue = form.getValues("packingMethod");
|
||||
if (filteredOptions.length > 0 && (!currentValue || !filteredOptions.includes(currentValue))) {
|
||||
if (
|
||||
filteredOptions.length > 0 &&
|
||||
(!currentValue || !filteredOptions.includes(currentValue))
|
||||
) {
|
||||
form.setValue("packingMethod", filteredOptions[0]);
|
||||
}
|
||||
}, [form, packerConfig, server, shellType, t]);
|
||||
@@ -78,7 +91,10 @@ export default function PackageConfigCard({
|
||||
className="grid grid-cols-2 md:grid-cols-3"
|
||||
>
|
||||
{options.map(({ name, value }) => (
|
||||
<FormItem key={value} className="flex items-center space-x-3 space-y-0">
|
||||
<FormItem
|
||||
key={value}
|
||||
className="flex items-center space-x-3 space-y-0"
|
||||
>
|
||||
<FormControl>
|
||||
<RadioGroupItem value={value} id={value} />
|
||||
</FormControl>
|
||||
@@ -96,7 +112,9 @@ export default function PackageConfigCard({
|
||||
) : (
|
||||
<div className="flex items-center justify-center p-4 space-x-2">
|
||||
<div className="h-4 w-4 animate-spin rounded-full border-2 border-primary border-t-transparent" />
|
||||
<span className="text-sm text-muted-foreground">{t("loading")}</span>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
{t("loading")}
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
</CardContent>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import { ScrollTextIcon } from "lucide-react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "@/components/ui/card.tsx";
|
||||
|
||||
export function QuickUsage() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
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 GodzillaShellToolConfig,
|
||||
type MemShellResult,
|
||||
type NeoreGeorgShellToolConfig,
|
||||
ShellToolType,
|
||||
type Suo5ShellToolConfig,
|
||||
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";
|
||||
import { CopyableField } from "../../copyable-field";
|
||||
import { FeedbackAlert } from "./feedback-alert";
|
||||
|
||||
export function BasicInfo({ generateResult }: Readonly<{ generateResult?: MemShellResult }>) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {useTranslation} from "react-i18next";
|
||||
import {Button} from "@/components/ui/button";
|
||||
import {downloadBytes} from "@/lib/utils";
|
||||
import type {MemShellResult} from "@/types/memshell";
|
||||
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,
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CodeViewer from "@/components/code-viewer";
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
|
||||
export function MultiPackResult({
|
||||
allPackResults,
|
||||
packMethod,
|
||||
@@ -30,7 +37,9 @@ export function MultiPackResult({
|
||||
<Select
|
||||
onValueChange={(value) => {
|
||||
setSelectedMethod(value);
|
||||
setPackResult(allPackResults?.[value as keyof typeof allPackResults] ?? "");
|
||||
setPackResult(
|
||||
allPackResults?.[value as keyof typeof allPackResults] ?? "",
|
||||
);
|
||||
}}
|
||||
value={selectedMethod}
|
||||
>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {useTranslation} from "react-i18next";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import CodeViewer from "@/components/code-viewer";
|
||||
import type {MemShellResult} from "@/types/memshell";
|
||||
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,
|
||||
@@ -19,16 +19,32 @@ export function ResultComponent({
|
||||
const showCode = packMethod === "JSP";
|
||||
const isAgent = packMethod.startsWith("Agent");
|
||||
const isJar = packMethod === "Jar";
|
||||
const { t } = useTranslation();
|
||||
const { t } = useTranslation();
|
||||
if (allPackResults) {
|
||||
return <MultiPackResult allPackResults={allPackResults} packMethod={packMethod} />;
|
||||
return (
|
||||
<MultiPackResult
|
||||
allPackResults={allPackResults}
|
||||
packMethod={packMethod}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
if (isAgent) {
|
||||
return <AgentResult packMethod={packMethod} packResult={packResult ?? ""} generateResult={generateResult} />;
|
||||
return (
|
||||
<AgentResult
|
||||
packMethod={packMethod}
|
||||
packResult={packResult ?? ""}
|
||||
generateResult={generateResult}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (isJar) {
|
||||
return <JarResult packResult={packResult ?? ""} generateResult={generateResult} />;
|
||||
return (
|
||||
<JarResult
|
||||
packResult={packResult ?? ""}
|
||||
generateResult={generateResult}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (!isAgent && !isJar) {
|
||||
return (
|
||||
|
||||
@@ -1,15 +1,20 @@
|
||||
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 {MemShellResult} from "@/types/memshell";
|
||||
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,
|
||||
|
||||
@@ -1,13 +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 {MemShellFormSchema} 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,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,11 +1,15 @@
|
||||
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";
|
||||
import { ChevronDown, ChevronUp, Settings } from "lucide-react";
|
||||
import { Fragment, 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<MemShellFormSchema> }>) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -1,16 +1,27 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,17 +1,23 @@
|
||||
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";
|
||||
import { useState } from "react";
|
||||
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,
|
||||
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,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,8 +1,19 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
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";
|
||||
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,
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
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";
|
||||
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<MemShellFormSchema> }>) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
Reference in New Issue
Block a user