mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: show list of recent users in dashboard/users
This commit is contained in:
@@ -262,12 +262,17 @@ dashboardController.getUsers = async (req, res) => {
|
||||
};
|
||||
|
||||
// List of recently registered users
|
||||
const end = parseInt(req.query.until, 10) || Date.now();
|
||||
const start = end - (1000 * 60 * 60 * (req.query.units === 'days' ? 24 : 1) * (req.query.count || (req.query.units === 'days' ? 30 : 24)));
|
||||
const uids = await db.getSortedSetRangeByScore('users:joindate', 0, 500, start, end);
|
||||
const users = await user.getUsersFields(uids, ['uid', 'username', 'email', 'joindate']);
|
||||
|
||||
res.render('admin/dashboard/users', {
|
||||
set: 'registrations',
|
||||
query: req.query,
|
||||
stats,
|
||||
summary,
|
||||
users,
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,23 @@
|
||||
<div class="row dashboard">
|
||||
<div class="col-xs-12">
|
||||
<!-- IMPORT admin/partials/dashboard/graph.tpl -->
|
||||
<!-- IMPORT admin/partials/dashboard/stats.tpl -->
|
||||
</div>
|
||||
<div class="dashboard">
|
||||
<!-- IMPORT admin/partials/dashboard/graph.tpl -->
|
||||
<!-- IMPORT admin/partials/dashboard/stats.tpl -->
|
||||
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<th class="text-muted">[[admin/manage/users:users.uid]]</th>
|
||||
<th class="text-muted">[[admin/manage/users:users.username]]</th>
|
||||
<th class="text-muted">[[admin/manage/users:users.email]]</th>
|
||||
<th data-sort="joindate">[[admin/manage/users:users.joined]]</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{{ each users }}}
|
||||
<tr>
|
||||
<td>{../uid}</td>
|
||||
<td>{../username}</td>
|
||||
<td>{../email}</td>
|
||||
<td><span class="timeago" title="{../joindateISO}"></span></td>
|
||||
</tr>
|
||||
{{{ end }}}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
Reference in New Issue
Block a user