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

Function scanSingleHost

web/scripts/ragnar_modern.js:4807–4826  ·  view source on GitHub ↗
(ip)

Source from the content-addressed store, hash-verified

4805function runPing() { return _ndRunText('ping-target', 'ping-results', '/api/net/ping', 'Pinging', 'runPing'); }
4806function runTraceroute() { return _ndRunText('trace-target', 'trace-results', '/api/net/traceroute', 'Tracing', 'runTraceroute'); }
4807function runWhois() { return _ndRunText('whois-target', 'whois-results', '/api/net/whois', 'Looking up', 'runWhois'); }
4808
4809// Fill the MTR start-point dropdown with this host's local IPv4 addresses.
4810async function populateMtrSources() {
4811 const sel = document.getElementById('mtr-source');
4812 if (!sel || sel.dataset._loaded) return;
4813 try {
4814 const data = await fetchAPI('/api/net/interfaces');
4815 if (!data || !data.success) return;
4816 const seen = new Set();
4817 (data.interfaces || []).forEach(i => {
4818 (i.ipv4 || []).forEach(cidr => {
4819 const ip = String(cidr).split('/')[0];
4820 if (!ip || seen.has(ip)) return;
4821 seen.add(ip);
4822 const opt = document.createElement('option');
4823 opt.value = ip;
4824 opt.textContent = i.name + ' — ' + ip;
4825 sel.appendChild(opt);
4826 });
4827 });
4828 sel.dataset._loaded = '1';
4829 } catch (e) { /* leave just the auto option */ }

Callers

nothing calls this directly

Calls 3

errorMethod · 0.80
networkAwareFetchFunction · 0.70
addConsoleMessageFunction · 0.70

Tested by

no test coverage detected