mirror of
https://github.com/stagehacks/Cue-View.git
synced 2026-08-04 13:27:46 +00:00
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.
This commit is contained in:
@@ -66,6 +66,12 @@
|
||||
.if-ut {
|
||||
background-color: #bf360c;
|
||||
}
|
||||
.red {
|
||||
color: #ca6f1e;
|
||||
}
|
||||
.green {
|
||||
color: #28b463;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
</html>
|
||||
@@ -76,7 +82,7 @@
|
||||
<th>ID</th>
|
||||
<th>IP Address</th>
|
||||
<th>Subnet Mask</th>
|
||||
<th>Searchable Addresses</th>
|
||||
<th>Searchable Address Ranges</th>
|
||||
</tr>
|
||||
<tbody id="network-interfaces"></tbody>
|
||||
</table>
|
||||
|
||||
@@ -12,7 +12,14 @@ window.init = function init() {
|
||||
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>`;
|
||||
html += `<td>${interfaceObj[0].firstSearchAddress} - ${interfaceObj[0].lastSearchAddress}</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;
|
||||
|
||||
@@ -108,7 +108,6 @@ window.init = function init() {
|
||||
|
||||
document.getElementById('network-info-button').onclick = function fooBar(e) {
|
||||
ipcRenderer.send('openNetworkInfoWindow');
|
||||
console.log('FOO');
|
||||
};
|
||||
|
||||
document.onkeyup = function keyUp(e) {
|
||||
|
||||
+12
-3
@@ -23,10 +23,19 @@ function getServers() {
|
||||
for (let i = addresses.length; i--; ) {
|
||||
const address = addresses[i];
|
||||
if (address.family === 'IPv4' && !address.internal && address.address.substring(0, 3) !== '169') {
|
||||
const subnet = ip.subnet(address.address, address.netmask);
|
||||
let subnet = ip.subnet(address.address, address.netmask);
|
||||
let current = ip.toLong(subnet.firstAddress);
|
||||
const last = ip.toLong(subnet.lastAddress) - 1;
|
||||
let last = ip.toLong(subnet.lastAddress) - 1;
|
||||
address.searchTruncated = false;
|
||||
|
||||
if (last - current > 2296) {
|
||||
subnet = ip.subnet(address.address, '255.255.248.0');
|
||||
last = ip.toLong(subnet.lastAddress) - 1;
|
||||
address.searchTruncated = true;
|
||||
}
|
||||
|
||||
// console.log(`range ${subnet.firstAddress} - ${subnet.lastAddress}`);
|
||||
|
||||
address.broadcastAddress = subnet.broadcastAddress;
|
||||
address.firstSearchAddress = subnet.firstAddress;
|
||||
address.lastSearchAddress = subnet.lastAddress;
|
||||
@@ -59,7 +68,7 @@ function searchAll() {
|
||||
console.log('Searching...');
|
||||
allServers = getServers();
|
||||
let TCPFlag = true;
|
||||
if (allServers.length > 2046) {
|
||||
if (allServers.length > 2296) {
|
||||
alert(
|
||||
'Unable to search for TCP devices - subnet too large!\n\nCue View requires subnet 255.255.248.0 (/21) or smaller.'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user