mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-07-26 09:18:39 +00:00
c3f64cd842
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.
28 lines
897 B
JavaScript
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;
|
|
}
|
|
};
|