From 49819156ab770b8fda9828dc054c41f369054afd Mon Sep 17 00:00:00 2001 From: ReaJason Date: Fri, 28 Feb 2025 23:25:28 +0800 Subject: [PATCH] fix(ui): generate fail --- .../javaweb/boot/dto/GenerateRequest.java | 5 + web/src/components/copyable-field.tsx | 2 +- web/src/components/main-config-card.tsx | 2 +- web/src/components/results/agent.tsx | 2 +- web/src/components/results/basic-info.tsx | 170 +++++++++--------- web/src/components/results/feedback-alert.tsx | 2 +- web/src/components/results/multi-packer.tsx | 2 +- web/src/components/tools/antsword-tab.tsx | 2 +- web/src/components/tools/behinder-tab.tsx | 2 +- web/src/components/tools/command-tab.tsx | 2 +- web/src/components/tools/godzilla-tab.tsx | 2 +- web/src/components/tools/neoreg-tab.tsx | 2 +- web/src/components/tools/suo5-tab.tsx | 2 +- web/src/i18n/en.json | 2 + web/src/i18n/zh-CN.json | 2 + web/src/types/shell.ts | 6 + 16 files changed, 113 insertions(+), 94 deletions(-) diff --git a/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java b/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java index d9bd53de..887a930b 100644 --- a/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java +++ b/boot/src/main/java/com/reajason/javaweb/boot/dto/GenerateRequest.java @@ -57,6 +57,11 @@ public class GenerateRequest { .headerName(shellToolConfig.getHeaderName()) .headerValue(shellToolConfig.getHeaderValue()) .build(); + case NeoreGeorg -> NeoreGeorgConfig.builder() + .shellClassName(shellToolConfig.getShellClassName()) + .headerName(shellToolConfig.getHeaderName()) + .headerValue(shellToolConfig.getHeaderValue()) + .build(); default -> throw new UnsupportedOperationException("unknown shell tool " + shellConfig.getShellTool()); }; } diff --git a/web/src/components/copyable-field.tsx b/web/src/components/copyable-field.tsx index e9afc8fa..416e696e 100644 --- a/web/src/components/copyable-field.tsx +++ b/web/src/components/copyable-field.tsx @@ -36,7 +36,7 @@ export function CopyableField({ label, value, text }: CopyableFieldProps) { return (
-
+
{value && ( diff --git a/web/src/components/main-config-card.tsx b/web/src/components/main-config-card.tsx index be0559d8..72d7403a 100644 --- a/web/src/components/main-config-card.tsx +++ b/web/src/components/main-config-card.tsx @@ -282,7 +282,7 @@ export function MainConfigCard({ }} className="w-full" > -
+
{shellTools.map((shellTool) => (
- - {(generateResult?.shellConfig.shellTool === "Behinder" || - generateResult?.shellConfig.shellTool === "Godzilla" || - generateResult?.shellConfig.shellTool === "Command" || - generateResult?.shellConfig.shellTool === "AntSword" || - generateResult?.shellConfig.shellTool === "Suo5") && ( -
- {/* Tool-specific fields */} - {generateResult?.shellConfig.shellTool === "Behinder" && ( - <> - - - - - - )} - {generateResult?.shellConfig.shellTool === "Godzilla" && ( - - - - - - - - )} - {generateResult?.shellConfig.shellTool === "Command" && ( - - - - )} - {generateResult?.shellConfig.shellTool === "Suo5" && ( - - - - )} - {generateResult?.shellConfig.shellTool === "AntSword" && ( - - - - - )} -
- )} +
+ {generateResult?.shellConfig.shellTool === ShellToolType.Behinder && ( + <> + + + + + + )} + {generateResult?.shellConfig.shellTool === ShellToolType.Godzilla && ( + + + + + + + + )} + {generateResult?.shellConfig.shellTool === ShellToolType.Command && ( + + + + )} + {generateResult?.shellConfig.shellTool === ShellToolType.Suo5 && ( + + + + )} + {generateResult?.shellConfig.shellTool === ShellToolType.AntSword && ( + + + + + )} + {generateResult?.shellConfig.shellTool === ShellToolType.NeoreGeorg && ( + + + + + )} +
HTTP HEADERS", "key": "Key", + "neoreGeorgHeader": "Custom Header", + "neoreGeorgKey": "Connection Key", "paramName": "Param Name", "pass": "Pass", "suo5Header": "AdvanceConfiguration -> Request Header" diff --git a/web/src/i18n/zh-CN.json b/web/src/i18n/zh-CN.json index 29101de9..aae688c8 100644 --- a/web/src/i18n/zh-CN.json +++ b/web/src/i18n/zh-CN.json @@ -103,6 +103,8 @@ "headerValue": "请求头值", "httpHeader": "请求信息 -> HTTP HEADERS", "key": "密钥", + "neoreGeorgHeader": "自定义请求头", + "neoreGeorgKey": "连接密钥", "paramName": "请求参数", "pass": "密码", "suo5Header": "高级配置 -> 请求头" diff --git a/web/src/types/shell.ts b/web/src/types/shell.ts index eb489563..c7ec15f6 100644 --- a/web/src/types/shell.ts +++ b/web/src/types/shell.ts @@ -53,6 +53,12 @@ export interface AntSwordShellToolConfig { headerValue?: string; } +export interface NeoreGeorgShellToolConfig { + shellClassName?: string; + headerName?: string; + headerValue?: string; +} + export interface InjectorConfig { injectorClassName?: string; classInheritance?: string;