set avatar
This commit is contained in:
parent
982ddce087
commit
4fff49ff5d
@ -64,9 +64,10 @@ export default (router, tpl) => {
|
||||
router.get(/^\/ranking$/, async (req, res) => {
|
||||
try {
|
||||
const list = await sql('tags_assign')
|
||||
.select('user.user')
|
||||
.select('user.user', sql.raw('coalesce(user_options.avatar, 47319) as avatar'))
|
||||
.leftJoin('user', 'user.id', 'tags_assign.user_id')
|
||||
.groupBy('user.user')
|
||||
.leftJoin('user_options', 'user_options.user_id', 'user.id')
|
||||
.groupBy('user.user', 'user_options.avatar')
|
||||
.orderBy('count', 'desc')
|
||||
.countDistinct('tag_id', 'item_id', { as: 'count' });
|
||||
|
||||
|
@ -26,23 +26,25 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>id</th>
|
||||
<th>created_at</th>
|
||||
<th>last_used</th>
|
||||
<th>last_action</th>
|
||||
<th> </th>
|
||||
<th>id</th>
|
||||
<th> </th>
|
||||
<th>last action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@each(sessions as sess)
|
||||
<tr@if(sess.id === session.sess_id) style="background-color: rgb(0, 89, 0)"@endif>
|
||||
<td>{{ sess.kmsi ? '⚓' : '' }}</td>
|
||||
<td tooltip="{{ sess.browser }}" flow="right">{{ sess.id }}</td>
|
||||
<td>{{ new Date(sess.created_at * 1e3).toLocaleString("de-DE") }}</td>
|
||||
<td>{{ new Date(sess.last_used * 1e3).toLocaleString("de-DE") }}</td>
|
||||
<td tooltip="{{ sess.browser }}" flow="right">
|
||||
<p>{{ sess.id }}</p>
|
||||
<p><a href="#" onclick="alert('not yet implemented!');">logout</a></p>
|
||||
</td>
|
||||
<td>
|
||||
<p>last_used: {{ new Date(sess.last_used * 1e3).toLocaleString("de-DE") }}</p>
|
||||
<p>created_at: {{ new Date(sess.created_at * 1e3).toLocaleString("de-DE") }}</p>
|
||||
</td>
|
||||
<td><a href="{{ sess.last_action }}" target="_blank">{{ sess.last_action }}</a></td>
|
||||
<td><a href="#" onclick="alert('not yet implemented!');">logout</a></td>
|
||||
</tr>
|
||||
@endeach
|
||||
</tbody>
|
||||
|
Loading…
Reference in New Issue
Block a user