From 6b07908084ba3cf8e3590227277ca9f370c6560e Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Mon, 5 Feb 2024 19:02:43 +0100 Subject: [PATCH] WebAdmin: add groups to users page Signed-off-by: Nicola Murino --- templates/webadmin/users.html | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/templates/webadmin/users.html b/templates/webadmin/users.html index b89356da..43e049f0 100644 --- a/templates/webadmin/users.html +++ b/templates/webadmin/users.html @@ -93,9 +93,9 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). @@ -120,7 +120,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). 2FA Disk quota Transfer quota - Description + Groups @@ -441,17 +441,24 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). } }, { - data: "description", + data: "groups", visible: false, - defaultContent: "", + orderable: false, + defaultContent: [], render: function(data, type, row) { - if (type === 'display') { - if (data){ - return escapeHTML(data); - } - return "" + if (!data){ + return ""; } - return data; + let groups = []; + let result = ""; + for (i = 0; i < data.length; i++){ + groups.push(data[i].name); + } + result = groups.join(", "); + if (type === 'display') { + return escapeHTML(result); + } + return result; } }, { @@ -569,7 +576,7 @@ explicit grant from the SFTPGo Team (support@sftpgo.com). handleColVisibilityCheckbox($('#checkCol2FA'), 6); handleColVisibilityCheckbox($('#checkColDiskQuota'), 7); handleColVisibilityCheckbox($('#checkColTransferQuota'), 8); - handleColVisibilityCheckbox($('#checkColDesc'), 9); + handleColVisibilityCheckbox($('#checkColGroups'), 9); } function handleRowActions() {