完善查询日志
This commit is contained in:
@@ -3378,6 +3378,23 @@ function displayModalGroupedQueryLogs(groupedLogs) {
|
||||
const batchTypeMatch = firstLog?.message.match(/开始(\w+)查询批次/);
|
||||
const batchType = batchTypeMatch ? batchTypeMatch[1] : '未知';
|
||||
|
||||
// 提取并格式化查询日期
|
||||
const queryDate = firstLog ? new Date(firstLog.timestamp).toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
}) : '未知时间';
|
||||
|
||||
// 简化的日期显示(仅显示日期部分)
|
||||
const queryDateShort = firstLog ? new Date(firstLog.timestamp).toLocaleDateString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit'
|
||||
}) : '未知';
|
||||
|
||||
// 检查是否有关联的历史记录ID
|
||||
const historyId = firstLog?.history_id;
|
||||
const historyBadge = historyId ?
|
||||
@@ -3393,15 +3410,23 @@ function displayModalGroupedQueryLogs(groupedLogs) {
|
||||
<div class="card mb-3 border-${batchStatus}">
|
||||
<div class="card-header bg-${batchStatus} bg-opacity-10" data-bs-toggle="collapse" data-bs-target="#${collapseId}" style="cursor: pointer;">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="${batchIcon} text-${batchStatus} me-2"></i>
|
||||
<strong>${batchType}查询批次 ${batchId}</strong>
|
||||
<span class="badge bg-primary ms-2">${totalLogs}条日志</span>
|
||||
${historyBadge}
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex align-items-center mb-1">
|
||||
<i class="${batchIcon} text-${batchStatus} me-2"></i>
|
||||
<strong>${batchType}查询批次 ${batchId}</strong>
|
||||
<span class="badge bg-primary ms-2">${totalLogs}条日志</span>
|
||||
${historyBadge}
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<small class="text-muted">
|
||||
<i class="fas fa-calendar-alt me-1"></i>
|
||||
查询时间: ${queryDate}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<small class="text-muted me-3">
|
||||
<i class="fas fa-clock"></i> ${duration}
|
||||
<i class="fas fa-clock"></i> 持续时间: ${duration}
|
||||
</small>
|
||||
<div>
|
||||
${logCounts.INFO > 0 ? `<span class="badge bg-info me-1">${logCounts.INFO} INFO</span>` : ''}
|
||||
@@ -3598,19 +3623,37 @@ function displayHistoryRelatedLogs(groupedLogs, historyId) {
|
||||
const batchTypeMatch = firstLog?.message.match(/开始(\w+)查询批次/);
|
||||
const batchType = batchTypeMatch ? batchTypeMatch[1] : '未知';
|
||||
|
||||
// 提取并格式化查询日期
|
||||
const queryDate = firstLog ? new Date(firstLog.timestamp).toLocaleString('zh-CN', {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit'
|
||||
}) : '未知时间';
|
||||
|
||||
html += `
|
||||
<div class="card mb-3 border-${batchStatus}">
|
||||
<div class="card-header bg-${batchStatus} bg-opacity-10" data-bs-toggle="collapse" data-bs-target="#${collapseId}" style="cursor: pointer;">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="${batchIcon} text-${batchStatus} me-2"></i>
|
||||
<strong>${batchType}查询批次 ${batchId}</strong>
|
||||
<span class="badge bg-primary ms-2">${totalLogs}条日志</span>
|
||||
<span class="badge bg-secondary ms-1">历史记录</span>
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex align-items-center mb-1">
|
||||
<i class="${batchIcon} text-${batchStatus} me-2"></i>
|
||||
<strong>${batchType}查询批次 ${batchId}</strong>
|
||||
<span class="badge bg-primary ms-2">${totalLogs}条日志</span>
|
||||
<span class="badge bg-secondary ms-1">历史记录</span>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<small class="text-muted">
|
||||
<i class="fas fa-calendar-alt me-1"></i>
|
||||
查询时间: ${queryDate}
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex align-items-center">
|
||||
<small class="text-muted me-3">
|
||||
<i class="fas fa-clock"></i> ${duration}
|
||||
<i class="fas fa-clock"></i> 持续时间: ${duration}
|
||||
</small>
|
||||
<div>
|
||||
${logCounts.INFO > 0 ? `<span class="badge bg-info me-1">${logCounts.INFO} INFO</span>` : ''}
|
||||
|
Reference in New Issue
Block a user