refactor: rename

1. 将枚举 Server 改为字符串常量,使得 memshell 和 probeshell 都能共用
2. 移除 memshell 模块直接内置在 generator 中
3. 通用类从 memshell 移动至 javaweb 下,命名修改,增加辨识度
This commit is contained in:
ReaJason
2025-08-12 10:47:45 +08:00
parent 66c6744145
commit d0f68f37e0
354 changed files with 1094 additions and 1387 deletions
@@ -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");