MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / loadStats

Function loadStats

static/js/accounts.js:601–619  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

599
600// 加载统计信息
601async 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// 数字动画
622function animateValue(element, value) {

Callers 4

refreshAccountsViewFunction · 0.70
accounts.jsFile · 0.70
deleteAccountFunction · 0.70
handleBatchDeleteFunction · 0.70

Calls 3

animateValueFunction · 0.85
errorMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected