misc
This commit is contained in:
parent
081df808d9
commit
aa7b56f31f
|
@ -109,6 +109,8 @@ export default new class {
|
|||
tags[t].badge = "badge-russia badge-light";
|
||||
else if(tags[t].tag.match(/german/))
|
||||
tags[t].badge = "badge-german badge-light";
|
||||
else if(tags[t].tag.match(/dutch/))
|
||||
tags[t].badge = "badge-dutch badge-light";
|
||||
else if(tags[t].tag === "sfw")
|
||||
tags[t].badge = "badge-success";
|
||||
else if(tags[t].tag === "nsfw")
|
||||
|
|
|
@ -23,7 +23,7 @@ export default (router, tpl) => {
|
|||
const user = req.url.split[3] === "user" ? req.url.split[4] : "%";
|
||||
const mime = (allowedMimes.filter(n => req.url.split[3]?.startsWith(n))[0] ? req.url.split[3] : "") + "%";
|
||||
|
||||
const rows = await sql("items").orderByRaw("rand()").limit(1).where("mime", "like", mime).andWhere("username", "like", user);
|
||||
const rows = await sql("items").orderByRaw("rand()").limit(1).where("mime", "ilike", mime).andWhere("username", "ilike", user);
|
||||
|
||||
res
|
||||
.writeHead(200, { "Content-Type": "application/json" })
|
||||
|
|
|
@ -78,7 +78,7 @@ export default (router, tpl) => {
|
|||
.count('t.part as c')
|
||||
.groupBy('t.part')
|
||||
.orderBy('c', 'desc')
|
||||
.limit(10);
|
||||
.limit(20);
|
||||
|
||||
res.reply({
|
||||
body: tpl.render('ranking', {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
@include(snippets/header)
|
||||
<h1>Ranking lol</h1>
|
||||
<h3>tags by user</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -18,7 +19,7 @@
|
|||
@endfor
|
||||
</tbody>
|
||||
</table>
|
||||
<hr />
|
||||
<h3>tag stats</h3>
|
||||
<table class="table">
|
||||
<tr><td>total</td><td>{{ stats.total }}</td></tr>
|
||||
<tr><td>tagged</td><td>{{ stats.tagged }}</td></tr>
|
||||
|
@ -26,11 +27,11 @@
|
|||
<tr><td>SFW</td><td>{{ stats.sfw }}</td></tr>
|
||||
<tr><td>NSFW</td><td>{{ stats.nsfw }}</td></tr>
|
||||
</table>
|
||||
<hr />
|
||||
<h3>top {{ hoster.length }} hoster</h3>
|
||||
<table class="table">
|
||||
@each(hoster as host)
|
||||
<tr>
|
||||
<td>{{ host.part }}</td>
|
||||
<td>{{ host.part.length ? host.part : "Telegram" }}</td>
|
||||
<td>{{ host.c }}</td>
|
||||
</tr>
|
||||
@endeach
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
@include(snippets/header)
|
||||
<h1>Settings</h1>
|
||||
@if(session.avatar)<img src="/t/{{ session.avatar }}.png" />@endif
|
||||
@if(session.avatar)<a href="//f0ck.me/{{ session.avatar }}"><img src="/t/{{ session.avatar }}.png" /></a>@endif
|
||||
<h2>Account</h2>
|
||||
<table class="table">
|
||||
<tbody>
|
||||
|
@ -18,7 +18,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td>avatar</td>
|
||||
<td><input type="number" class="input" value="{{ session.avatar }}" /><input type="submit" value="save" /></td>
|
||||
<td><input type="text" class="input" value="{{ session.avatar }}" /><input type="submit" value="save" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<td>{{ new Date(sess.created_at * 1e3).toLocaleString("de-DE") }}</td>
|
||||
<td>{{ new Date(sess.last_used * 1e3).toLocaleString("de-DE") }}</td>
|
||||
<td><a href="{{ sess.last_action }}" target="_blank">{{ sess.last_action }}</a></td>
|
||||
<td>logout</td>
|
||||
<td><a href="#" onclick="alert('not yet implemented!');">logout</a></td>
|
||||
</tr>
|
||||
@endeach
|
||||
</tbody>
|
||||
|
|
Loading…
Reference in New Issue
Block a user