Add files via upload

This commit is contained in:
公明 authored and GitHub committed 2026-01-24 15:45:10 +08:00
1 parent 6321df417b
commit 42e9ad3bda
5 files changed
+75 -79

No files matched your search

+15 -2
View File
@@ -3273,7 +3273,12 @@ header {
} }
.pagination-container { .pagination-container {
margin-top: 10px; margin-top: 0;
}
/* 漏洞管理页面的分页栏间距优化 */
#vulnerability-pagination.pagination-fixed {
margin-top: 12px;
} }
/* Skills管理页面分页优化 */ /* Skills管理页面分页优化 */
@@ -3310,6 +3315,9 @@ header {
/* 确保底部左右角都是圆角 */ /* 确保底部左右角都是圆角 */
border-bottom-left-radius: 8px; border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
/* 添加边框和阴影,使圆角更明显 */
border: 1px solid var(--border-color);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
} }
.pagination-fixed .pagination { .pagination-fixed .pagination {
@@ -3331,6 +3339,8 @@ header {
/* 确保底部左右角都是圆角 */ /* 确保底部左右角都是圆角 */
border-bottom-left-radius: 8px; border-bottom-left-radius: 8px;
border-bottom-right-radius: 8px; border-bottom-right-radius: 8px;
/* 移除顶部边框,因为外层容器已有边框 */
border-top: none;
} }
/* 左侧:信息显示和每页数量选择器 - 更自然的设计 */ /* 左侧:信息显示和每页数量选择器 - 更自然的设计 */
@@ -3453,7 +3463,7 @@ header {
white-space: nowrap; white-space: nowrap;
font-weight: 400; font-weight: 400;
/* 添加圆角设计,四个角都是圆的 */ /* 添加圆角设计,四个角都是圆的 */
border-radius: 6px !important; border-radius: 8px !important;
background: var(--bg-secondary) !important; background: var(--bg-secondary) !important;
border: 1px solid var(--border-color) !important; border: 1px solid var(--border-color) !important;
display: inline-flex !important; display: inline-flex !important;
@@ -7754,6 +7764,7 @@ header {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
margin-bottom: 0;
} }
.vulnerability-card { .vulnerability-card {
@@ -9576,6 +9587,7 @@ header {
/* 限制标题最多显示2行 */ /* 限制标题最多显示2行 */
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
@@ -9593,6 +9605,7 @@ header {
/* 限制描述的最大行数,保持卡片整洁 */ /* 限制描述的最大行数,保持卡片整洁 */
display: -webkit-box; display: -webkit-box;
-webkit-line-clamp: 3; -webkit-line-clamp: 3;
line-clamp: 3;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
} }
+12 -1
View File
@@ -1260,7 +1260,8 @@ function renderProcessDetails(messageId, processDetails) {
addTimelineItem(timeline, eventType, { addTimelineItem(timeline, eventType, {
title: itemTitle, title: itemTitle,
message: detail.message || '', message: detail.message || '',
data: data data: data,
createdAt: detail.createdAt // 传递实际的事件创建时间
}); });
}); });
@@ -1980,6 +1981,16 @@ async function deleteConversation(conversationId, skipConfirm = false) {
addAttackChainButton(null); addAttackChainButton(null);
} }
// 更新缓存 - 立即删除,确保后续加载时能正确识别
delete conversationGroupMappingCache[conversationId];
// 同时从待保留映射中移除
delete pendingGroupMappings[conversationId];
// 如果当前在分组详情页面,重新加载分组对话
if (currentGroupId) {
await loadGroupConversations(currentGroupId);
}
// 刷新对话列表 // 刷新对话列表
loadConversations(); loadConversations();
} catch (error) { } catch (error) {
+20 -1
View File
@@ -835,7 +835,26 @@ function addTimelineItem(timeline, type, options) {
item.id = itemId; item.id = itemId;
item.className = `timeline-item timeline-item-${type}`; item.className = `timeline-item timeline-item-${type}`;
const time = new Date().toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit', second: '2-digit' }); // 使用传入的createdAt时间,如果没有则使用当前时间(向后兼容)
let eventTime;
if (options.createdAt) {
// 处理字符串或Date对象
if (typeof options.createdAt === 'string') {
eventTime = new Date(options.createdAt);
} else if (options.createdAt instanceof Date) {
eventTime = options.createdAt;
} else {
eventTime = new Date(options.createdAt);
}
// 如果解析失败,使用当前时间
if (isNaN(eventTime.getTime())) {
eventTime = new Date();
}
} else {
eventTime = new Date();
}
const time = eventTime.toLocaleTimeString('zh-CN', { hour: '2-digit', minute: '2-digit', second: '2-digit' });
let content = ` let content = `
<div class="timeline-item-header"> <div class="timeline-item-header">
+27 -74
View File
@@ -262,88 +262,41 @@ function renderVulnerabilityPagination() {
return; return;
} }
// 计算显示的页码范围 // 计算显示范围
let startPage = Math.max(1, currentPage - 2); const start = total === 0 ? 0 : (currentPage - 1) * pageSize + 1;
let endPage = Math.min(totalPages, currentPage + 2); const end = total === 0 ? 0 : Math.min(currentPage * pageSize, total);
// 确保显示5个页码(如果可能)
if (endPage - startPage < 4) {
if (startPage === 1) {
endPage = Math.min(totalPages, startPage + 4);
} else if (endPage === totalPages) {
startPage = Math.max(1, endPage - 4);
}
}
let paginationHTML = '<div class="pagination">'; let paginationHTML = '<div class="pagination">';
// 显示总数和当前范围 // 左侧:显示范围信息和每页数量选择器(参考Skills样式)
const startItem = (currentPage - 1) * pageSize + 1;
const endItem = Math.min(currentPage * pageSize, total);
paginationHTML += `<div class="pagination-info">显示 ${startItem}-${endItem} / 共 ${total} 条</div>`;
// 每页条数选择器(始终显示)
const savedPageSize = getVulnerabilityPageSize();
paginationHTML += ` paginationHTML += `
<div class="pagination-page-size"> <div class="pagination-info">
<label for="vulnerability-page-size-pagination">每页:</label> <span>显示 ${start}-${end} / 共 ${total} 条</span>
<select id="vulnerability-page-size-pagination" onchange="changeVulnerabilityPageSize()"> <label class="pagination-page-size">
<option value="10" ${savedPageSize === 10 ? 'selected' : ''}>10</option> 每页显示
<option value="20" ${savedPageSize === 20 ? 'selected' : ''}>20</option> <select id="vulnerability-page-size-pagination" onchange="changeVulnerabilityPageSize()">
<option value="50" ${savedPageSize === 50 ? 'selected' : ''}>50</option> <option value="10" ${pageSize === 10 ? 'selected' : ''}>10</option>
<option value="100" ${savedPageSize === 100 ? 'selected' : ''}>100</option> <option value="20" ${pageSize === 20 ? 'selected' : ''}>20</option>
</select> <option value="50" ${pageSize === 50 ? 'selected' : ''}>50</option>
<option value="100" ${pageSize === 100 ? 'selected' : ''}>100</option>
</select>
</label>
</div> </div>
`; `;
// 只有当有多页时才显示页码导航 // 右侧:分页按钮(参考Skills样式:首页、上一页、第X/Y页、下一页、末页)
if (totalPages > 1) { paginationHTML += `
paginationHTML += '<div class="pagination-controls">'; <div class="pagination-controls">
<button class="btn-secondary" onclick="loadVulnerabilities(1)" ${currentPage === 1 || total === 0 ? 'disabled' : ''}>首页</button>
// 上一页按钮 <button class="btn-secondary" onclick="loadVulnerabilities(${currentPage - 1})" ${currentPage === 1 || total === 0 ? 'disabled' : ''}>上一页</button>
if (currentPage > 1) { <span class="pagination-page">第 ${currentPage} / ${totalPages || 1} 页</span>
paginationHTML += `<button class="pagination-btn" onclick="loadVulnerabilities(${currentPage - 1})" title="上一页">‹</button>`; <button class="btn-secondary" onclick="loadVulnerabilities(${currentPage + 1})" ${currentPage >= totalPages || total === 0 ? 'disabled' : ''}>下一页</button>
} else { <button class="btn-secondary" onclick="loadVulnerabilities(${totalPages || 1})" ${currentPage >= totalPages || total === 0 ? 'disabled' : ''}>末页</button>
paginationHTML += '<button class="pagination-btn disabled" disabled>‹</button>'; </div>
} `;
// 第一页
if (startPage > 1) {
paginationHTML += `<button class="pagination-btn" onclick="loadVulnerabilities(1)">1</button>`;
if (startPage > 2) {
paginationHTML += '<span class="pagination-ellipsis">...</span>';
}
}
// 页码按钮
for (let i = startPage; i <= endPage; i++) {
if (i === currentPage) {
paginationHTML += `<button class="pagination-btn active">${i}</button>`;
} else {
paginationHTML += `<button class="pagination-btn" onclick="loadVulnerabilities(${i})">${i}</button>`;
}
}
// 最后一页
if (endPage < totalPages) {
if (endPage < totalPages - 1) {
paginationHTML += '<span class="pagination-ellipsis">...</span>';
}
paginationHTML += `<button class="pagination-btn" onclick="loadVulnerabilities(${totalPages})">${totalPages}</button>`;
}
// 下一页按钮
if (currentPage < totalPages) {
paginationHTML += `<button class="pagination-btn" onclick="loadVulnerabilities(${currentPage + 1})" title="下一页">›</button>`;
} else {
paginationHTML += '<button class="pagination-btn disabled" disabled>›</button>';
}
paginationHTML += '</div>';
}
paginationHTML += '</div>'; paginationHTML += '</div>';
paginationContainer.innerHTML = paginationHTML; paginationContainer.innerHTML = paginationHTML;
} }
+1 -1
View File
@@ -624,7 +624,7 @@
</div> </div>
<!-- 分页控件 --> <!-- 分页控件 -->
<div id="vulnerability-pagination"></div> <div id="vulnerability-pagination" class="pagination-container pagination-fixed"></div>
</div> </div>
</div> </div>