* Format alert details for display. * * Renders the alert.details object as a compact, human-readable block. * Arrays (mitre tags, channels, dst_ips, ...) and numbers are formatted * specially so beacon / JA3 / IRC alerts read nicely.
(details)
| 15991 | throw error; |
| 15992 | } |
| 15993 | } |
| 15994 | |
| 15995 | function formatInterfaceRole(role) { |
| 15996 | if (!role) { |
| 15997 | return 'Adapter'; |
| 15998 | } |
| 15999 | if (role === 'internal') { |
| 16000 | return 'Internal'; |
| 16001 | } |
| 16002 | if (role === 'external') { |
| 16003 | return 'External'; |
| 16004 | } |
| 16005 | return role.replace(/_/g, ' ').replace(/\b\w/g, char => char.toUpperCase()); |
| 16006 | } |
| 16007 | |
| 16008 | function formatInterfaceReason(reason) { |
| 16009 | if (!reason) { |
| 16010 | return ''; |
| 16011 | } |
| 16012 | const labels = { |
| 16013 | global_disabled: 'Multi-scan disabled', |
| 16014 | user_disabled: 'Paused by user', |
| 16015 | no_ssid: 'No SSID', |
| 16016 | disconnected: 'Adapter offline' |
| 16017 | }; |
| 16018 | return labels[reason] || reason.replace(/_/g, ' '); |
| 16019 | } |
| 16020 | |
| 16021 | function renderDashboardMultiInterfaceSummary(state, statusData = {}) { |
| 16022 | const container = document.getElementById('wifi-dashboard-interfaces'); |
| 16023 | if (!container) { |
| 16024 | return; |
| 16025 | } |
| 16026 | |
| 16027 | if (!state || !Array.isArray(state.interfaces) || state.interfaces.length === 0) { |
| 16028 | container.innerHTML = '<div class="text-gray-500 text-[11px]">No additional adapters detected yet.</div>'; |
| 16029 | renderDashboardInterfaceSwitch(null); |
| 16030 | return; |
| 16031 | } |
| 16032 | |
| 16033 | // Determine which interface is selected for dashboard display |
| 16034 | const activeInterface = getActiveWifiInterface(); |
| 16035 | let selectedEntry = null; |
| 16036 | if (activeInterface) { |
no test coverage detected