MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / formatAlertDetails

Function formatAlertDetails

web/scripts/ragnar_modern.js:15993–16033  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

15991 throw error;
15992 }
15993}
15994
15995function 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
16008function 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
16021function 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) {

Callers 2

loadTrafficAlertsFunction · 0.70
renderHostAlertSectionFunction · 0.70

Calls 3

formatValueFunction · 0.85
pushMethod · 0.80
escapeHtmlFunction · 0.70

Tested by

no test coverage detected