Updated Assistant, completed process details on web page.
Ylian Saint-Hilaire committed
Jun 14, 2021 at 12:37 UTC
4d9d3fb611244640a37959bfc19d69e47b130ac7
3 files changed
+49
-14
agents/MeshCentralAssistant.exe
Binary files a/agents/MeshCentralAssistant.exe and b/agents/MeshCentralAssistant.exe differ
agents/meshcore.js
+18
-13
@@ -924,25 +924,30 @@ function handleServerCommand(data) {
924
// Requestion details information about a process
925
if (data.pid) {
926
var info = {}; // TODO: Replace with real data. Feel free not to give all values if not available.
927
+ /*
928
+ info.processUser = "User"; // String
929
+ info.processDomain = "Domain"; // String
930
+ info.cmd = "abc"; // String
931
info.processName = "dummydata";
928
- info.privateMemorySize = 123;
929
- info.virtualMemorySize = 123;
930
- info.workingSet = 123;
932
+ info.privateMemorySize = 123; // Bytes
933
+ info.virtualMemorySize = 123; // Bytes
934
+ info.workingSet = 123; // Bytes
935
info.totalProcessorTime = 123; // Seconds
936
info.userProcessorTime = 123; // Seconds
937
info.startTime = "2012-12-30T23:59:59.000Z"; // Time in UTC ISO format
934
- info.sessionId = 123;
938
+ info.sessionId = 123; // Number
939
info.privilegedProcessorTime = 123; // Seconds
936
- info.PriorityBoostEnabled = true;
937
- info.peakWorkingSet = 123;
938
- info.peakVirtualMemorySize = 123;
939
- info.peakPagedMemorySize = 123;
940
- info.pagedSystemMemorySize = 123;
941
- info.pagedMemorySize = 123;
942
- info.nonpagedSystemMemorySize = 123;
943
- info.mainWindowTitle = "dummydata";
940
+ info.PriorityBoostEnabled = true; // Boolean
941
+ info.peakWorkingSet = 123; // Bytes
942
+ info.peakVirtualMemorySize = 123; // Bytes
943
+ info.peakPagedMemorySize = 123; // Bytes
944
+ info.pagedSystemMemorySize = 123; // Bytes
945
+ info.pagedMemorySize = 123; // Bytes
946
+ info.nonpagedSystemMemorySize = 123; // Bytes
947
+ info.mainWindowTitle = "dummydata"; // String
948
info.machineName = "dummydata"; // Only set this if machine name is not "."
945
- info.handleCount = 123;
949
+ info.handleCount = 123; // Number
950
+ */
951
mesh.SendCommand({ action: 'msg', type: 'psinfo', pid: data.pid, sessionid: data.sessionid, value: info });
952
}
953
break;
views/default.handlebars
+31
-1
@@ -2345,7 +2345,36 @@
2345
}
2346
} else if (message.type == 'psinfo') {
2347
if (xxdialogTag == ('ps|' + message.nodeid + '|' + message.pid)) {
2348
- console.log('aa', message);
2348
+ var x = '<div style=max-height:200px;overflow-y:auto>';
2349
+ //x += addHtmlValue4("Process ID", message.pid);
2350
+ if ((typeof message.value == 'object') && (Object.keys(message.value).length > 0)) {
2351
+ if (message.value.processName) { x += '<div style=padding:4px><div style=padding-bottom:4px>' + "Process Name" + '</div><div style=word-wrap:break-word;padding-left:6px><b>' + message.value.processName + '</b></div></div>'; }
2352
+ if (message.value.machineName) { x += addHtmlValue5("Machine Name", message.value.machineName); }
2353
+ if (message.value.cmd) { x += '<div style=padding:4px><div style=padding-bottom:4px>' + "Command Line" + '</div><div style=word-wrap:break-word;padding-left:6px><b>' + message.value.cmd + '</b></div></div>'; }
2354
+ if (message.value.mainWindowTitle) { x += '<div style=padding:4px><div style=padding-bottom:4px>' + "Window Title" + '</div><div style=word-wrap:break-word;padding-left:6px><b>' + message.value.mainWindowTitle + '</b></div></div>'; }
2355
+ if (message.value.processUser) { x += addHtmlValue5("User", message.value.processUser); }
2356
+ if (message.value.processDomain) { x += addHtmlValue5("Domain", message.value.processDomain); }
2357
+ if (message.value.startTime) { x += addHtmlValue5("Start Time", message.value.startTime); }
2358
+ x += '<hr />';
2359
+ if (message.value.PriorityBoostEnabled) { x += addHtmlValue5("Priority Boost", message.value.PriorityBoostEnabled?"Enabled":"Disabled"); }
2360
+ if (message.value.sessionId) { x += addHtmlValue5("Session Id", message.value.sessionId); }
2361
+ if (message.value.handleCount) { x += addHtmlValue5("Handle Count", message.value.handleCount); }
2362
+ if (message.value.privilegedProcessorTime) { x += addHtmlValue5("Privileged Processor Time", format("{0} seconds", message.value.privilegedProcessorTime)); }
2363
+ if (message.value.totalProcessorTime) { x += addHtmlValue5("Total Processor Time", format("{0} seconds", message.value.totalProcessorTime)); }
2364
+ if (message.value.userProcessorTime) { x += addHtmlValue5("User Processor Time", format("{0} seconds", message.value.userProcessorTime)); }
2365
+ if (message.value.nonpagedSystemMemorySize) { x += addHtmlValue5("Non Paged Memory", getNiceSize2(message.value.nonpagedSystemMemorySize)); }
2366
+ if (message.value.pagedMemorySize) { x += addHtmlValue5("Paged Memory", getNiceSize2(message.value.pagedMemorySize)); }
2367
+ if (message.value.privateMemorySize) { x += addHtmlValue5("Private Memory", getNiceSize2(message.value.privateMemorySize)); }
2368
+ if (message.value.virtualMemorySize) { x += addHtmlValue5("Virtual Memory", getNiceSize2(message.value.virtualMemorySize)); }
2369
+ if (message.value.workingSet) { x += addHtmlValue5("Working Set", getNiceSize2(message.value.workingSet)); }
2370
+ if (message.value.peakWorkingSet) { x += addHtmlValue5("Peak Working Set", getNiceSize2(message.value.peakWorkingSet)); }
2371
+ if (message.value.peakPagedMemorySize) { x += addHtmlValue5("Peak Paged Memory", getNiceSize2(message.value.peakPagedMemorySize)); }
2372
+ if (message.value.peakVirtualMemorySize) { x += addHtmlValue5("Peak Virtual Memory", getNiceSize2(message.value.peakVirtualMemorySize)); }
2373
+ } else {
2374
+ x += "No information provided";
2375
+ }
2376
+ x += '</div>';
2377
+ QH('id_dialogOptions', x);
2378
}
2379
}
2380
}
@@ -15587,6 +15616,7 @@
15616
function addHtmlValue2(t, v) { return '<div><div style=display:inline-block;float:right>' + v + '</div><div style=display:inline-block>' + t + '</div></div>'; }
15617
function addHtmlValue3(t, v) { return '<div><b>' + t + '</b></div><div style=margin-left:16px>' + v + '</div>'; }
15618
function addHtmlValue4(t, v) { return '<table style=width:100%><td style=width:120px>' + t + '<td style=text-align:right><b>' + v + '</b></table>'; }
15619
+ function addHtmlValue5(t, v) { return '<div style=padding:4px><div style=display:inline-block;float:right><b>' + v + '</b></div><div style=display:inline-block>' + t + '</div></div>'; }
15620
function focusTextBox(x) { setTimeout(function(){ Q(x).selectionStart = Q(x).selectionEnd = 65535; Q(x).focus(); }, 0); }
15621
function validateEmail(v) { var emailReg = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return emailReg.test(v); } // New version
15622
function isPrivateIP(a) { return (a.startsWith('10.') || a.startsWith('172.16.') || a.startsWith('192.168.')); }