add windows av/update/firewall to columns (#5534)

Simon Smith committed Nov 11, 2023 at 03:16 UTC c97e9f4f270d2d7bc76ef7748f86c08b436ed503
1 file changed +18
views/default.handlebars
+18
@@ -3969,6 +3969,9 @@
3969 x += '<label><input id=d2c6 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('desc') >= 0)?' checked':'') + '>' + "Device Description" + '</label><br />';
3970 x += '<label><input id=d2c5 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('os') >= 0)?' checked':'') + '>' + "Operating System" + '</label><br />';
3971 x += '<label><input id=d2c10 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('tags') >= 0)?' checked':'') + '>' + "Tags" + '</label><br />';
3972 + x += '<label><input id=d2c11 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('windowsav') >= 0)?' checked':'') + '>' + "Windows AV" + '</label><br />';
3973 + x += '<label><input id=d2c12 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('windowsupdate') >= 0)?' checked':'') + '>' + "Windows Update" + '</label><br />';
3974 + x += '<label><input id=d2c13 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('windowsfirewall') >= 0)?' checked':'') + '>' + "Windows Firewall" + '</label><br />';
3975 x += '<label><input id=d2c1 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('links') >= 0)?' checked':'') + '>' + "MeshCentral Router Links" + '</label><br />';
3976 x += '<label><input id=d2c2 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('user') >= 0)?' checked':'') + '>' + "Logged in users" + '</label><br />';
3977 x += '<label><input id=d2c3 type=checkbox' + ((deviceViewSettings.devsCols.indexOf('ip') >= 0)?' checked':'') + '>' + "Agent IP address" + '</label><br />';
@@ -3989,6 +3992,9 @@
3992 if (Q('d2c8').checked) { cols.push('agtype'); }
3993 if (Q('d2c9').checked) { cols.push('agver'); }
3994 if (Q('d2c10').checked) { cols.push('tags'); }
3995 + if (Q('d2c11').checked) { cols.push('windowsav'); }
3996 + if (Q('d2c12').checked) { cols.push('windowsupdate'); }
3997 + if (Q('d2c13').checked) { cols.push('windowsfirewall'); }
3998 deviceViewSettings.devsCols = cols;
3999 putstore('_deviceViewSettings', JSON.stringify(deviceViewSettings));
4000 mainUpdate(4);
@@ -4426,6 +4432,9 @@
4432 if (deviceViewSettings.devsCols.indexOf('agver') >= 0) { colums += '<th style=color:gray;width:100px>' + "Agent Version"; }
4433 if (deviceViewSettings.devsCols.indexOf('os') >= 0) { colums += '<th style=color:gray;width:160px>' + "OS"; }
4434 if (deviceViewSettings.devsCols.indexOf('tags') >= 0) { colums += '<th style=color:gray;width:120px>' + "Tags"; }
4435 + if (deviceViewSettings.devsCols.indexOf('windowsav') >= 0) { colums += '<th style=color:gray;width:100px>' + "Windows AV"; }
4436 + if (deviceViewSettings.devsCols.indexOf('windowsupdate') >= 0) { colums += '<th style=color:gray;width:120px>' + "Windows Update"; }
4437 + if (deviceViewSettings.devsCols.indexOf('windowsfirewall') >= 0) { colums += '<th style=color:gray;width:120px>' + "Windows Firewall"; }
4438 if (deviceViewSettings.devsCols.indexOf('links') >= 0) { colums += '<th style=color:gray;width:120px>' + "Links"; }
4439 if (deviceViewSettings.devsCols.indexOf('user') >= 0) { colums += '<th style=color:gray;width:120px>' + "User"; }
4440 if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { colums += '<th style=color:gray;width:120px>' + "Address"; }
@@ -4729,6 +4738,15 @@
4738 }
4739 r += '<span style=line-height:20px>' + groupingTags + '</span>';
4740 }
4741 + if (deviceViewSettings.devsCols.indexOf('windowsav') >= 0) { // Windows AV
4742 + r += '<td style=text-align:center>' + (node.wsc ? (node.wsc.antiVirus == 'OK' ? "<span style=color:green>OK</span>" : "<span style=color:red>OK</span>") : "");
4743 + }
4744 + if (deviceViewSettings.devsCols.indexOf('windowsupdate') >= 0) {// Windows Update
4745 + r += '<td style=text-align:center>' + (node.wsc ? (node.wsc.autoUpdate == 'OK' ? "<span style=color:green>OK</span>" : "<span style=color:red>OK</span>") : "");
4746 + }
4747 + if (deviceViewSettings.devsCols.indexOf('windowsfirewall') >= 0) { // Windows Firewall
4748 + r += '<td style=text-align:center>' + (node.wsc ? (node.wsc.firewall == 'OK' ? "<span style=color:green>OK</span>" : "<span style=color:red>OK</span>") : "");
4749 + }
4750 if (deviceViewSettings.devsCols.indexOf('links') >= 0) { r += '<td style=text-align:center;font-size:x-small>' + getShortRouterLinks(node); } // Links
4751 if (deviceViewSettings.devsCols.indexOf('user') >= 0) { r += '<td style=text-align:center>' + getUserShortStr(node); } // User
4752 if (deviceViewSettings.devsCols.indexOf('ip') >= 0) { var ip = ''; if (node.mtype == 3) { ip = node.host; } else if (node.ip) { ip = node.ip; } r += '<td style=text-align:center>' + ip; } // IP address