%- include('../partials/admin-header') %>
监控任务 & 检测记录
<% if (flash) { %>
<%= decodeURIComponent(flash) %>
<% } %>
调度器
<%= schedulerRunning ? '运行中' : '已停止' %>
<% if (schedulerRunning) { %>
<% } else { %>
<% } %>
任务列表
| ID | 产品 | 频道 | Cron | 状态 | 上次运行 | 操作 |
<% tasks.forEach(t => { %>
| <%= t.id %> |
<%= t.merchant_name %> — <%= t.product_name %> |
<%= t.channel_name || '-' %> |
<%= t.cron_expr %> |
<%= t.enabled ? '启用' : '禁用' %> |
<%= t.last_run || '-' %> |
|
<% }) %>
<% if (tasks.length === 0) { %>
| 暂无任务,请先创建 |
<% } %>
最近检测记录(最新 50 条)
| ID | 产品 | 状态 | 消息 | 已推送 | 时间 |
<% logs.forEach(l => { %>
| <%= l.id %> |
<%= l.product_name || l.product_id %> |
<% if (l.status === 'in_stock') { %>有货
<% } else if (l.status === 'out_of_stock') { %>缺货
<% } else { %><%= l.status %><% } %>
|
<%= l.message || '-' %> |
<%= l.notified ? '✅' : '❌' %> |
<%= l.created_at %> |
<% }) %>
<% if (logs.length === 0) { %>
| 暂无记录 |
<% } %>
<%- include('../partials/footer') %>