mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-10 22:33:48 +02:00
Add files via upload
This commit is contained in:
@@ -2326,6 +2326,8 @@ html[data-theme="dark"] .openapi-doc-btn:hover {
|
||||
|
||||
.conversation-search-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
@@ -2378,8 +2380,6 @@ html[data-theme="dark"] .openapi-doc-btn:hover {
|
||||
.conversation-search-clear {
|
||||
position: absolute;
|
||||
right: 8px;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
@@ -2391,7 +2391,7 @@ html[data-theme="dark"] .openapi-doc-btn:hover {
|
||||
justify-content: center;
|
||||
color: var(--text-muted);
|
||||
transition: color 0.2s ease;
|
||||
border-radius: 4px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.conversation-search-clear:hover {
|
||||
@@ -2400,8 +2400,9 @@ html[data-theme="dark"] .openapi-doc-btn:hover {
|
||||
}
|
||||
|
||||
.conversation-search-clear svg {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.conversation-project-filter {
|
||||
@@ -22944,9 +22945,17 @@ html[data-theme="dark"] .vulnerability-details code.vuln-detail-field-value {
|
||||
border-color: var(--border-color);
|
||||
}
|
||||
|
||||
.vuln-detail-field__copy {
|
||||
.vuln-detail-field__actions {
|
||||
display: flex;
|
||||
flex-shrink: 0;
|
||||
align-items: flex-start;
|
||||
gap: 2px;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.vuln-detail-field__copy,
|
||||
.vuln-detail-field__action {
|
||||
flex-shrink: 0;
|
||||
padding: 6px;
|
||||
line-height: 0;
|
||||
border-radius: 6px;
|
||||
@@ -22956,7 +22965,8 @@ html[data-theme="dark"] .vulnerability-details code.vuln-detail-field-value {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.vuln-detail-field__copy:hover {
|
||||
.vuln-detail-field__copy:hover,
|
||||
.vuln-detail-field__action:hover {
|
||||
color: var(--accent-color);
|
||||
background: var(--bg-primary);
|
||||
border-color: var(--border-color);
|
||||
|
||||
@@ -2140,6 +2140,7 @@
|
||||
"projectBindFailed": "Failed to update project binding",
|
||||
"projectBindOk": "Project binding updated",
|
||||
"detailConversationId": "Conversation ID",
|
||||
"openConversation": "View conversation",
|
||||
"detailTaskId": "Task ID",
|
||||
"detailTaskQueueId": "Task queue ID",
|
||||
"detailConversationTag": "Conversation tag",
|
||||
|
||||
@@ -2128,6 +2128,7 @@
|
||||
"projectBindFailed": "绑定项目失败",
|
||||
"projectBindOk": "已更新项目绑定",
|
||||
"detailConversationId": "会话ID",
|
||||
"openConversation": "查看对话",
|
||||
"detailTaskId": "任务ID",
|
||||
"detailTaskQueueId": "任务队列ID",
|
||||
"detailConversationTag": "对话标签",
|
||||
|
||||
@@ -50,6 +50,29 @@ function scheduleChatConversationFromHash(delayMs) {
|
||||
}, delayMs);
|
||||
}
|
||||
|
||||
/** 跳转到指定对话:单次切页 + 单次加载,避免 hashchange 与手动 load 重复触发导致闪烁 */
|
||||
function navigateToConversation(conversationId) {
|
||||
const cid = String(conversationId || '').trim();
|
||||
if (!cid) return;
|
||||
const targetHash = 'chat?conversation=' + encodeURIComponent(cid);
|
||||
const alreadyOnChat = currentPage === 'chat';
|
||||
|
||||
if (window.location.hash.slice(1) !== targetHash) {
|
||||
history.replaceState(null, '', '#' + targetHash);
|
||||
}
|
||||
|
||||
if (!alreadyOnChat) {
|
||||
switchPage('chat');
|
||||
}
|
||||
|
||||
if (typeof loadConversation === 'function') {
|
||||
void loadConversation(cid);
|
||||
} else if (typeof window.loadConversation === 'function') {
|
||||
void window.loadConversation(cid);
|
||||
}
|
||||
}
|
||||
window.navigateToConversation = navigateToConversation;
|
||||
|
||||
// 初始化路由
|
||||
function initRouter() {
|
||||
// 从URL hash读取页面(如果有)
|
||||
|
||||
@@ -1436,7 +1436,7 @@ function renderVulnerabilities(vulnerabilities, renderOptions) {
|
||||
${vulnDetailProjectField(vuln)}
|
||||
${vuln.type ? vulnDetailField(vulnT('vulnerabilityPage.detailType'), vuln.type, false) : ''}
|
||||
${vuln.target ? vulnDetailField(vulnT('vulnerabilityPage.detailTarget'), vuln.target, false) : ''}
|
||||
${vulnDetailField(vulnT('vulnerabilityPage.detailConversationId'), vuln.conversation_id, true)}
|
||||
${vulnDetailConversationField(vuln.conversation_id)}
|
||||
${vuln.task_id ? vulnDetailField(vulnT('vulnerabilityPage.detailTaskId'), vuln.task_id, true) : ''}
|
||||
${vuln.task_queue_id ? vulnDetailField(vulnT('vulnerabilityPage.detailTaskQueueId'), vuln.task_queue_id, true) : ''}
|
||||
${vuln.conversation_tag ? vulnDetailField(vulnT('vulnerabilityPage.detailConversationTag'), vuln.conversation_tag, false) : ''}
|
||||
@@ -2025,10 +2025,39 @@ function vulnDetailField(label, value, asCode) {
|
||||
</button>`;
|
||||
return `<div class="vuln-detail-field">
|
||||
<div class="vuln-detail-field__label">${escapeHtml(label)}</div>
|
||||
<div class="vuln-detail-field__row">${valueEl}${copyBtn}</div>
|
||||
<div class="vuln-detail-field__row">${valueEl}<div class="vuln-detail-field__actions">${copyBtn}</div></div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function vulnDetailConversationField(conversationId) {
|
||||
if (conversationId === undefined || conversationId === null || String(conversationId).trim() === '') {
|
||||
return '';
|
||||
}
|
||||
const s = String(conversationId).trim();
|
||||
const enc = encodeURIComponent(s);
|
||||
const copyTitle = escapeHtml(vulnT('common.copy'));
|
||||
const openTitle = escapeHtml(vulnT('vulnerabilityPage.openConversation'));
|
||||
const qId = JSON.stringify(s).replace(/"/g, '"');
|
||||
const openBtn = `<button type="button" class="vuln-detail-field__action" onclick="openVulnerabilityConversation(${qId})" title="${openTitle}" aria-label="${openTitle}">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
|
||||
</button>`;
|
||||
const copyBtn = `<button type="button" class="vuln-detail-field__copy" onclick="vulnerabilityCopyEncoded(event, '${enc}')" title="${copyTitle}" aria-label="${copyTitle}">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
|
||||
</button>`;
|
||||
return `<div class="vuln-detail-field">
|
||||
<div class="vuln-detail-field__label">${escapeHtml(vulnT('vulnerabilityPage.detailConversationId'))}</div>
|
||||
<div class="vuln-detail-field__row"><code class="vuln-detail-field-value">${escapeHtml(s)}</code><div class="vuln-detail-field__actions">${openBtn}${copyBtn}</div></div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
function openVulnerabilityConversation(conversationId) {
|
||||
if (typeof navigateToConversation === 'function') {
|
||||
navigateToConversation(conversationId);
|
||||
} else if (typeof window.navigateToConversation === 'function') {
|
||||
window.navigateToConversation(conversationId);
|
||||
}
|
||||
}
|
||||
|
||||
function vulnNarrativeSection(label, value, options) {
|
||||
if (value === undefined || value === null || String(value).trim() === '') return '';
|
||||
const opts = options || {};
|
||||
@@ -2382,3 +2411,4 @@ window.setVulnerabilityIdFilter = setVulnerabilityIdFilter;
|
||||
window.bindVulnerabilityProject = bindVulnerabilityProject;
|
||||
window.buildVulnerabilityProjectOptionsHtml = buildVulnerabilityProjectOptionsHtml;
|
||||
window.changeVulnerabilityStatus = changeVulnerabilityStatus;
|
||||
window.openVulnerabilityConversation = openVulnerabilityConversation;
|
||||
|
||||
@@ -825,9 +825,9 @@
|
||||
onkeypress="if(event.key === 'Enter') handleConversationSearch(this.value)" />
|
||||
<button class="conversation-search-clear" id="conversation-search-clear"
|
||||
onclick="clearConversationSearch()" style="display: none;" data-i18n="common.clearSearch" data-i18n-attr="title" title="清除搜索">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<circle cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2"/>
|
||||
<path d="M15 9l-6 6M9 9l6 6" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">
|
||||
<circle cx="8" cy="8" r="7" fill="currentColor" fill-opacity="0.2"/>
|
||||
<path d="M5.25 5.25l5.5 5.5M10.75 5.25l-5.5 5.5" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
@@ -5308,7 +5308,7 @@
|
||||
<script src="/static/js/skills.js"></script>
|
||||
<script src="/static/js/fact-graph.js"></script>
|
||||
<script src="/static/js/projects.js"></script>
|
||||
<script src="/static/js/vulnerability.js?v=12"></script>
|
||||
<script src="/static/js/vulnerability.js?v=14"></script>
|
||||
<script src="/static/js/webshell.js"></script>
|
||||
<script src="/static/js/chat-files.js"></script>
|
||||
<script src="/static/js/tasks.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user