(status, lastCheckedAt)
| 1736 | } |
| 1737 | |
| 1738 | function updateAutoMonitorHeader(status, lastCheckedAt) { |
| 1739 | if (!elements.autoMonitorStatusBadge || !elements.autoMonitorLastChecked) return; |
| 1740 | |
| 1741 | if (!isAutoMode) { |
| 1742 | elements.autoMonitorStatusBadge.style.display = 'none'; |
| 1743 | elements.autoMonitorLastChecked.style.display = 'none'; |
| 1744 | return; |
| 1745 | } |
| 1746 | |
| 1747 | const statusInfo = { |
| 1748 | pending: { text: '自动等待', class: 'pending' }, |
| 1749 | checking: { text: '自动检查中', class: 'running' }, |
| 1750 | running: { text: '自动补货中', class: 'running' }, |
| 1751 | idle: { text: '自动空闲', class: 'completed' }, |
| 1752 | disabled: { text: '自动已禁用', class: 'disabled' }, |
| 1753 | error: { text: '自动异常', class: 'failed' }, |
| 1754 | cancelling: { text: '自动取消中', class: 'running' }, |
| 1755 | }; |
| 1756 | |
| 1757 | const info = statusInfo[status] || { text: `自动${status || '未知'}`, class: 'pending' }; |
| 1758 | elements.autoMonitorStatusBadge.style.display = 'inline-flex'; |
| 1759 | elements.autoMonitorStatusBadge.textContent = info.text; |
| 1760 | elements.autoMonitorStatusBadge.className = `status-badge ${info.class}`; |
| 1761 | elements.autoMonitorLastChecked.style.display = 'inline'; |
| 1762 | elements.autoMonitorLastChecked.textContent = `最近检查: ${formatAutoMonitorTimestamp(lastCheckedAt)}`; |
| 1763 | } |
| 1764 | |
| 1765 | async function pollAutoRegistrationStatus() { |
| 1766 | try { |
no test coverage detected