fix(admin): 修复监控规则表单提交失效与页面转义及搜索入口缺陷

This commit is contained in:
augushong
2026-08-15 11:44:33 +08:00
parent 5a41f6a425
commit 4d71c6553a
6 changed files with 11 additions and 9 deletions

View File

@@ -16,7 +16,6 @@ $(function () {
ua.table.render({
init: init,
toolbar: [],
defaultToolbar: ['filter'],
cols: [[
{field: 'request_time', title: '请求时间', width: 170, sort: true, search: 'range', templet: formatRequestTime},
{
@@ -40,9 +39,11 @@ $(function () {
},
{
field: 'url', title: 'URL', minWidth: 220, searchOp: '%*%', templet: function (d) {
var u = d.url || '';
var u = String(d.url || '');
var esc = u.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
var short = u.length > 50 ? u.substring(0, 50) + '…' : u;
return '<span title="' + u.replace(/"/g, '&quot;') + '">' + (short === '' ? '/' : short) + '</span>';
short = short.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
return '<span title="' + esc + '">' + (short === '' ? '/' : short) + '</span>';
}
},
{field: 'node_id', title: '节点', width: 160, search: 'select', searchOp: '=', selectList: ua.getDataBrage('select_list_node_id') || {}},

View File

@@ -32,7 +32,7 @@
<div class="detail-field-label">请求完整 URL超长截断</div>
<div class="detail-field-value">
{notempty name="row.url"}
{$row.url}
{$row.url|htmlspecialchars=###,ENT_QUOTES,'UTF-8'}
{else/}
<span class="layui-text-em">暂无数据</span>
{/notempty}
@@ -42,7 +42,7 @@
<div class="detail-field-label">规范化 URL query、数字段替换聚合用</div>
<div class="detail-field-value">
{notempty name="row.simple_url"}
{$row.simple_url}
{$row.simple_url|htmlspecialchars=###,ENT_QUOTES,'UTF-8'}
{else/}
<span class="layui-text-em">暂无数据</span>
{/notempty}