feat(web): Calm modern redesign, overview, shell charts #32

Open
thelion wants to merge 0 commits from thelion/ui-calm-modern into main AGit
Owner

New design across the app; Overview home (/) with charts, queue at /queue; account page Problems summary; shell 24h charts from VictoriaMetrics; GET /api/overview, /api/requests/{id}/shell-metrics; migration 000021 abuse_scans.

New design across the app; Overview home (/) with charts, queue at /queue; account page Problems summary; shell 24h charts from VictoriaMetrics; GET /api/overview, /api/requests/{id}/shell-metrics; migration 000021 abuse_scans.
Move the G prototype's palette, radii, shadow and fonts into app.css and
the Tailwind theme. The old token names (panel, surface, border, fg,
muted, faint, signal, warn, danger, link) map onto the new values so
every page picks the look up unchanged; muted is #8b98a8 and faint
#76838f so secondary text keeps 4.5:1. Adds shared .btn/.field/.count
classes and the .tint-bad/.tint-warn problem washes (no edge bars).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Panel, Chip, ProblemRow, Metric, Sparkline, Bars, Ring, FoldLine,
SectionHeader, PageHeader, RiskBar, Kbd, Icon (the prototype's stroke
icons) and the CommandPalette, all Svelte 5 runes, importable from
$lib/components/ui.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Desktop gets a left sidebar (brand, search, icon nav with live count
badges, abuse-scan status footer); under 860px a sticky top bar with
search and menu buttons and scrolling tab pills. Active items are a
lighter background, brighter text and a phosphor icon, never a bar.
Counts are real: open queue (warn when escalated), flagged accounts
(bad when any high), IDS alerts in 24h, unread support mail.

The palette opens on ⌘K/Ctrl-K or /, jumps to pages, searches accounts
through /api/requests, and offers an IP lookup (/lookup now reads ?ip=)
and a queue search. It has an empty "Needs you" slot for the overview.
Content runs full width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Undecided requests lead, with a risk bar, a ↳ line of the strongest
risk signals from the latest decision, a tinted background for risky
rows and the checker's suggested action as the primary button (review
for escalations, reject when it says reject, approve otherwise). Reject
and block confirm in place. Decided requests fold under a line unless a
status filter or search is active. Filters, sorting, paging, search,
?q=, the new-request form and block/unblock all keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One call with everything the Overview page shows: open flags (counts by
severity, open flags per scan over 5h), every shell's health (down / warn
/ ok / stopped with a reason, from shellsd's new /v1/shells-health), the
sign-up queue (pending, escalated, oldest wait, sign-ups per day for 14
days, the open rows with risk reasons, ASN and services), IDS alerts over
the last 24h (per hour, high count, latest four grouped by shell and
rule), unread support mail, the latest activity, and a merged "needs
attention" list (high flags, down shells, escalated sign-ups: one item per
account, with a suggested action).

Layered as repository -> service (internal/services/overview) -> handler.
shellsd's health is cached 30s and IDS 60s, served stale while they
refresh; a first, uncached load waits at most 4s, and serve warms both at
start. Warm requests take ~20ms against Postgres.

