Files
news-tracker/templates/logs.html
T

36 lines
1.2 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
{% set active = 'logs' %}
{% block title %}通知日志 - 新闻智能跟踪{% endblock %}
{% block content %}
<div class="page-head">
<h1>✉️ 通知日志</h1>
<button class="btn" onclick="testMail()">📮 发送测试邮件</button>
</div>
<div class="card">
<table>
<thead><tr><th>ID</th><th>类型</th><th>主题</th><th>条数</th><th>状态</th><th>发送时间</th></tr></thead>
<tbody>
{% for l in logs %}
<tr>
<td>{{ l.id }}</td>
<td>{% if l.type=='realtime' %}<span class="tag hot">实时</span>{% else %}<span class="tag ok">汇总</span>{% endif %}</td>
<td>{{ l.subject }}</td>
<td>{{ l.count }}</td>
<td>{% if l.status=='ok' %}<span class="tag ok">成功</span>{% else %}<span class="tag err">失败</span>{% endif %}</td>
<td>{{ l.sent_at }}</td>
</tr>
{% else %}
<tr><td colspan="6" class="empty">暂无通知记录</td></tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}
{% block script %}
<script>
async function testMail(){
const r = await API.json('/api/actions', {action:'test_mail'});
toast(r.ok ? '✅ 测试邮件已发送' : ('❌ ' + r.error), r.ok);
}
</script>
{% endblock %}