mirror of
https://github.com/burrow-dev/burrow-server.git
synced 2026-11-19 09:37:50 -05:00
feat: stats graphs, playtime, ip search against ban evasion, 150-char chat
- stats graphs for the admin and moderator panels (lib/stats.js, public/stats-view.html) - playtime, private unless shown on the card's bio tab; set on the account page - search accounts by ip address, only against ban evasion; mods see no addresses and each search is logged - privacy policy for the above (terms version 2026-10-17) - the per-second save looks only at accounts in play, with a slow sweep of the rest - items in several dens at once; chat filter hides slurs and threats by default - sexual usernames refused; moderators may enter full rooms; guide login allowed - 150-character chat box (client build 55) - fixes: gifts, trades, dens, pets in dens, den recycling, special animals' colours, jammer walls, settings switches; the buddy list sent at login - the item giver, the rules screen and the art studio rework
This commit is contained in:
1 parent
8400d2f928
commit
04f468af2c
56 files changed
+25667
-3894
No files matched your search
+16
-1
@@ -19,6 +19,7 @@ const modpanel = require("./modpanel.js");
|
||||
const erase = require("./erase.js");
|
||||
const reports = require("./reports.js");
|
||||
const sales = require("./sales.js");
|
||||
const stats = require("./stats.js");
|
||||
const staff = require("./staff.js");
|
||||
const support = require("./support.js");
|
||||
const totp = require("./totp.js");
|
||||
@@ -140,6 +141,8 @@ const accountRow = (account, playing) => {
|
||||
badges: account.badges,
|
||||
featuresOff: accounts.FEATURES.filter(name => !accounts.featureOn(account, name)),
|
||||
logins: account.numLogins,
|
||||
playtime: account.playtime,
|
||||
playtimePublic: account.playtimePublic,
|
||||
online: playing.has(account.username),
|
||||
room: playing.get(account.username) || null,
|
||||
// seconds left, -1 for permanent, 0 for not banned
|
||||
@@ -563,7 +566,7 @@ const handle = async (req, res, url, from, web) => {
|
||||
const route = `${req.method} ${url.pathname.replace(/\/$/, "") || "/admin"}`;
|
||||
|
||||
if (route === "GET /admin") {
|
||||
web.send(res, 200, await fs.promises.readFile(path.join(config.publicDir, "admin.html")), "text/html; charset=utf-8");
|
||||
web.send(res, 200, await stats.withView(await fs.promises.readFile(path.join(config.publicDir, "admin.html"))), "text/html; charset=utf-8");
|
||||
return;
|
||||
}
|
||||
if (req.method === "POST" && !sameOrigin(req)) {
|
||||
@@ -646,6 +649,18 @@ const handle = async (req, res, url, from, web) => {
|
||||
return;
|
||||
}
|
||||
|
||||
// the graphs (lib/stats.js): the last `days` days, by the viewer's clock.
|
||||
case "GET /admin/api/stats":
|
||||
reply(200, stats.report(Number(url.searchParams.get("days")), Number(url.searchParams.get("offset"))));
|
||||
return;
|
||||
|
||||
// who signed in from an address, or from addresses starting so.
|
||||
case "GET /admin/api/address-search": {
|
||||
const found = staff.byAddress(url.searchParams.get("q"));
|
||||
reply(found.error ? 400 : 200, found);
|
||||
return;
|
||||
}
|
||||
|
||||
case "GET /admin/api/logs": {
|
||||
const lines = log.recent(Number(url.searchParams.get("after")) || 0, (url.searchParams.get("filter") || "").slice(0, 100));
|
||||
reply(200, {lines, newest: log.count()});
|
||||
|
||||
Reference in new issue
Block a user