Scan history wasn't kept, so each abuse sync now records the open/high
flag count per scan in a new abuse_scans table (migration 20, 30 days):
the sparkline fills in from deploy on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings in GET /api/overview and the sign-up similarity feature. The
queue page keeps its Calm modern restyle; the "similar accounts" badge
is re-added in the new style as a strength chip plus a link to the
account it resembles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Open high/medium flags lead as tinted problem rows, high first, with
review, dismiss and ban actions; low, closed and reviewed flags fold
under a quiet line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Filters become one toolbar (type pills, shell and search fields, a range
switch in the header); top rules and shells are plain lists; events are
the prototype's IDS list with severity chips, high alerts tinted, and
the full record on click.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Source pills and an actor field as the toolbar; events grouped by day in
a quiet list (time, who did what to whom, detail, source word).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
One search field with a Look up button; the answer is a panel with the
address, a hosting/residential chip (word + colour) and a key/value list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PageHeader with a crumb back to the account, a ban/manual chip and the
.txt download; the report facts as a key/value panel; sections as
collapsible rows with output in code wells, errors tinted red.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MailBox gets a PageHeader (address, unread count, sync state, Check now
and New email), a thread list panel with search and filter pills, and a
reading pane; the selected thread is a raised row, never an edge bar.
MailMessage and Composer move to the kit's surfaces, .field and .btn,
with words instead of emoji (sent/received, N files, Attach).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PageHeader, layer toggles as pills (dot + word, struck through when
hidden), a kit search field, and a calm stage without the scan line and
corner brackets. The detail card uses chips (status as a word) and kit
buttons; popups move to the kit surfaces. The globe itself is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The account page leads with identity (avatar, status chip, risk,
created date) and its actions: approve/reject while undecided, Suspend
and Ban… otherwise, with the rarer ones (override, unblock, reevaluate,
resend, portal account, IRC ban, collect evidence, delete) in a ⋯ menu.

A Problems section comes first, derived from what the page already
loads: open abuse flags, shell-details trouble (no IPv4, down or stale
routes, exited containers, memory at 65%/85%, near-full disks, other
shellsd warnings), DroneBL abuse listings and Spamhaus ASNs, a risky
verdict on an undecided request and an approved account missing from
ZNC. Each is a ProblemRow with a link to its evidence; the checks that
pass sit in a quiet Healthy line.

Under it, two columns of cards: shell (memory and disk rings), sites
and hostnames, processes (base folded), listening ports, containers,
crontab, abuse flags and IDS on the left; account, services,
reputation, logins, addresses, note and decisions on the right. The
shell details and reputation now load in the page and are handed to
their panels so the summary can read them; every action, refresh,
recheck, the ban flow, note saving and evidence links are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ports the G prototype's GC chart kit to Svelte: TimeChart (lines, areas
and time-bucketed stacked bars with thresholds, bands, markers and
annotation lanes), BandBarChart (categorical stacked bars with an
average line), Sparkline, StatTile, SegmentedBar, CellGrid and MeterRow.

Charts redraw from their container's ResizeObserver width rather than
scaling a viewBox, so ticks stay 11.5px on a phone. The crosshair snaps
to the nearest point, bars hit-test the whole column, and one shared
tooltip (filled with textContent) works on hover, tap and keyboard;
tapping outside closes it. Every chart takes a required aria-label and
has a Table toggle for an accessible data table. Colour carries status
only, plus one neutral ramp.

The phase-1 Sparkline, Bars and Ring are removed (nothing used them).
On phones a Metric's trend and caption now span the full card width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The new home page reads GET /api/overview and polls it every minute
while the tab is visible: a greeting line, four stat tiles with deltas
from the API series, "Needs attention" from attention[] (Suspend posts
to the item's endpoint after a two-click confirm; Review opens the
account), a fold for lower-severity flags, shells health (segmented bar,
per-shell cells with tooltips, problem rows, healthy fold), open flags
per scan, sign-ups per day, a compact sign-up queue, IDS alerts per hour
with the latest alerts, and activity.

Degraded states are said plainly: per-section errors{} lines, shellsd or
the IDS unavailable, an incomplete IDS read (a lower bound), and an empty
perScan ("collecting history, fills in over ~5h").

The queue now lives at /queue. Old links keep working: /?q=… and the
other queue filters redirect there, and the mail page, the palette's
queue search and the request page's back link point at /queue. The queue
also reads ?status=. The sidebar highlights Overview on / and Queue on
/queue and the request pages, and the ⌘K palette's "Needs you" group is
filled from attention[].

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Restyled flags, ids, mail, audit, lookup, geo and evidence pages.
MailBox conflict: kept the pages version and pointed its "search the
queue" link (and the evidence crumb) at /queue.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restyled account page with its Problems summary.

