hoster in ranking
This commit is contained in:
parent
800544478f
commit
da6b310449
@ -72,8 +72,21 @@ export default (router, tpl) => {
|
||||
|
||||
const stats = await lib.countf0cks();
|
||||
|
||||
const hoster = await sql.with('t', sql.raw("select split_part(substring(src, position('//' in src)+2), '/', 1) part from items"))
|
||||
.from('t')
|
||||
.select('t.part')
|
||||
.count('t.part as c')
|
||||
.groupBy('t.part')
|
||||
.orderBy('c', 'desc')
|
||||
.limit(10);
|
||||
|
||||
res.reply({
|
||||
body: tpl.render('ranking', { list, stats, tmp: null }, req)
|
||||
body: tpl.render('ranking', {
|
||||
list,
|
||||
stats,
|
||||
hoster,
|
||||
tmp: null
|
||||
}, req)
|
||||
});
|
||||
} catch(err) {
|
||||
res.end(JSON.stringify(err.message));
|
||||
|
@ -26,4 +26,13 @@
|
||||
<tr><td>SFW</td><td>{{ stats.sfw }}</td></tr>
|
||||
<tr><td>NSFW</td><td>{{ stats.nsfw }}</td></tr>
|
||||
</table>
|
||||
<hr />
|
||||
<table class="table">
|
||||
@each(hoster as host)
|
||||
<tr>
|
||||
<td>{{ host.part }}</td>
|
||||
<td>{{ host.c }}</td>
|
||||
</tr>
|
||||
@endeach
|
||||
</table>
|
||||
@include(snippets/footer)
|
||||
|
Loading…
Reference in New Issue
Block a user