feat: add loading component

This commit is contained in:
ReaJason
2025-02-20 23:52:02 +08:00
parent 5148414ca8
commit 3acab6e620
3 changed files with 56 additions and 47 deletions
+36 -29
View File
@@ -61,35 +61,42 @@ export function PackageConfigCard({
</CardTitle>
</CardHeader>
<CardContent>
<FormProvider {...form}>
<FormField
control={form.control}
name="packingMethod"
render={({ field }) => (
<FormItem className="space-y-3">
<FormLabel className="h-6 flex items-center gap-1">{t("packageConfig.title")}</FormLabel>
<FormControl>
<RadioGroup
onValueChange={field.onChange}
value={field.value}
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">
<FormControl>
<RadioGroupItem value={value} id={value} />
</FormControl>
<FormLabel className="text-xs" htmlFor={value}>
{name}
</FormLabel>
</FormItem>
))}
</RadioGroup>
</FormControl>
</FormItem>
)}
/>
</FormProvider>
{options.length > 0 ? (
<FormProvider {...form}>
<FormField
control={form.control}
name="packingMethod"
render={({ field }) => (
<FormItem className="space-y-3">
<FormLabel className="h-6 flex items-center gap-1">{t("packageConfig.title")}</FormLabel>
<FormControl>
<RadioGroup
onValueChange={field.onChange}
value={field.value}
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">
<FormControl>
<RadioGroupItem value={value} id={value} />
</FormControl>
<FormLabel className="text-xs" htmlFor={value}>
{name}
</FormLabel>
</FormItem>
))}
</RadioGroup>
</FormControl>
</FormItem>
)}
/>
</FormProvider>
) : (
<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>
</div>
)}
</CardContent>
</Card>
);
+10 -9
View File
@@ -26,6 +26,7 @@
"title3": "Injector Class",
"usage": "Usage"
},
"loading": "Loading...",
"mainConfig": {
"bypassJavaModule": "Bypass Java Module",
"debug": "Debug Mode",
@@ -49,6 +50,8 @@
"Freemarker": "Freemarker",
"Groovy": "Groovy",
"GzipBase64": "GzipBase64",
"Hessian2Deserialize": "Hessian2Deserialize",
"HessianDeserialize": "HessianDeserialize",
"JEXL": "JEXL",
"JSP": "JSP",
"JXPath": "JXPath",
@@ -61,9 +64,7 @@
"ScriptEngine": "ScriptEngine",
"SpEL": "SpEL",
"Velocity": "Velocity",
"XxlJob": "XXL-JOB Executor",
"Hessian2Deserialize": "Hessian2Deserialize",
"HessianDeserialize": "HessianDeserialize"
"XxlJob": "XXL-JOB Executor"
},
"title": "Package Method"
},
@@ -111,19 +112,19 @@
"tips": {
"controllerUrlPattern": "ControllerHandler type requires a specific URL Pattern, e.g., /hello_controller",
"decompileTip": "Decompilation is still under development, so the current only sees the base64 encoding format",
"download-jattach": "Download the Jattach tool (consider it directly encapsulated in Jar later)",
"execute-command": "Execute the command to inject: /path/to/jattach pid load instrument false /path/to/agent.jar",
"get-pid": "Get the process pid of the target jvm (use jps or ps)",
"handlerUrlPattern": "HandlerMethod/HandlerFunction type requires a specific URL Pattern, e.g., /hello_handler",
"jreTip": "Target JRE version, generally speaking, Java 6 is the default version for maximum compatibility, and Java high versions can load low version bytecode.",
"jreTip2": "In specific cases, such as JDK8 being able to use lambda expressions, and JDK9 and above having module restrictions, a specific version is required.",
"move-to-container": "Move MemShellAgent.jar and jattach to the container (if the test environment uses a container deployment)",
"servletUrlPattern": "Servlet type requires a specific URL Pattern, e.g., /hello_servlet",
"shellBytesEmpty": "Shell bytes is empty, please generate shell first",
"shellToolNotSelected": "Please select a shell tool type first",
"targetServerNotFound": "Target server not found?",
"targetServerRequest": "Request",
"waitingForGeneration": "// Waiting for generation...",
"download-jattach": "Download the Jattach tool (consider it directly encapsulated in Jar later)",
"move-to-container": "Move MemShellAgent.jar and jattach to the container (if the test environment uses a container deployment)",
"get-pid": "Get the process pid of the target jvm (use jps or ps)",
"execute-command": "Execute the command to inject: /path/to/jattach pid load instrument false /path/to/agent.jar",
"try-to-use-shell": "Try to use the memory shell"
"try-to-use-shell": "Try to use the memory shell",
"waitingForGeneration": "// Waiting for generation..."
}
}
+10 -9
View File
@@ -26,6 +26,7 @@
"title3": "注入器类",
"usage": "使用方法"
},
"loading": "加载中...",
"mainConfig": {
"bypassJavaModule": "绕过 Java 模块限制",
"debug": "调试模式",
@@ -49,6 +50,8 @@
"Freemarker": "Freemarker",
"Groovy": "Groovy",
"GzipBase64": "GzipBase64",
"Hessian2Deserialize": "Hessian2 反序列化",
"HessianDeserialize": "Hessian 反序列化",
"JEXL": "JEXL 表达式",
"JSP": "JSP",
"JXPath": "JXPath 表达式",
@@ -61,9 +64,7 @@
"ScriptEngine": "内置脚本引擎",
"SpEL": "SpEL 表达式",
"Velocity": "Velocity",
"XxlJob": "XXL-JOB Executor",
"Hessian2Deserialize": "Hessian2 反序列化",
"HessianDeserialize": "Hessian 反序列化"
"XxlJob": "XXL-JOB Executor"
},
"title": "打包方式"
},
@@ -111,19 +112,19 @@
"tips": {
"controllerUrlPattern": "ControllerHandler 类型的需要填写具体的 URL Pattern,例如 /hello_controller",
"decompileTip": "反编译还在开发中,因此当前仅能看到 base64 编码格式",
"download-jattach": "下载 Jattach 工具(后期考虑直接封装在 Jar 中)",
"execute-command": "执行命令进行注入:/path/to/jattach pid load instrument false /path/to/agent.jar",
"get-pid": "获取目标 jvm 的进程 pid (使用 jps 或 ps",
"handlerUrlPattern": "HandlerMethod/HandlerFunction 类型的需要填写具体的 URL Pattern,例如 /hello_handler",
"jreTip": "目标 JRE 版本,一般而言为了最大的兼容性,默认 Java 6 即可,Java 高版本能加载低版本的字节码。",
"jreTip2": "特定情况下,例如 JDK8 才能使用 lambda 表达式,JDK9 以上存在模块限制时才需要选择特定的版本。",
"move-to-container": "将 MemShellAgent.jar 和 jattach 移动到容器中(如果测试环境使用容器部署)",
"servletUrlPattern": "Servlet 类型的需要填写具体的 URL Pattern,例如 /hello_servlet",
"shellBytesEmpty": "内存马字节码为空,无法下载, 请先生成内存马",
"shellToolNotSelected": "请先选择内存马工具类型",
"targetServerNotFound": "找不到目标服务 ",
"targetServerRequest": "请求适配",
"waitingForGeneration": "// 等待填写参数生成中...",
"download-jattach": "下载 Jattach 工具(后期考虑直接封装在 Jar 中)",
"move-to-container": "将 MemShellAgent.jar 和 jattach 移动到容器中(如果测试环境使用容器部署)",
"get-pid": "获取目标 jvm 的进程 pid (使用 jps 或 ps",
"execute-command": "执行命令进行注入:/path/to/jattach pid load instrument false /path/to/agent.jar",
"try-to-use-shell": "尝试利用内存马"
"try-to-use-shell": "尝试利用内存马",
"waitingForGeneration": "// 等待填写参数生成中..."
}
}