style(web): format code

This commit is contained in:
ReaJason
2025-08-13 23:53:40 +08:00
parent cf05f5f79e
commit 7ce71856d3
40 changed files with 551 additions and 308 deletions
+26 -20
View File
@@ -1,27 +1,31 @@
import {useQuery} from "@tanstack/react-query";
import {LoaderCircle, WandSparklesIcon} from "lucide-react";
import {useState, useTransition} from "react";
import {useForm} from "react-hook-form";
import {useTranslation} from "react-i18next";
import {useLoaderData} from "react-router-dom";
import {toast} from "sonner";
import { useQuery } from "@tanstack/react-query";
import { LoaderCircle, WandSparklesIcon } from "lucide-react";
import { useState, useTransition } from "react";
import { useForm } from "react-hook-form";
import { useTranslation } from "react-i18next";
import { useLoaderData } from "react-router-dom";
import { toast } from "sonner";
import MainConfigCard from "@/components/memshell/main-config-card";
import PackageConfigCard from "@/components/memshell/package-config-card";
import ShellResult from "@/components/memshell/shell-result";
import {Button} from "@/components/ui/button";
import {Form} from "@/components/ui/form.tsx";
import {env} from "@/config.ts";
import { Button } from "@/components/ui/button";
import { Form } from "@/components/ui/form.tsx";
import { env } from "@/config.ts";
import {
type APIErrorResponse,
type MainConfig,
type MemShellGenerateResponse,
type MemShellResult,
type PackerConfig,
type ServerConfig,
ShellToolType,
type APIErrorResponse,
type MainConfig,
type MemShellGenerateResponse,
type MemShellResult,
type PackerConfig,
type ServerConfig,
ShellToolType,
} from "@/types/memshell";
import {type MemShellFormSchema, memShellFormSchema, useYupValidationResolver} from "@/types/schema.ts";
import {transformToPostData} from "@/utils/transformer.ts";
import {
type MemShellFormSchema,
memShellFormSchema,
useYupValidationResolver,
} from "@/types/schema.ts";
import { transformToPostData } from "@/utils/transformer.ts";
export default function MemShellPage() {
const urlParams = useLoaderData();
@@ -78,7 +82,9 @@ export default function MemShellPage() {
});
const [packResult, setPackResult] = useState<string | undefined>();
const [allPackResults, setAllPackResults] = useState<Map<string, string> | undefined>();
const [allPackResults, setAllPackResults] = useState<
Map<string, string> | undefined
>();
const [generateResult, setGenerateResult] = useState<MemShellResult>();
const [packMethod, setPackMethod] = useState<string>("");
const [isActionPending, startTransition] = useTransition();
+21 -9
View File
@@ -8,13 +8,22 @@ import MainConfigCard from "@/components/probeshell/main-config-card";
import PackageConfigCard from "@/components/probeshell/package-config-card";
import ShellResult from "@/components/probeshell/shell-result";
import { Button } from "@/components/ui/button";
import {
Form,
} from "@/components/ui/form";
import { Form } from "@/components/ui/form";
import { env } from "@/config";
import type { APIErrorResponse, PackerConfig, ServerConfig } from "@/types/memshell";
import type { ProbeShellGenerateResponse, ProbeShellResult } from "@/types/probeshell";
import { type ProbeShellFormSchema, probeShellFormSchema, useYupValidationProbeResolver } from "@/types/schema";
import type {
APIErrorResponse,
PackerConfig,
ServerConfig,
} from "@/types/memshell";
import type {
ProbeShellGenerateResponse,
ProbeShellResult,
} from "@/types/probeshell";
import {
type ProbeShellFormSchema,
probeShellFormSchema,
useYupValidationProbeResolver,
} from "@/types/schema";
import { transformToProbePostData } from "@/utils/transformer";
export default function ProbeShellGenerator() {
@@ -46,18 +55,21 @@ export default function ProbeShellGenerator() {
reqParamName: "payload",
reqHeaderName: "X-PAYLOAD",
seconds: 5,
sleepServer: "Tomcat"
sleepServer: "Tomcat",
shrink: true,
},
});
const [packResult, setPackResult] = useState<string | undefined>();
const [allPackResults, setAllPackResults] = useState<Map<string, string> | undefined>();
const [allPackResults, setAllPackResults] = useState<
Map<string, string> | undefined
>();
const [generateResult, setGenerateResult] = useState<ProbeShellResult>();
const [packMethod, setPackMethod] = useState<string>("");
const [isActionPending, startTransition] = useTransition();
const onSubmit = async (data: ProbeShellFormSchema) => {
startTransition(async () => {
startTransition(async () => {
try {
const postData = transformToProbePostData(data);
const response = await fetch(`${env.API_URL}/probe/generate`, {