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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user