mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-05 03:58:16 +02:00
Add files via upload
This commit is contained in:
@@ -2579,3 +2579,141 @@ header {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* ==================== 攻击链可视化样式 ==================== */
|
||||
|
||||
.attack-chain-modal-content {
|
||||
max-width: 95vw;
|
||||
width: 95vw;
|
||||
height: 90vh;
|
||||
max-height: 90vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.attack-chain-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.attack-chain-controls {
|
||||
padding: 16px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
gap: 16px;
|
||||
background: var(--bg-secondary);
|
||||
}
|
||||
|
||||
.attack-chain-info {
|
||||
font-size: 0.875rem;
|
||||
color: var(--text-secondary);
|
||||
}
|
||||
|
||||
.attack-chain-legend {
|
||||
display: flex;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.legend-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.legend-color {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.attack-chain-container {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
background: var(--bg-primary);
|
||||
border: 1px solid var(--border-color);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.attack-chain-details {
|
||||
padding: 16px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
background: var(--bg-secondary);
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.attack-chain-details h3 {
|
||||
margin: 0 0 12px 0;
|
||||
font-size: 1rem;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.node-detail-item {
|
||||
margin-bottom: 8px;
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
|
||||
.node-detail-item strong {
|
||||
color: var(--text-primary);
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
.node-detail-item code {
|
||||
background: var(--bg-tertiary);
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
|
||||
font-size: 0.8125rem;
|
||||
}
|
||||
|
||||
.metadata-pre {
|
||||
background: var(--bg-tertiary);
|
||||
padding: 8px;
|
||||
border-radius: 4px;
|
||||
font-size: 0.8125rem;
|
||||
overflow-x: auto;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.modal-header-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.loading-spinner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.empty-message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: var(--text-secondary);
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
color: var(--error-color);
|
||||
font-size: 1rem;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
+1040
-12
File diff suppressed because it is too large
Load Diff
@@ -304,10 +304,73 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 攻击链可视化模态框 -->
|
||||
<div id="attack-chain-modal" class="modal">
|
||||
<div class="modal-content attack-chain-modal-content">
|
||||
<div class="modal-header">
|
||||
<h2>攻击链可视化</h2>
|
||||
<div class="modal-header-actions">
|
||||
<button class="btn-secondary" onclick="regenerateAttackChain()" title="重新生成攻击链(包含最新对话内容)" style="background: #007bff; color: white; border-color: #007bff; margin-right: 8px;">
|
||||
🔄 重新生成
|
||||
</button>
|
||||
<button class="btn-secondary" onclick="exportAttackChain('png')" title="导出为PNG">
|
||||
📥 PNG
|
||||
</button>
|
||||
<button class="btn-secondary" onclick="exportAttackChain('svg')" title="导出为SVG">
|
||||
📥 SVG
|
||||
</button>
|
||||
<button class="btn-secondary" onclick="refreshAttackChain()" title="刷新当前攻击链(不重新生成)">
|
||||
↻ 刷新
|
||||
</button>
|
||||
<span class="modal-close" onclick="closeAttackChainModal()">×</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body attack-chain-body">
|
||||
<div class="attack-chain-controls">
|
||||
<div class="attack-chain-info">
|
||||
<span id="attack-chain-stats">节点: 0 | 边: 0</span>
|
||||
</div>
|
||||
<div class="attack-chain-legend">
|
||||
<div class="legend-item">
|
||||
<span class="legend-color" style="background: #ff4444;"></span>
|
||||
<span>高风险 (80-100)</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-color" style="background: #ff8800;"></span>
|
||||
<span>中高风险 (60-79)</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-color" style="background: #ffbb00;"></span>
|
||||
<span>中风险 (40-59)</span>
|
||||
</div>
|
||||
<div class="legend-item">
|
||||
<span class="legend-color" style="background: #88cc00;"></span>
|
||||
<span>低风险 (0-39)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="attack-chain-container" class="attack-chain-container">
|
||||
<div class="loading-spinner">加载中...</div>
|
||||
</div>
|
||||
<div id="attack-chain-details" class="attack-chain-details" style="display: none;">
|
||||
<h3>节点详情</h3>
|
||||
<div id="attack-chain-details-content"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Marked.js for Markdown parsing -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/marked@11.1.1/marked.min.js"></script>
|
||||
<!-- DOMPurify for HTML sanitization to prevent XSS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.0.8/dist/purify.min.js"></script>
|
||||
<!-- Cytoscape.js for attack chain visualization -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/cytoscape@3.27.0/dist/cytoscape.min.js"></script>
|
||||
<!-- dagre layout dependencies -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/graphlib@2.1.8/dist/graphlib.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/dagre@0.8.5/dist/dagre.min.js"></script>
|
||||
<!-- dagre layout for hierarchical layout -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/cytoscape-dagre@2.5.0/cytoscape-dagre.min.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user