Files
mirror-3x-ui/docs/public
Mahdi Fallahnejhad ee760de2c8 feat(clients): show a client's usage and change history in the editor (#7031)
The client editor gets a "Usage & change history" button: lifetime traffic
(every closed cycle plus the open one), usage per node since the last reset,
the past cycles, and a log of what changed on the client and from where.

A cycle is archived in one place, whenever a traffic reset or an auto-renewal
zeroes a client's counters. Both tables are bounded per client: the newest 100
cycles are kept and older ones fold into a single "earlier" row, so the
lifetime total does not change; the change log keeps the newest 200 rows and
is taken from the stored record before and after an operation (editor save,
bulk adjust, bulk enable/disable, bot setters, auto-renewal). A rename moves
the history to the new email.

The history belongs to the client. Nothing is archived on delete;
ReapSyncOrphansJob drops the history of emails no client holds, every five
minutes. It lists them outside the traffic writer by walking the email index
(about 10 ms on SQLite for 10k clients with 3M history rows) and enters the
writer only to delete.

Known limit: a client re-created under a deleted client's email before that
job runs keeps the old client's history. Edits through an API token are
logged with the source "panel".
2026-11-25 12:06:45 +03:30
..