Files
Cue-View/networkInterfaces.js
T
sparks-alec c3f64cd842 clearer feedback when too many hosts
Instead of preventing search when the subnet is too large, restrict the search area to part of the subnet and provide feedback about which hosts are to be searched.
2023-01-05 02:30:47 -05:00

28 lines
897 B
JavaScript

const SEARCH = require('./src/search.js');
window.init = function init() {
const networkInterfaces = SEARCH.getNetworkInterfaces();
let html = '';
for (let i = 0; i < Object.keys(networkInterfaces).length; i++) {
const interfaceID = Object.keys(networkInterfaces)[i];
const interfaceObj = networkInterfaces[interfaceID];
console.log(interfaceObj);
html += `<tr><td><span class="if-${interfaceID.substring(0, 2)}">${interfaceID}</span></td>`;
html += `<td>${interfaceObj[0].address}</td>`;
html += `<td>${interfaceObj[0].netmask}</td>`;
if (interfaceObj[0].searchTruncated) {
html += `<td class='red'>`;
} else {
html += `<td class='green'>`;
}
html += `${interfaceObj[0].firstSearchAddress} - ${interfaceObj[0].lastSearchAddress}</td>`;
html += `</tr>`;
document.getElementById('network-interfaces').innerHTML = html;
}
};