()
| 599 | |
| 600 | // 加载统计信息 |
| 601 | async function loadStats() { |
| 602 | try { |
| 603 | const data = await api.get('/accounts/stats/summary', { |
| 604 | requestKey: 'accounts:stats', |
| 605 | cancelPrevious: true, |
| 606 | retry: 1, |
| 607 | }); |
| 608 | |
| 609 | elements.totalAccounts.textContent = format.number(data.total || 0); |
| 610 | elements.activeAccounts.textContent = format.number(data.by_status?.active || 0); |
| 611 | elements.expiredAccounts.textContent = format.number(data.by_status?.expired || 0); |
| 612 | elements.failedAccounts.textContent = format.number(data.by_status?.failed || 0); |
| 613 | |
| 614 | // 添加动画效果 |
| 615 | animateValue(elements.totalAccounts, data.total || 0); |
| 616 | } catch (error) { |
| 617 | console.error('加载统计信息失败:', error); |
| 618 | } |
| 619 | } |
| 620 | |
| 621 | // 数字动画 |
| 622 | function animateValue(element, value) { |
no test coverage detected