zai / app /templates /components /recent_logs.html
sanbo110's picture
update sth at 2025-10-16 14:55:36
47258ea
<!-- 最近请求日志列表 -->
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">时间</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">端点</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">模型</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">提供商</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">状态</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">耗时</th>
</tr>
</thead>
<tbody class="bg-white divide-y divide-gray-200">
{% for log in logs %}
<tr class="hover:bg-gray-50">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-900">{{ log.timestamp }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ log.endpoint }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ log.model }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-blue-100 text-blue-800">
{{ log.provider }}
</span>
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm">
{% if log.status == 200 %}
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-green-100 text-green-800">
{{ log.status }}
</span>
{% else %}
<span class="px-2 py-1 text-xs font-semibold rounded-full bg-red-100 text-red-800">
{{ log.status }}
</span>
{% endif %}
</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">{{ log.duration }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if not logs %}
<div class="text-center py-8 text-gray-500">
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" />
</svg>
<p class="mt-2">暂无请求日志</p>
</div>
{% endif %}
</div>