Fix for reports, #3128

Ylian Saint-Hilaire committed Sep 13, 2021 at 15:01 UTC 72da3a683e187f227b9ef9fce83d361960d263bb
2 files changed +5 -4
meshuser.js
+1 -1
@@ -5539,7 +5539,7 @@ module.exports.CreateMeshUser = function (parent, db, ws, req, args, domain, use
5539 });
5540 }
5541
5542 - if (command.type == 2) { // This is the user bandwidth usage report.
5542 + if (command.type == 2) { // This is the user traffic usage report.
5543 // If we are not user administrator on this site, only search for events with our own user id.
5544 var ids = [user._id];
5545 if ((user.siteadmin & SITERIGHT_MANAGEUSERS) != 0) {
views/default.handlebars
+4 -3
@@ -14925,7 +14925,7 @@
14925 if (xxdialogMode) return;
14926 var y = '', x = '', settings = JSON.parse(getstore('_ReportSettings', '{}'));
14927
14928 - var options = { 1 : "Remote Sessions", 2 : "User Bandwidth Usage" }
14928 + var options = { 1 : "Remote Sessions", 2 : "User Traffic Usage" }
14929 for (var i in options) { y += '<option value=' + i + ((settings.type == i)?' selected':'') + '>' + options[i] + '</option>'; }
14930 x += addHtmlValue("Type", '<select id=d2reportType style=float:right;width:250px onchange=generateReportDialogValidate()>' + y + '</select>');
14931
@@ -15027,6 +15027,7 @@
15027 if (i != 0) { reportCSV += '"' + csvClean(renderReportFormatCSV(i, r.groupFormat)) + '"'; } else { reportCSV += '""'; }
15028 for (var k in r.columns) {
15029 var style = '';
15030 + if (r.columns[k].format != null) { style = 'white-space:nowrap;' }
15031 if (r.columns[k].align) { style = 'text-align:' + EscapeHtml(r.columns[k].align); }
15032 if (e[r.columns[k].id] != null) {
15033 x += '<td style="' + style + '">' + renderReportFormat(e[r.columns[k].id], r.columns[k].format) + '</td>';
@@ -15091,8 +15092,8 @@
15092
15093 function renderReportFormat(v, f) {
15094 if (v == null) return '';
15094 - if (f == 'datetime') { return printDateTime(new Date(v)).split(' ').join('&nbsp'); }
15095 - if (f == 'time') { return printTime(new Date(v)).split(' ').join('&nbsp'); }
15095 + if (f == 'datetime') { return printDateTime(new Date(v)); }
15096 + if (f == 'time') { return printTime(new Date(v)); }
15097 if (f == 'protocol') {
15098 if (v == 1) return "Terminal";
15099 if (v == 2) return "Desktop";