Update index.html

This commit is contained in:
公明 2025-04-22 18:37:52 +08:00 committed by GitHub
parent d26366abd8
commit 9b583bfe0d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,9 +4,9 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PrivHunterAI</title> <title>PrivHunterAI</title>
<!-- 由于网络原因Bootstrap 和 Font Awesome 的 CDN 链接可能无法正常加载 --> <!-- 引入 Bootstrap CSS -->
<!-- 如果需要使用这些资源,建议检查网络连接或使用其他可靠的 CDN 链接 --> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <!-- 引入 Font Awesome 图标库 -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css">
<style> <style>
body { body {
@ -24,6 +24,17 @@
overflow: hidden; overflow: hidden;
} }
.header::after {
content: "";
position: absolute;
bottom: -50px;
right: -50px;
width: 300px;
height: 300px;
background: rgba(255,255,255,0.1);
border-radius: 50%;
}
.header h1 { .header h1 {
font-size: 2.5rem; font-size: 2.5rem;
font-weight: bold; font-weight: bold;
@ -158,16 +169,16 @@
.data-table th { .data-table th {
padding: 1.5rem; padding: 1.5rem;
text-align: center; text-align: center;
max-width: 150px;
vertical-align: middle; vertical-align: middle;
max-width: 150px;
word-wrap: break-word; word-wrap: break-word;
border-bottom: 0.1rem solid #e0e0e0; border-bottom: 0.1rem solid #e0e0e0;
} }
.data-table td { .data-table td {
padding: 1.5rem; padding: 1.5rem;
text-align: center; text-align: center;
max-width: 150px;
vertical-align: middle; vertical-align: middle;
max-width: 150px;
word-wrap: break-word; word-wrap: break-word;
border-bottom: 0.1rem solid #e0e0e0; border-bottom: 0.1rem solid #e0e0e0;
} }
@ -225,22 +236,6 @@
border-radius: 5px; border-radius: 5px;
border: 1px solid #ddd; border: 1px solid #ddd;
} }
/* 展开详情样式 */
.details-expander {
cursor: pointer;
color: #4a90e2;
}
.details-panel {
display: none;
background-color: #f8f9fa;
padding: 15px;
border-radius: 5px;
margin-top: 10px;
}
.details-panel.active {
display: block;
}
</style> </style>
</head> </head>
<body> <body>
@ -298,10 +293,12 @@
<tr> <tr>
<th>Method</th> <th>Method</th>
<th>URL</th> <th>URL</th>
<th>Reqbody</th>
<th>RespBodyA</th>
<th>RespBodyB</th>
<th>Result</th> <th>Result</th>
<th>Reason</th> <th>Reason</th>
<th>Confidence</th> <th>Confidence</th>
<th>操作</th>
</tr> </tr>
</thead> </thead>
<tbody id="data-body"> <tbody id="data-body">
@ -387,7 +384,7 @@
if (paginatedData.length === 0) { if (paginatedData.length === 0) {
const emptyRow = document.createElement('tr'); const emptyRow = document.createElement('tr');
emptyRow.innerHTML = ` emptyRow.innerHTML = `
<td colspan="6" class="empty-state"> <td colspan="8" class="empty-state">
<i class="fas fa-search"></i> <i class="fas fa-search"></i>
<p>没有找到符合条件的数据</p> <p>没有找到符合条件的数据</p>
</td> </td>
@ -410,21 +407,14 @@
} }
row.innerHTML = ` row.innerHTML = `
<td>${item.method || '-'}</td> <td>${item.method || ''}</td>
<td>${item.url || '-'}</td> <td>${item.url || ''}</td>
<td>${item.result === 'unknown' ? '未知' : item.result === 'false' ? '安全' : '漏洞'}</td> <td>${item.reqbody || ''}</td>
<td>${item.reason || '-'}</td> <td>${item.respBodyA || ''}</td>
<td>${item.confidence || '-'}</td> <td>${item.respBodyB || ''}</td>
<td> <td>${item.result === 'unknown' ? '未知' : item.result=== 'false' ? '安全' : '漏洞'}</td>
<div class="details-expander" onclick="toggleDetails(this)"> <td>${item.reason || ''}</td>
<i class="fas fa-chevron-down"></i> 展开详情 <td>${item.confidence || ''}</td>
</div>
<div class="details-panel">
<strong>请求体:</strong>${item.reqbody || '-'}<br>
<strong>响应体A</strong>${item.respBodyA || '-'}<br>
<strong>响应体B</strong>${item.respBodyB || '-'}
</div>
</td>
`; `;
tableBody.appendChild(row); tableBody.appendChild(row);
}); });
@ -492,18 +482,6 @@
updatePagination(); updatePagination();
} }
// 切换详情面板的显示状态
function toggleDetails(element) {
const panel = element.nextElementSibling;
if (panel.classList.contains('active')) {
panel.classList.remove('active');
element.innerHTML = '<i class="fas fa-chevron-down"></i> 展开详情';
} else {
panel.classList.add('active');
element.innerHTML = '<i class="fas fa-chevron-up"></i> 收起详情';
}
}
// 初始化时尝试获取数据 // 初始化时尝试获取数据
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
fetchData(); fetchData();