Added OS column to device view. #2580
Ylian Saint-Hilaire committed
May 4, 2021 at 13:44 UTC
643083779c71c09fd758bebb4086363a2e864cbd
1 file changed
+4
views/default.handlebars
+4
@@ -3470,6 +3470,7 @@
3470
3471
// Display the dialog box
3472
var x = '';
3473
+ x += '<label><input id=d2c5 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('os') >= 0)?' checked':'') + '>' + "Operating System" + '</label><br />';
3474
x += '<label><input id=d2c1 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('links') >= 0)?' checked':'') + '>' + "MeshCentral Router Links" + '</label><br />';
3475
x += '<label><input id=d2c2 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('user') >= 0)?' checked':'') + '>' + "Logged in users" + '</label><br />';
3476
x += '<label><input id=d2c3 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('ip') >= 0)?' checked':'') + '>' + "Agent IP address" + '</label><br />';
@@ -3483,6 +3484,7 @@
3484
if (Q('d2c2').checked) { cols.push('user'); }
3485
if (Q('d2c3').checked) { cols.push('ip'); }
3486
if (Q('d2c4').checked) { cols.push('conn'); }
3487
+ if (Q('d2c5').checked) { cols.push('os'); }
3488
deviceViewSettings.devsCols = cols;
3489
putstore('_deviceViewSettings', JSON.stringify(deviceViewSettings));
3490
mainUpdate(4);
@@ -3893,6 +3895,7 @@
3895
if (!Array.isArray(deviceViewSettings.devsCols)) { deviceViewSettings.devsCols = ['user','ip','conn']; }
3896
3897
// Display configured columns
3898
+ if (deviceViewSettings.devsCols.indexOf('os') >= 0) { colums += '<th style=color:gray;width:160px>' + "OS"; }
3899
if (deviceViewSettings.devsCols.indexOf('links') >= 0) { colums += '<th style=color:gray;width:120px>' + "Links"; }
3900
if (deviceViewSettings.devsCols.indexOf('user') >= 0) { colums += '<th style=color:gray;width:120px>' + "User"; }
3901
if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { colums += '<th style=color:gray;width:120px>' + "Address"; }
@@ -4149,6 +4152,7 @@
4152
if (!Array.isArray(deviceViewSettings.devsCols)) { deviceViewSettings.devsCols = ['user','ip','conn']; }
4153
4154
// Display configured columns
4155
+ if (deviceViewSettings.devsCols.indexOf('os') >= 0) { r += '<td style=text-align:center;font-size:x-small title="' + EscapeHtml(node.osdesc?node.osdesc:'') + '">' + EscapeHtml(node.osdesc?node.osdesc:''); } // Operating System
4156
if (deviceViewSettings.devsCols.indexOf('links') >= 0) { r += '<td style=text-align:center;font-size:x-small>' + getShortRouterLinks(node); } // Links
4157
if (deviceViewSettings.devsCols.indexOf('user') >= 0) { r += '<td style=text-align:center>' + getUserShortStr(node); } // User
4158
if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { r += '<td style=text-align:center>' + (node.ip != null ? node.ip : ''); } // IP address