feat: tomcat agent support jdk6

This commit is contained in:
ReaJason
2025-01-03 02:16:51 +08:00
parent ceacef5cf3
commit 550ea678e5
10 changed files with 86 additions and 74 deletions
+1 -45
View File
@@ -1,14 +1,4 @@
import { UrlPatternTip } from "@/components/tips/url-pattern-tip.tsx";
import {
AlertDialog,
AlertDialogAction,
AlertDialogCancel,
AlertDialogContent,
AlertDialogDescription,
AlertDialogFooter,
AlertDialogHeader,
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card.tsx";
import { FormControl, FormDescription, FormField, FormItem, FormLabel } from "@/components/ui/form.tsx";
import { Input } from "@/components/ui/input.tsx";
@@ -44,8 +34,6 @@ export function MainConfigCard({
const [shellToolMap, setShellToolMap] = useState<{ [toolName: string]: string[] }>();
const [shellTools, setShellTools] = useState<string[]>([]);
const [shellTypes, setShellTypes] = useState<string[]>([]);
const [openAgentConfirm, setOpenAgentConfirm] = useState(false);
const [currentShellType, setCurrentShellType] = useState<string>("");
const handleServerChange = (value: string) => {
if (mainConfig) {
@@ -247,39 +235,7 @@ export function MainConfigCard({
render={({ field }) => (
<FormItem className="space-y-1">
<FormLabel></FormLabel>
<AlertDialog open={openAgentConfirm} onOpenChange={setOpenAgentConfirm}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Agent Java8 </AlertDialogTitle>
<AlertDialogDescription> JRE Java8</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
<AlertDialogCancel>Cancel</AlertDialogCancel>
<AlertDialogAction
onClick={() => {
form.setValue("targetJdkVersion", "52");
form.setValue("shellType", currentShellType);
}}
>
Confirm
</AlertDialogAction>
</AlertDialogFooter>
</AlertDialogContent>
</AlertDialog>
<Select
onValueChange={(v) => {
if (
v.startsWith("Agent") &&
Number.parseInt(form.getValues("targetJdkVersion") as string) === 50
) {
setOpenAgentConfirm(true);
setCurrentShellType(v);
} else {
field.onChange(v);
}
}}
value={field.value}
>
<Select onValueChange={field.onChange} value={field.value}>
<FormControl>
<SelectTrigger className="h-8">
<SelectValue placeholder="请选择" />
-5
View File
@@ -81,11 +81,6 @@ function IndexComponent() {
return false;
}
if (values.shellType.startsWith("Agent") && values.targetJdkVersion === "50") {
toast.warning("Agent 注入方式当前仅支持 Java8 以上");
return false;
}
if (!values.shellType.startsWith("Agent") && values.packingMethod === "AgentJar") {
toast.warning("Agent 注入方式当前仅支持 Tomcat,只有 Agent 注入方式才可使用 AgentJar 打包方式");
return false;