22 Commits

Author SHA1 Message Date
e5a1d693f1 fix: lazy-load ReferenceError + localize Font Awesome
- app.js: remove window.Dashboard=... block that crashed the whole
  file before page scripts load (ReferenceError: Dashboard is not
  defined). Page objects are top-level const in global lexical
  scope; PAGE_OBJS map + indirect eval in loadScript onload now
  expose them to window for inline onclick / data-action lookups
- index.html: Font Awesome 6.5.1 localized (css/fontawesome.min.css
  + 8 webfont files) - no more cdnjs CDN (Edge Tracking Prevention
  blocked it, CN access unstable)
2026-08-22 19:29:24 +08:00
4ebabfc703 fix: remove Google Fonts dependency + lazy-load page scripts
- CSS: drop @import fonts.googleapis (blocked by CSP style-src,
  unreachable in CN) - use system font stack with YaHei fallback
- index.html: remove all 26 js/pages/*.js tags - core 4 scripts only
- app.js: route-based lazy loading - PAGE_SCRIPTS map, loadScript
  with cache, async route() loads page scripts before render
- cross-deps: home->ticket-create, reset defined in forgot.js
2026-08-22 12:26:15 +08:00
effc262382 fix: site name in top logo + server-list public + external API docs page
- app.js: set #logo-text (top bar) from window.__SITE_NAME__ - the
  top-right site name stayed default because only #site-title and
  #sidebar-title were set
- security.js: apiKeyGuard whitelist /api/polls/server-list so the
  ticket create page can load sub-servers (was 401 without api key)
- external-api.js: management page now only creates/manages clients,
  removed inline endpoint table
- new external-api-docs.js: full API doc page (auth flow, all 11
  endpoints, request/response examples, Node sample) at
  #/external-api-docs, linked from the management page
- index.html: load external-api-docs.js
2026-08-22 02:18:29 +08:00
65edbaf157 refactor: session-based external auth, dynamic sources, drop netease UID
Auth (external API):
- ID: 16-digit random (non-sequential); Secret: SeaReport- + 32 hex
- POST /auth/session: ID+Secret -> Bearer SESSION (24h, single-session,
  old session invalidated on re-issue, disabled client invalidates)
- clientAuth now validates Bearer SESSION via api_sessions JOIN api_clients

Sources (dynamic, no default, open-source friendly):
- sources table + CRUD route (/api/sources, owner; delete guarded by usage)
- users/user_identities.source ENUM -> VARCHAR, seeded netease/skin
- register/admin create/identity bind: validate against enabled sources
- UI: 来源管理 page; source dropdowns loaded dynamically everywhere
  (register, dashboard identity, users admin, bans), labels dynamic

UID removal:
- game_uid/reporter_game_uid no longer required (db default '', validations
  dropped, frontend fields optional)

Docs: EXTERNAL-API.md session flow + new credential format; API.md updated
Verified: 37 checks (syntax, session logic, source CRUD, UID removal, docs)
2026-08-19 20:08:06 +08:00
257cd14051 feat: external API for QQ bot - client id+secret auth, ticket tracking, bans, per-server data
- db: api_clients table + server_groups.alias + tickets/bans server_name (auto-migrate)
- external.js: client_id+secret auth (multi-client, bcrypt, show-once secret),
  legacy x-external-key compat, JWT pass-through
  - POST /tickets (optional server), GET /tickets/track?token= (full lifecycle)
  - GET/POST /bans, reported-players/stats/all-tickets with server filter
  - GET /servers (alias list), client CRUD (owner/admin, audit logged)
  - resolveServer: alias | 分组/子服 | server_name
- polls.js: server_groups CRUD with alias (add/edit, dup check)
- servers page: alias display + edit; new 外部API page: client mgmt + quick docs
- API.md: full external API section (auth matrix, server param syntax)
- verified: 37 checks incl. resolveServer sandbox (alias/group/fallback)
2026-08-19 19:12:34 +08:00
a11df22600 feat: system logs - email log + system log with admin UI
- db: email_logs (sent/failed) + system_logs (info/warn/error) tables,
  auto-migrated for existing installs
- backend/logger.js: logEmail/logSystem with try/catch (never breaks flow)
- mailer: log send result (SMTP unconfigured/sent/failed + error msg)
- webhook: log blocked-internal, non-2xx response, send failure
- server: error middleware records 500 errors to system_logs
- routes/logs.js: GET /logs/emails + /logs/system (admin/owner, filters)
- UI: 系统日志 page (owner/admin) with system/email tabs + filters
- API docs updated
2026-08-17 05:14:41 +08:00
d242786a3a feat: bans sidebar page, public view with masked names 2026-07-18 01:17:40 +08:00
ead50beccd feat: 6-digit email verification code, fix missing script+route includes 2026-07-17 00:34:47 +08:00
ab08b1a2a9 feat: feature discussion as separate detail page, not inline 2026-07-16 23:50:16 +08:00
f423e1f791 fix: dynamic site name from DB, displayed in header/title/sidebar 2026-07-16 04:02:19 +08:00
abf747e3af feat: dedicated server groups management page in sidebar 2026-07-16 03:56:09 +08:00
021351d898 fix: restore from regex corruption, JS-bind modal close, data-action delegation 2026-07-15 03:53:16 +08:00
0f64af42a1 feat: password reset + data-action delegation for all onclick 2026-07-15 02:45:33 +08:00
f0e891b17c fix: data-action delegation + convert onclick to event listeners, sidebar+logout+modals 2026-07-15 02:44:18 +08:00
9e15a319f5 fix: replace all inline onclick with JS event listeners (sidebar nav + logout) 2026-07-14 05:37:37 +08:00
4913984391 feat: poll groups/servers, timed polls, features sort+filter by group 2026-07-14 03:17:13 +08:00
d61ad2109f refactor: remove polls+features, move to standalone mc-vote repo 2026-07-14 03:11:26 +08:00
ee2f33c61f feat: feature voting (PCL-style), poll owner edit/delete, blind polls for all 2026-07-14 01:17:56 +08:00
116fe89ac8 feat: poll/voting system with live results and bar charts 2026-07-13 21:37:16 +08:00
a6058bf207 feat: top bar, footer, login/register buttons, ICP/copyright settings 2026-07-12 01:32:18 +08:00
e44ee885ca fix: add missing unclaimed.js and notifications.js script tags to index.html 2026-07-12 01:25:59 +08:00
247a4e851d feat: MC Report System - MySQL + Express + Vanilla JS SPA 2026-07-12 01:23:19 +08:00