mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Added netif2 to meshctrl displayinfo
This commit is contained in:
		
							parent
							
								
									8afd3fdd21
								
							
						
					
					
						commit
						3e0fb41524
					
				
					 1 changed files with 61 additions and 0 deletions
				
			
		
							
								
								
									
										61
									
								
								meshctrl.js
									
										
									
									
									
								
							
							
						
						
									
										61
									
								
								meshctrl.js
									
										
									
									
									
								
							|  | @ -2337,6 +2337,67 @@ function displayDeviceInfo(sysinfo, lastconnect, network, nodes) { | |||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (network.netif2 != null) { | ||||
|         var minfo = {}; | ||||
|         for (var i in network.netif2) { | ||||
|             var m = network.netif2[i], moutput = {}, moutputCount = 0; | ||||
| 
 | ||||
|             if (Array.isArray(m) == false || | ||||
|                 m.length < 1 || | ||||
|                 m[0] == null || | ||||
|                 ((typeof m[0].mac == 'string') && (m[0].mac.startsWith('00:00:00:00'))) | ||||
|             ) | ||||
|                 continue; | ||||
| 
 | ||||
|             var ifTitle = ''; | ||||
|             if (i != null) ifTitle += i; | ||||
|             if (m[0].fqdn != null && m[0].fqdn != '') ifTitle += ', ' + m[0].fqdn; | ||||
| 
 | ||||
|             if (typeof m[0].mac == 'string') { | ||||
|                 if (m[0].gatewaymac) { | ||||
|                     moutput['MAC Layer'] = format("MAC: {0}, Gateway: {1}", m[0].mac, m[0].gatewaymac); | ||||
|                 } else { | ||||
|                     moutput['MAC Layer'] = format("MAC: {0}", m[0].mac); | ||||
|                 } | ||||
|                 moutputCount++; | ||||
|             } | ||||
| 
 | ||||
|             moutput['IPv4 Layer'] = ''; | ||||
|             moutput['IPv6 Layer'] = ''; | ||||
|             for (var j = 0; j < m.length; j++) { | ||||
|                 var iplayer = m[j]; | ||||
|                 if (iplayer.family == 'IPv4') { | ||||
|                     if (iplayer.gateway && iplayer.netmask) { | ||||
|                         moutput['IPv4 Layer'] += format("IP: {0}, Mask: {1}, Gateway: {2}  ", iplayer.address, iplayer.netmask, iplayer.gateway); | ||||
|                         moutputCount++; | ||||
|                     } else { | ||||
|                         if (iplayer.address) { | ||||
|                             moutput['IPv4 Layer'] += format("IP: {0}  ", iplayer.address); | ||||
|                             moutputCount++; | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|                 if (iplayer.family == 'IPv6') { | ||||
|                     if (iplayer.gateway && iplayer.netmask) { | ||||
|                         moutput['IPv6 Layer'] += format("IP: {0}, Mask: {1}, Gateway: {2}  ", iplayer.address, iplayer.netmask, iplayer.gateway); | ||||
|                         moutputCount++; | ||||
|                     } else { | ||||
|                         if (iplayer.address) { | ||||
|                             moutput['IPv6 Layer'] += format("IP: {0}  ", iplayer.address); | ||||
|                             moutputCount++; | ||||
|                         } | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
|             if (moutput['IPv4 Layer'] == '') delete moutput['IPv4 Layer']; | ||||
|             if (moutput['IPv6 Layer'] == '') delete moutput['IPv6 Layer']; | ||||
|             if (moutputCount > 0) { | ||||
|                 minfo[ifTitle] = moutput; | ||||
|                 info["Networking"] = minfo; | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     // Intel AMT
 | ||||
|     if (node.intelamt != null) { | ||||
|         var output = {}, outputCount = 0; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue