mirror of
https://github.com/RuoJi6/ARTEX.git
synced 2026-11-21 09:01:50 +08:00
feat: 复用漏洞报告撰写对话
This commit is contained in:
1 parent
af2f9e3560
commit
9745e7d019
7 files changed
+60
-22
No files matched your search
@@ -26,6 +26,7 @@ export function FindingAutoChat({
|
||||
agentLabel = "Auto Agent",
|
||||
promptPlaceholder = "询问这个漏洞…",
|
||||
modal = false,
|
||||
initialConversationId,
|
||||
open,
|
||||
onOpenChange,
|
||||
}: {
|
||||
@@ -35,6 +36,7 @@ export function FindingAutoChat({
|
||||
agentLabel?: string;
|
||||
promptPlaceholder?: string;
|
||||
modal?: boolean;
|
||||
initialConversationId?: number;
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
}) {
|
||||
@@ -70,6 +72,10 @@ export function FindingAutoChat({
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!open || conversation || manualEmpty) return;
|
||||
if (initialConversationId && initialConversationId > 0) {
|
||||
setConversation({ id: initialConversationId, agent_key: agentKey, title: `漏洞 #${findingId} · ${safeTitle}`, created_at: "", updated_at: "" });
|
||||
return;
|
||||
}
|
||||
const storedID = Number(window.localStorage.getItem(storageKey));
|
||||
if (Number.isSafeInteger(storedID) && storedID > 0) {
|
||||
setConversation({
|
||||
@@ -82,7 +88,7 @@ export function FindingAutoChat({
|
||||
return;
|
||||
}
|
||||
void createConversation();
|
||||
}, [conversation, createConversation, manualEmpty, open, safeTitle, storageKey]);
|
||||
}, [conversation, createConversation, initialConversationId, manualEmpty, open, safeTitle, storageKey]);
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!historyOpen && !running) return;
|
||||
|
||||
Reference in new issue
Block a user