diff --git a/meshuser.js b/meshuser.js index abb1cd10..3a487163 100644 --- a/meshuser.js +++ b/meshuser.js @@ -181,7 +181,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use var os = require('os'); var stats = { action: 'serverstats', totalmem: os.totalmem(), freemem: os.freemem() }; if (obj.parent.parent.platform != 'win32') { stats.cpuavg = os.loadavg(); } // else { stats.cpuavg = [ 0.2435345, 0.523234234, 0.6435345345 ]; } - var serverStats = { "User Accounts": Object.keys(obj.parent.users).length, "Device Groups": Object.keys(obj.parent.meshes).length, "Agent Sessions": Object.keys(obj.parent.wsagents).length, "Users Sessions": Object.keys(obj.parent.wssessions2).length }; + var serverStats = { "User Accounts": Object.keys(obj.parent.users).length, "Device Groups": Object.keys(obj.parent.meshes).length, "Agent Sessions": Object.keys(obj.parent.wsagents).length, "Connected Users": Object.keys(obj.parent.wssessions).length, "Users Sessions": Object.keys(obj.parent.wssessions2).length }; if (obj.parent.parent.mpsserver != null) { serverStats['Connected Intel® AMT'] = Object.keys(obj.parent.parent.mpsserver.ciraConnections).length; } stats.values = { "Server State": serverStats } try { ws.send(JSON.stringify(stats)); } catch (ex) { } diff --git a/views/default.handlebars b/views/default.handlebars index 043aede6..0b7fa833 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2461,8 +2461,10 @@ // Windows agent install //x += "
To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and configuration file and install the agent on the computer to manage.

"; x += "
To add a new computer to device group \"" + EscapeHtml(mesh.name) + "\", download the mesh agent and install it the computer to manage. This agent has server and mesh information embedded within it.

"; - x += addHtmlValue('Mesh Agent', 'Windows (.exe)'); - x += addHtmlValue('Mesh Agent', 'Windows x64 (.exe)'); + //x += addHtmlValue('Mesh Agent', 'Windows (.exe)'); + //x += addHtmlValue('Mesh Agent', 'Windows x64 (.exe)'); + x += addHtmlValue('Mesh Agent', 'Windows (.exe)'); + x += addHtmlValue('Mesh Agent', 'Windows x64 (.exe)'); if (debugmode > 0) { x += addHtmlValue('Settings File', '' + EscapeHtml(mesh.name) + ' settings (.msh)'); } x += "
"; @@ -2478,8 +2480,10 @@ // Windows agent uninstall x += ""; // Linux agent uninstall @@ -2487,7 +2491,7 @@ x += ''; x += "
"; - setDialogMode(2, "Add Mesh Agent", 9, null, x); + setDialogMode(2, "Add Mesh Agent", 2, null, x, 'agentDownload'); var servername = serverinfo.name; if ((servername == 'un-configured') || ((features & 2) != 0)) { servername = window.location.hostname; } // If the server name is not set or it's in LAN-only mode, use the URL hostname as server name. @@ -2505,6 +2509,21 @@ addAgentToMeshClick(); } + function fileDownload(path, name, appendFlag) { + var xdr = null, flag = ''; + if (appendFlag == 1) { flag = Q('aginsType').value; } + try { xdr = new XDomainRequest(); } catch (e) { } + if (!xdr) xdr = new XMLHttpRequest(); + xdr.open("GET", window.location.href + path + flag); + xdr.timeout = 15000; + xdr.responseType = "blob"; + xdr.onprogress = function (x) { console.log(x); }; + xdr.onload = function (e) { saveAs(new Blob([e.target.response], { type: "application/octet-stream" }), name); if (xxdialogTag == 'agentDownload') { setDialogMode(0); } }; + xdr.onerror = function () { if (xxdialogTag == 'agentDownload') { setDialogMode(0); } alert('Agent downloads timeout.'); }; + xdr.ontimeout = function () { if (xxdialogTag == 'agentDownload') { setDialogMode(0); } alert('Unable to download agent.'); }; + xdr.send(); + } + function addAgentToMeshClick() { var v = Q('aginsSelect').value; QV('agins_windows', v == 0); @@ -2515,8 +2534,8 @@ QV('aginsTypeDiv', v == 0); // Fix the links if needed - Q('aginsw32lnk').href = (Q('aginsw32lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; - Q('aginsw64lnk').href = (Q('aginsw64lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; + //Q('aginsw32lnk').href = (Q('aginsw32lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; + //Q('aginsw64lnk').href = (Q('aginsw64lnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; if (debugmode > 0) { Q('aginswmshlnk').href = (Q('aginswmshlnk').href.split('installflags=')[0]) + 'installflags=' + Q('aginsType').value; } }