Conflict in routes/requests/[id]/+page.svelte: took the account
branch's page and re-applied the overview branch's queue move (the
breadcrumb and the after-delete redirect go to /queue). The overview
branch's similar-accounts panel drops out here and comes back as a
G-kit card in the next commit.

ui/Ring is gone (the overview branch replaced it with the chart kit),
so the Shell card's memory and disk rings become chart-kit MeterRows,
with a hairline at the warn threshold the Problems summary uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /api/requests/{id}/shell-metrics?range=1h|6h|24h|7d returns memory
(% of limits.memory, used bytes, limit), CPU (% of one core) and network
in/out (bytes/s) for the account's shell, from the VictoriaMetrics that
already scrapes the shells host's Incus exporter. Points sit on a fixed
grid of 241-289 steps with null gaps; a shell with no samples gets empty
arrays and a reason per chart. Results are cached per (shell, range) for
60s, and partial failures are reported in errors without being cached.

All three come from Incus (scraped from outside the container): its
memory matches shell-details' usage, its cgroup CPU accounting is exact
where telegraf's lxcfs view runs several times high, and owners can't
stop or edit it.

VICTORIAMETRICS_URL turns it on (docker-compose: http://victoriametrics:8428).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sign-up similarity panel from main becomes a Card in the account
page layout (left column for sign-ups without a shell, under
Reputation otherwise): strength and status chips with words, reasons
labelled strong/medium/weak, tinted rows for banned matches, the
legend and the Recheck button kept. The page loads the report so the
Problems summary can read it: every match with a banned account is
also a ProblemRow (strong: bad, medium: warn) linking to the banned
account and to the card; otherwise "Similar accounts" joins the
Healthy line.

The Shell card gets a ShellMetrics stub where the 24h memory, CPU and
network charts from GET /api/requests/{id}/shell-metrics will go; it
renders nothing until it is given data. AccountMail's buttons use the
G stroke icons instead of glyphs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts:
#	internal/commands/serve.go
feat(web): shell history charts on the account page; calmer memory thresholds
All checks were successful
Release / release (push) Successful in 11m38s
5588a92ab7
The Shell card now shows memory, CPU and network for the account's shell
from GET /api/requests/{id}/shell-metrics, as three small multiples
(TimeChart) on one linked crosshair with a 1h / 6h / 24h / 7d switch
(24h by default) that refetches. Memory is % of the limit with the used
bytes in the tooltip, captioned "incl. cache" (Incus counts page cache, so
near 100% is normal) and with no warn line; CPU is % of one core; network
is in and out in B/s. Per-chart errors show as a quiet line, and a 404 or
503 (VICTORIAMETRICS_URL not set) means no charts at all. The page loads
the metrics like its other panels and refreshes them with the shell.

TimeChart gains `gaps` (null values break lines and areas instead of
dropping to 0) and time ticks for sub-2h and multi-day spans.

Memory in the Problems list and the Shell card's meter now warns at 92%
and is only "bad" at 98% when the shell also uses at least 256 MB of swap
(cache alone never swaps); the why-line says "incl. page cache". Idle
shells sit at 42-51% and a busy one can read 99% with ~87 MB really used,
so 65% / 85% flagged healthy shells. Disk thresholds are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All checks were successful
Release / release (push) Successful in 11m38s
This branch is already included in the target branch. There is nothing to merge.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin +refs/pull/32/head:thelion/ui-calm-modern
git switch thelion/ui-calm-modern

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch main
git merge --no-ff thelion/ui-calm-modern
git switch thelion/ui-calm-modern
git rebase main
git switch main
git merge --ff-only thelion/ui-calm-modern
git switch thelion/ui-calm-modern
git rebase main
git switch main
git merge --no-ff thelion/ui-calm-modern
git switch main
git merge --squash thelion/ui-calm-modern
git switch main
git merge --ff-only thelion/ui-calm-modern
git switch main
git merge thelion/ui-calm-modern
git push origin main
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ircforever/managebot!32
No description provided.