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

Function openNetworkFilePanel

web/scripts/ragnar_modern.js:2985–3014  ·  view source on GitHub ↗
(slug, ssid)

Source from the content-addressed store, hash-verified

2983 + _wifiReportPressureChips(i.channels)
2984 + `<table><thead><tr><th>Device</th><th>Type</th><th>Vendor</th><th>Class</th><th>RSSI</th></tr></thead><tbody>${rows}</tbody></table>`
2985 + (bt.coexistence_note ? `<p class="sub" style="margin-top:6px">${_esc(bt.coexistence_note)}</p>` : '');
2986}
2987
2988// Zigbee / 802.15.4 overlay → HTML section (or '' when absent/off).
2989function _wifiReportZbHtml() {
2990 if (!(_wifiState.zbOn && _wifiState.zbAvailable)) return '';
2991 const zb = _wifiState.zb;
2992 const devices = (zb && zb.devices) || [];
2993 if (!zb || (!devices.length && !zb.device_count)) return '';
2994 const i = zb.interference || {};
2995 const rows = devices.slice(0, 60).map(d => `<tr><td class="mono">${_esc(d.addr || d.short_addr) || '—'}</td><td>${_esc(d.panid) || '—'}</td><td>${d.channel == null ? '—' : d.channel}</td><td>${_esc(d.proto) || '—'}</td><td>${_esc(d.vendor) || '—'}</td><td>${d.rssi == null ? '—' : d.rssi + ' dBm'}</td><td>${d.lqi == null ? '—' : d.lqi}</td></tr>`).join('');
2996 return `<h2>Zigbee / 802.15.4 (2.4 GHz coexistence)</h2>`
2997 + `<p><b>${zb.device_count || devices.length}</b> device(s) · ${i.channel_count || 0} active channel(s) · ${i.strong_count || 0} close</p>`
2998 + _wifiReportPressureChips(i.wifi_channels)
2999 + `<table><thead><tr><th>Address</th><th>PAN ID</th><th>Ch</th><th>Proto</th><th>Vendor</th><th>RSSI</th><th>LQI</th></tr></thead><tbody>${rows}</tbody></table>`
3000 + (zb.companion_note ? `<p class="sub" style="margin-top:6px">${_esc(zb.companion_note)}</p>` : '');
3001}
3002
3003// Stashed AI analysis → HTML section (light-theme markdown-lite; or '' when
3004// the user hasn't run "Analyze with AI" on the current scan).
3005function _wifiReportAIHtml() {
3006 const ai = _wifiState.ai;
3007 const text = ai && (ai.text || '').trim();
3008 if (!text) return '';
3009 const lines = text.replace(/\r\n/g, '\n').split('\n');
3010 const out = []; let inList = false;
3011 const inline = (s) => _esc(s).replace(/\*\*(.+?)\*\*/g, '<b>$1</b>').replace(/`([^`]+?)`/g, '<code>$1</code>');
3012 const closeList = () => { if (inList) { out.push('</ul>'); inList = false; } };
3013 for (const raw of lines) {
3014 const s = raw.trim();
3015 if (!s) { closeList(); continue; }
3016 const bullet = s.match(/^(?:[-*•]|\d+[.)])\s+(.*)$/);
3017 if (bullet) { if (!inList) { out.push('<ul>'); inList = true; } out.push(`<li>${inline(bullet[1])}</li>`); continue; }

Callers

nothing calls this directly

Calls 4

addMethod · 0.80
fetchAPIFunction · 0.70
displayNetworkFilesFunction · 0.70
escapeHtmlFunction · 0.70

Tested by

no test coverage detected