修复判断入口文件ip_check.php以及新增复制配置选项
This commit is contained in:
@@ -183,8 +183,32 @@ if(empty($_SESSION['password']) || $_SESSION['password'] != LOGIN_PASSWORD) {
|
||||
.cell-copy-link:hover { color: var(--log-primary-dark); }
|
||||
.cell-ip { font-family: 'SF Mono', 'Consolas', monospace; font-size: 12px; }
|
||||
.text-muted { color: #adb5bd; }
|
||||
.fp-hdata-cell { display: flex; flex-direction: column; gap: 4px; max-width: 100%; }
|
||||
.fp-hdata-summary { font-size: 11.5px; color: #475569; line-height: 1.35; }
|
||||
.fp-hdata-cell {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px 8px;
|
||||
max-width: 100%;
|
||||
min-height: 24px;
|
||||
}
|
||||
.fp-hdata-summary {
|
||||
flex: 1 1 140px;
|
||||
min-width: 0;
|
||||
font-size: 11.5px;
|
||||
color: #475569;
|
||||
line-height: 1.35;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.fp-hdata-actions {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
.fp-hdata-btn {
|
||||
display: inline-block;
|
||||
padding: 1px 8px;
|
||||
@@ -197,6 +221,28 @@ if(empty($_SESSION['password']) || $_SESSION['password'] != LOGIN_PASSWORD) {
|
||||
width: fit-content;
|
||||
}
|
||||
.fp-hdata-btn:hover { background: #d1ecf1; }
|
||||
/* 指纹 / API 审计列:解除 layui 固定行高,避免「判定详情」等按钮被裁切 */
|
||||
.log-table-wrap .layui-table-body td[data-field="fp_hdata_text"],
|
||||
.log-table-wrap .layui-table-body td[data-field="api_by_request_text"],
|
||||
.log-table-wrap .layui-table-body td[data-field="api_by_response_text"],
|
||||
.log-table-wrap .layui-table-body td[data-field="api_risk_request_text"],
|
||||
.log-table-wrap .layui-table-body td[data-field="api_risk_response_text"] {
|
||||
height: auto !important;
|
||||
vertical-align: top;
|
||||
}
|
||||
.log-table-wrap .layui-table-body td[data-field="fp_hdata_text"] > .layui-table-cell,
|
||||
.log-table-wrap .layui-table-body td[data-field="api_by_request_text"] > .layui-table-cell,
|
||||
.log-table-wrap .layui-table-body td[data-field="api_by_response_text"] > .layui-table-cell,
|
||||
.log-table-wrap .layui-table-body td[data-field="api_risk_request_text"] > .layui-table-cell,
|
||||
.log-table-wrap .layui-table-body td[data-field="api_risk_response_text"] > .layui-table-cell {
|
||||
height: auto !important;
|
||||
max-height: none !important;
|
||||
white-space: normal !important;
|
||||
overflow: visible !important;
|
||||
line-height: 1.35;
|
||||
padding-top: 7px !important;
|
||||
padding-bottom: 7px !important;
|
||||
}
|
||||
.fp-risk-explain { font-size: 13px; line-height: 1.55; color: #2c3e50; }
|
||||
.fp-risk-explain-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
|
||||
.fp-risk-tag { font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #eef2ff; color: #3730a3; font-weight: 600; }
|
||||
@@ -455,6 +501,26 @@ layui.use(function(){
|
||||
return '<span class="cloak-badge ' + cls + ' reason-badge" title="' + esc + '">' + short + '</span>';
|
||||
}
|
||||
|
||||
function formatJsonPretty(str) {
|
||||
try {
|
||||
return JSON.stringify(JSON.parse(str), null, 2);
|
||||
} catch (e) {
|
||||
return str;
|
||||
}
|
||||
}
|
||||
|
||||
function cellApiAudit(val, title) {
|
||||
if (val == null || val === '' || val === '-') {
|
||||
return '<span class="text-muted">—</span>';
|
||||
}
|
||||
var text = String(val);
|
||||
var short = text.length > 40 ? text.slice(0, 40) + '…' : text;
|
||||
return '<div class="fp-hdata-cell">'
|
||||
+ '<span class="fp-hdata-summary" title="' + escapeAttr(text) + '">' + escapeHtml(short) + '</span>'
|
||||
+ '<span class="fp-hdata-actions"><span class="fp-hdata-btn fp-hdata-btn-json" data-full="' + escapeAttr(text) + '" data-title="' + escapeAttr(title || 'API 数据') + '">查看 JSON</span></span>'
|
||||
+ '</div>';
|
||||
}
|
||||
|
||||
function cellFpHdata(d) {
|
||||
if (!d.fp_hdata && !d.fp_hdata_text) {
|
||||
return '<span class="text-muted">—</span>';
|
||||
@@ -465,14 +531,16 @@ layui.use(function(){
|
||||
if (summary) {
|
||||
html += '<span class="fp-hdata-summary" title="' + escapeAttr(summary) + '">' + escapeHtml(summary.length > 48 ? summary.slice(0, 48) + '…' : summary) + '</span>';
|
||||
}
|
||||
html += '<span class="fp-hdata-actions">';
|
||||
if (d.fp_hdata_explain_html) {
|
||||
html += '<span class="fp-hdata-btn" data-explain-id="' + escapeAttr(String(d.id)) + '">判定详情</span>';
|
||||
window.__fpExplainCache = window.__fpExplainCache || {};
|
||||
window.__fpExplainCache[d.id] = d.fp_hdata_explain_html;
|
||||
} else if (d.fp_hdata || d.fp_hdata_text) {
|
||||
}
|
||||
if (d.fp_hdata || d.fp_hdata_text) {
|
||||
html += '<span class="fp-hdata-btn fp-hdata-btn-raw" data-full="' + escapeAttr(d.fp_hdata || d.fp_hdata_text) + '">原始 hdata</span>';
|
||||
}
|
||||
html += '</div>';
|
||||
html += '</span></div>';
|
||||
return html;
|
||||
}
|
||||
|
||||
@@ -502,6 +570,10 @@ layui.use(function(){
|
||||
{ field: 'http_referer', title: 'HTTP-Referer', width: 260, defaultVisible: false, templet: function(d){ return cellLinkEllipsis(d.http_referer, LINK_CELL_MAX); } },
|
||||
{ field: 'accept_language_raw', title: 'Accept-Language', width: 220, defaultVisible: false, templet: function(d){ return cellEllipsis(d.accept_language_raw, 32); } },
|
||||
{ field: 'fp_hdata_text', title: '指纹 hdata', width: 360, defaultVisible: false, templet: function(d){ return cellFpHdata(d); } },
|
||||
{ field: 'api_by_request_text', title: 'byApi 请求参数', width: 300, defaultVisible: false, templet: function(d){ return cellApiAudit(d.api_by_request_text, 'byApi 请求参数 #' + d.id); } },
|
||||
{ field: 'api_by_response_text', title: 'byApi 返回值', width: 300, defaultVisible: false, templet: function(d){ return cellApiAudit(d.api_by_response_text, 'byApi 返回值 #' + d.id); } },
|
||||
{ field: 'api_risk_request_text', title: 'byApiRisk 请求参数', width: 300, defaultVisible: false, templet: function(d){ return cellApiAudit(d.api_risk_request_text, 'byApiRisk 请求参数 #' + d.id); } },
|
||||
{ field: 'api_risk_response_text', title: 'byApiRisk 返回值', width: 300, defaultVisible: false, templet: function(d){ return cellApiAudit(d.api_risk_response_text, 'byApiRisk 返回值 #' + d.id); } },
|
||||
];
|
||||
|
||||
var COLUMN_DEF_MAP = {};
|
||||
@@ -598,8 +670,27 @@ layui.use(function(){
|
||||
return [cols];
|
||||
}
|
||||
|
||||
function fixRichTableCellHeights() {
|
||||
var fields = ['fp_hdata_text', 'api_by_request_text', 'api_by_response_text', 'api_risk_request_text', 'api_risk_response_text'];
|
||||
fields.forEach(function(field) {
|
||||
$('.log-table-wrap .layui-table-body td[data-field="' + field + '"]').each(function() {
|
||||
var $cell = $(this).children('.layui-table-cell');
|
||||
$cell.css({ height: 'auto', whiteSpace: 'normal', overflow: 'visible' });
|
||||
$(this).css('height', 'auto');
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function reloadTableCols() {
|
||||
table.reload(TABLE_ID, { cols: buildCols(colConfig) });
|
||||
table.reload(TABLE_ID, {
|
||||
cols: buildCols(colConfig),
|
||||
done: function(res, curr, count) {
|
||||
if (typeof count === 'number') {
|
||||
$("#total_nums").text(count);
|
||||
}
|
||||
fixRichTableCellHeights();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function renderColSettingsList() {
|
||||
@@ -736,8 +827,15 @@ layui.use(function(){
|
||||
return 'color:#856404;background-color:#fff8e6;';
|
||||
}
|
||||
},
|
||||
lineStyle: function(row) {
|
||||
if (row.fp_hdata || row.fp_hdata_text || row.fp_hdata_explain_html) {
|
||||
return 'height:auto;';
|
||||
}
|
||||
return '';
|
||||
},
|
||||
done: function(res, curr, count, origin){
|
||||
$("#total_nums").text(count);
|
||||
fixRichTableCellHeights();
|
||||
},
|
||||
});
|
||||
|
||||
@@ -758,12 +856,16 @@ layui.use(function(){
|
||||
}
|
||||
var full = this.getAttribute('data-full') || '';
|
||||
if (full) {
|
||||
var popupTitle = this.getAttribute('data-title') || '指纹 hdata';
|
||||
var body = this.classList.contains('fp-hdata-btn-json')
|
||||
? escapeHtml(formatJsonPretty(full))
|
||||
: escapeHtml(full);
|
||||
layer.open({
|
||||
type: 1,
|
||||
title: '指纹 hdata',
|
||||
title: popupTitle,
|
||||
area: ['680px', '70vh'],
|
||||
shadeClose: true,
|
||||
content: '<pre style="padding:14px;margin:0;max-height:calc(70vh - 50px);overflow:auto;font-size:12px;white-space:pre-wrap;word-break:break-all;">' + escapeHtml(full) + '</pre>'
|
||||
content: '<pre style="padding:14px;margin:0;max-height:calc(70vh - 50px);overflow:auto;font-size:12px;white-space:pre-wrap;word-break:break-all;">' + body + '</pre>'
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user