()
| 15899 | if (currentTab === 'network' || currentTab === 'discovered' || currentTab === 'threat-intel') { |
| 15900 | setTimeout(() => { |
| 15901 | refreshCurrentTab(); |
| 15902 | }, 500); |
| 15903 | } |
| 15904 | } else { |
| 15905 | addConsoleMessage(`Reset failed: ${data.error || 'Unknown error'}`, 'error'); |
| 15906 | } |
| 15907 | |
| 15908 | } catch (error) { |
| 15909 | console.error('Error resetting vulnerabilities:', error); |
| 15910 | addConsoleMessage('Failed to reset vulnerabilities', 'error'); |
| 15911 | } |
| 15912 | } |
| 15913 | |
| 15914 | async function resetThreatIntelligence() { |
| 15915 | if (!confirm('⚠️ Reset Threat Intelligence?\n\nThis will permanently delete:\n• All threat intelligence findings\n• Enriched threat data\n• Threat cache\n\nThis action cannot be undone. Continue?')) { |
| 15916 | return; |
| 15917 | } |
| 15918 | |
| 15919 | try { |
| 15920 | addConsoleMessage('Resetting threat intelligence...', 'warning'); |
| 15921 | |
| 15922 | const data = await postAPI('/api/data/reset-threat-intel', {}); |
| 15923 | |
| 15924 | if (data.success) { |
| 15925 | addConsoleMessage('Threat intelligence data reset successfully', 'success'); |
| 15926 | |
| 15927 | // Refresh threat intel tab if active |
| 15928 | if (currentTab === 'threat-intel') { |
| 15929 | setTimeout(() => { |
| 15930 | refreshCurrentTab(); |
| 15931 | }, 500); |
| 15932 | } |
| 15933 | } else { |
| 15934 | addConsoleMessage(`Reset failed: ${data.error || 'Unknown error'}`, 'error'); |
| 15935 | } |
| 15936 | |
| 15937 | } catch (error) { |
| 15938 | console.error('Error resetting threat intelligence:', error); |
| 15939 | addConsoleMessage('Failed to reset threat intelligence', 'error'); |
| 15940 | } |
| 15941 | } |
| 15942 | |
| 15943 | // Update vulnerability count in config tab |
| 15944 | async function updateVulnerabilityCount() { |
| 15945 | try { |
| 15946 | const stats = await fetchAPI('/api/stats'); |
| 15947 | const count = stats.vulnerability_count || 0; |
| 15948 | updateElement('vuln-count', count.toString()); |
| 15949 | updateElement('config-vuln-count', count.toString()); |
| 15950 | } catch (error) { |
| 15951 | console.error('Error updating vulnerability count:', error); |
| 15952 | updateElement('vuln-count', '?'); |
| 15953 | } |
| 15954 | } |
| 15955 | |
| 15956 | // ============================================================================ |
| 15957 | // WI-FI MANAGEMENT FUNCTIONS |
| 15958 | // ============================================================================ |
no test coverage detected