diff --git a/agents/meshcore.js b/agents/meshcore.js index 774a0f69..f4e04da5 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -920,6 +920,33 @@ function handleServerCommand(data) { } break; } + case 'psinfo': { + // Requestion details information about a process + if (data.pid) { + var info = {}; // TODO: Replace with real data. Feel free not to give all values if not available. + info.processName = "dummydata"; + info.privateMemorySize = 123; + info.virtualMemorySize = 123; + info.workingSet = 123; + info.totalProcessorTime = 123; // Seconds + info.userProcessorTime = 123; // Seconds + info.startTime = "2012-12-30T23:59:59.000Z"; // Time in UTC ISO format + info.sessionId = 123; + info.privilegedProcessorTime = 123; // Seconds + info.PriorityBoostEnabled = true; + info.peakWorkingSet = 123; + info.peakVirtualMemorySize = 123; + info.peakPagedMemorySize = 123; + info.pagedSystemMemorySize = 123; + info.pagedMemorySize = 123; + info.nonpagedSystemMemorySize = 123; + info.mainWindowTitle = "dummydata"; + info.machineName = "dummydata"; // Only set this if machine name is not "." + info.handleCount = 123; + mesh.SendCommand({ action: 'msg', type: 'psinfo', pid: data.pid, sessionid: data.sessionid, value: info }); + } + break; + } case 'pskill': { // Kill a process if (data.value) { diff --git a/views/default.handlebars b/views/default.handlebars index 022ea696..a7647243 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -2343,6 +2343,10 @@ QH('p11DeskSessionSelector', x); QV('p11DeskSessionSelector', true); } + } else if (message.type == 'psinfo') { + if (xxdialogTag == ('ps|' + message.nodeid + '|' + message.pid)) { + console.log('aa', message); + } } } } else { @@ -8484,13 +8488,18 @@ for (var i in p) { if (p[i].p != 0) { var c = p[i].c; - if (c.length > 30) { c = '' + EscapeHtml(c.substring(0,30)) + '...' } else { c = EscapeHtml(c); } - x += '
'; + if (c.length > 30) { c = '' + EscapeHtml(c.substring(0,30)) + '...' } else { c = EscapeHtml(c); } + x += ''; } } QH('DeskToolsProcesses', x); } } + function showProcessDetails(pid) { + if (xxdialogMode) return; + setDialogMode(2, format("Process Details, #{0}", pid), 1, null, "Requesting details...", 'ps|' + currentNode._id + '|' + pid); + meshserver.send({ action: 'msg', type: 'psinfo', nodeid: currentNode._id, pid: pid }); + } function showDeskToolsServices(message) { deskTools.smsg = message; if (message == null) { QH('DeskToolsProcesses', ''); return; }