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

Function toggleScanAuthFields

web/scripts/ragnar_modern.js:20573–20641  ·  view source on GitHub ↗

* Toggle scan form auth fields based on selected auth type

()

Source from the content-addressed store, hash-verified

20571 const ip = iface.ip_address || '—';
20572 return `<div class="flex justify-between"><span>${iface.name}</span><span>${ip}</span><span class="${statusColor}">${statusText}</span></div>`;
20573 }).join('');
20574 listEl.classList.remove('hidden');
20575 }
20576 } catch (e) {
20577 if (indicator) {
20578 indicator.className = 'text-sm px-2 py-1 rounded bg-red-900/50 text-red-400';
20579 indicator.textContent = 'Error';
20580 }
20581 if (info) info.textContent = 'Failed to check Ethernet status';
20582 }
20583}
20584
20585function updateWifiStatus(message, type = '') {
20586 // This function can be enhanced to show status messages in a notification area
20587 // For now, we'll use console messages and update the UI elements
20588 addConsoleMessage(message, type === 'error' ? 'error' : type === 'ap-mode' ? 'warning' : 'info');
20589}
20590
20591// ============================================================================
20592// WI-FI MANAGEMENT FUNCTIONS
20593// ============================================================================
20594
20595let currentWifiNetworks = [];
20596let selectedWifiNetwork = null;
20597const WIFI_INTERFACE_STORAGE_KEY = 'wifi-selected-interface';
20598let selectedWifiInterface = null;
20599let wifiInterfaceMetadata = [];
20600const WIFI_NETWORK_CACHE_KEY_DEFAULT = '__default__';
20601const wifiNetworkResultCache = new Map();
20602let wifiMultiInterfaceState = null;
20603const DASHBOARD_STATS_CACHE_TTL = 4000;
20604let dashboardStatsCache = { key: null, timestamp: 0, data: null };
20605let dashboardStatsRequestState = null;
20606
20607function slugifyNetworkIdentifier(value) {
20608 if (!value) {
20609 return null;
20610 }
20611 let normalized = value;
20612 if (typeof normalized.normalize === 'function') {
20613 normalized = normalized.normalize('NFKD');
20614 }
20615 normalized = normalized.replace(/[\u0300-\u036f]/g, '');
20616 normalized = normalized.replace(/[^A-Za-z0-9]+/g, '_');
20617 normalized = normalized.replace(/^_+|_+$/g, '');
20618 normalized = normalized.toLowerCase();
20619 return normalized || null;
20620}
20621
20622function normalizeInterfaceMetadata(entries) {
20623 if (!Array.isArray(entries)) {
20624 return [];
20625 }
20626 return entries.map(entry => {
20627 if (!entry || typeof entry !== 'object') {
20628 return entry;
20629 }
20630 if (entry.network_slug) {

Callers

nothing calls this directly

Calls 1

addMethod · 0.80

Tested by

no test coverage detected