(endpoint, data)
| 11679 | // Remove pulse animation |
| 11680 | statsElements.forEach(id => { |
| 11681 | const el = document.getElementById(id); |
| 11682 | if (el) el.classList.remove('animate-pulse'); |
| 11683 | }); |
| 11684 | |
| 11685 | if (data) { |
| 11686 | // Update status block immediately |
| 11687 | updateDashboardStatus(data); |
| 11688 | // Only fetch network-specific stats if a specific network is selected; |
| 11689 | // otherwise /api/dashboard/quick already has the correct data (instant). |
| 11690 | const { network } = getSelectedDashboardNetworkKey(); |
| 11691 | if (network) { |
| 11692 | await refreshDashboardStatsForCurrentSelection({ forceRefresh: true, fallbackData: data }); |
| 11693 | } else { |
| 11694 | updateDashboardStats(data); |
| 11695 | } |
| 11696 | } |
| 11697 | |
| 11698 | // Load AI insights if configured |
| 11699 | await loadAIInsights(); |
| 11700 | } catch (error) { |
| 11701 | console.error('Error loading dashboard data:', error); |
| 11702 | // Remove pulse animation on error too |
| 11703 | const statsElements = [ |
| 11704 | 'target-count', 'target-total-count', 'target-inactive-count', |
| 11705 | 'port-count', 'vuln-count', 'cred-count', 'level-count', 'scanned-network-count', 'points-count' |
no test coverage detected