added kvmmode console command (backwards compatible)

Bryan Roe committed Apr 12, 2020 at 22:53 UTC a183fad57c9470361cdd3d3599cdf5b11c33b47f
1 file changed +20
agents/meshcore.js
+20
@@ -1963,6 +1963,8 @@ function createMeshCore(agent) {
1963 case 'help': { // Displays available commands
1964 var fin = '', f = '', availcommands = 'startupoptions,alert,agentsize,version,help,info,osinfo,args,print,type,dbkeys,dbget,dbset,dbcompact,eval,parseuri,httpget,nwslist,plugin,wsconnect,wssend,wsclose,notify,ls,ps,kill,amt,netinfo,location,power,wakeonlan,setdebug,smbios,rawsmbios,toast,lock,users,sendcaps,openurl,amtreset,amtccm,amtacm,amtdeactivate,amtpolicy,getscript,getclip,setclip,log,av,cpuinfo,sysinfo,apf,scanwifi,scanamt,wallpaper';
1965 if (process.platform == 'win32') { availcommands += ',safemode,wpfhwacceleration'; }
1966 + if (require('MeshAgent').maxKvmTileSize != null) { availcommands += ',kvmmode'; }
1967 +
1968 availcommands = availcommands.split(',').sort();
1969 while (availcommands.length > 0) {
1970 if (f.length > 90) { fin += (f + ',\r\n'); f = ''; }
@@ -1975,6 +1977,24 @@ function createMeshCore(agent) {
1977 case 'startupoptions':
1978 response = JSON.stringify(require('MeshAgent').getStartupOptions());
1979 break;
1980 + case 'kvmmode':
1981 + if (require('MeshAgent').maxKvmTileSize == null)
1982 + {
1983 + response = "Unknown command \"kvmmode\", type \"help\" for list of avaialble commands.";
1984 + }
1985 + else
1986 + {
1987 + if(require('MeshAgent').maxKvmTileSize == 0)
1988 + {
1989 + response = 'KVM Mode: Full JUMBO';
1990 + }
1991 + else
1992 + {
1993 + response = 'KVM Mode: ' + (require('MeshAgent').maxKvmTileSize <= 65500 ? 'NO JUMBO' : 'Partial JUMBO');
1994 + response += (', TileLimit: ' + (require('MeshAgent').maxKvmTileSize < 1024 ? (require('MeshAgent').maxKvmTileSize + ' bytes') : (Math.round(require('MeshAgent').maxKvmTileSize/1024) + ' Kbytes')));
1995 + }
1996 + }
1997 + break;
1998 case 'alert':
1999 if (args['_'].length == 0)
2000 {