Add hidden username and email columns to users table

This commit is contained in:
JonnyWong16 2022-04-01 21:31:06 -07:00
parent b737ab96b4
commit 73b94782f9
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
4 changed files with 36 additions and 6 deletions

View file

@ -90,6 +90,30 @@ users_list_table_options = {
},
{
"targets": [3],
"data": "username",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
$(td).html(cellData);
}
},
"visible": false,
"width": "10%",
"className": "no-wrap"
},
{
"targets": [4],
"data": "email",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
$(td).html(cellData);
}
},
"visible": false,
"width": "10%",
"className": "no-wrap"
},
{
"targets": [5],
"data": "last_seen",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
@ -103,7 +127,7 @@ users_list_table_options = {
"className": "no-wrap"
},
{
"targets": [4],
"targets": [6],
"data": "ip_address",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData) {
@ -121,7 +145,7 @@ users_list_table_options = {
"className": "no-wrap modal-control-ip"
},
{
"targets": [5],
"targets": [7],
"data": "platform",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
@ -134,7 +158,7 @@ users_list_table_options = {
"className": "no-wrap modal-control"
},
{
"targets": [6],
"targets": [8],
"data":"player",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
@ -155,7 +179,7 @@ users_list_table_options = {
"className": "no-wrap modal-control"
},
{
"targets": [7],
"targets": [9],
"data":"last_played",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
@ -196,7 +220,7 @@ users_list_table_options = {
"className": "datatable-wrap"
},
{
"targets": [8],
"targets": [10],
"data": "plays",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {
@ -208,7 +232,7 @@ users_list_table_options = {
"className": "no-wrap"
},
{
"targets": [9],
"targets": [11],
"data": "duration",
"createdCell": function (td, cellData, rowData, row, col) {
if (cellData !== null && cellData !== '') {

View file

@ -33,6 +33,8 @@
<th align="left" id="edit_row">Edit</th>
<th align="right" id="avatar"></th>
<th align="left" id="friendly_name">User</th>
<th align="left" id="username">Username</th>
<th align="left" id="email">Email</th>
<th align="left" id="last_seen">Last Streamed</th>
<th align="left" id="last_known_ip">Last Known IP</th>
<th align="left" id="last_platform">Last Platform</th>

View file

@ -127,6 +127,7 @@ class Users(object):
'users.username',
'(CASE WHEN users.friendly_name IS NULL OR TRIM(users.friendly_name) = "" \
THEN users.username ELSE users.friendly_name END) AS friendly_name',
'users.email',
'users.thumb AS user_thumb',
'users.custom_avatar_url AS custom_thumb',
'COUNT(DISTINCT %s) AS plays' % group_by,
@ -202,6 +203,7 @@ class Users(object):
'user_id': item['user_id'],
'username': item['username'],
'friendly_name': item['friendly_name'],
'email': item['email'],
'user_thumb': user_thumb,
'plays': item['plays'],
'duration': item['duration'],

View file

@ -1305,6 +1305,8 @@ class WebInterface(object):
# TODO: Find some one way to automatically get the columns
dt_columns = [("user_thumb", False, False),
("friendly_name", True, True),
("username", True, True),
("email", True, True),
("last_seen", True, False),
("ip_address", True, True),
("platform", True, True),