<%= totalDomains %> 总域名数
<%= enabledDomains %> 个启用
<%= totalEmails %> 总邮件数
<%= unreadEmails %> 封未读
<%= totalMailboxes %> 邮箱总数
活跃用户
<%= todayEmails %> 今日邮件
本周 <%= weekEmails %> 封

热门邮箱地址

<% if (popularMailboxes.length === 0) { %>

暂无数据

<% } else { %> <% popularMailboxes.forEach((item, index) => { %>
<%= item._id %>
收到 <%= item.count %> 封邮件
#<%= index + 1 %>
<% }) %> <% } %>

活跃发件人

<% if (topSenders.length === 0) { %>

暂无数据

<% } else { %> <% topSenders.forEach((sender, index) => { %>
<%= sender._id %>
发送 <%= sender.count %> 封邮件
<%= sender.count %>
<% }) %> <% } %>

最近活动邮箱

<% if (recentMailboxes.length === 0) { %>

暂无活动邮箱

<% } else { %> <% recentMailboxes.forEach(mailbox => { %>
<%= mailbox.fullAddress %>
创建于: <%= mailbox.createdAt.toLocaleDateString() %> | 最后活动: <%= formatTimeAgo(mailbox.lastActivity) %>
<%= formatTimeAgo(mailbox.lastActivity) %>
<% }) %> <% } %>

系统信息

系统运行时间 <%= formatUptime(systemStartTime) %>
数据库大小 约 <%= Math.round(totalEmails * 0.01) %> MB (估算)
平均每日邮件 <%= Math.round(totalEmails / 30) %> 封/天 (30天平均)
最活跃域名 <% if (domainStats.length > 0) { %> <%= domainStats[0]._id %> (<%= domainStats[0].count %> 封邮件) <% } else { %> 暂无数据 <% } %>
<% // 格式化运行时间 function formatUptime(startTime) { const now = new Date(); const diff = now - startTime; const days = Math.floor(diff / (1000 * 60 * 60 * 24)); const hours = Math.floor((diff % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); const minutes = Math.floor((diff % (1000 * 60 * 60)) / (1000 * 60)); if (days > 0) { return `${days}天 ${hours}小时 ${minutes}分钟`; } else if (hours > 0) { return `${hours}小时 ${minutes}分钟`; } else { return `${minutes}分钟`; } } // 格式化相对时间 function formatTimeAgo(dateString) { const date = new Date(dateString); const now = new Date(); const diff = now - date; if (diff < 60000) { return '刚刚'; } else if (diff < 3600000) { return Math.floor(diff / 60000) + '分钟前'; } else if (diff < 86400000) { return Math.floor(diff / 3600000) + '小时前'; } else { return Math.floor(diff / 86400000) + '天前'; } } %>