[pbs-devel] [PATCH proxmox-backup 2/2] ui: UserView: render name as 'Firstname Lastname'

Dominik Csapak d.csapak at proxmox.com
Wed Nov 11 13:34:14 CET 2020


instead of only the firstname

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 www/config/UserView.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/www/config/UserView.js b/www/config/UserView.js
index c2556b97..f030b30c 100644
--- a/www/config/UserView.js
+++ b/www/config/UserView.js
@@ -76,6 +76,17 @@ Ext.define('PBS.config.UserView', {
 	    }).show();
 	},
 
+	renderName: function(val, cell, rec) {
+	    let name = [];
+	    if (rec.data.firstname) {
+		name.push(rec.data.firstname);
+	    }
+	    if (rec.data.lastname) {
+		name.push(rec.data.lastname);
+	    }
+	    return name.join(' ');
+	},
+
 	renderUsername: function(userid) {
 	    return Ext.String.htmlEncode(userid.match(/^(.+)@([^@]+)$/)[1]);
 	},
@@ -181,6 +192,7 @@ Ext.define('PBS.config.UserView', {
 	    width: 150,
 	    sortable: true,
 	    dataIndex: 'firstname',
+	    renderer: 'renderName',
 	},
 	{
 	    header: gettext('Comment'),
-- 
2.20.1






More information about the pbs-devel mailing list