mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[GH-ISSUE #6254] [Feature]: Separate statistics for blocked requests #4244
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#4244
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @LORD07Sson on GitHub (Aug 18, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6254
Is your feature request related to a problem?
Yes. Currently, there is no clear, separate statistic showing the total number of blocked requests. This makes it difficult to quickly determine how many requests were blocked and to monitor blocking activity over time.
A dedicated blocked-requests statistic would make the filtering results much easier to understand and monitor
Describe the solution you'd like
I would like the panel to provide a separate statistic for the number of blocked requests.
Add a "blocked requests" counter to the main statistics/dashboard section alongside the existing request statistics
For example:
Total Requests: ***
Blocked Requests: ***
Allowed Requests: ***
The blocked counter should be clearly distinguishable from the total request count and should support the same time ranges as the existing statistics (day, 7 days, 30 days).
Alternatives you've considered
I considered using the existing request statistics and checking the logs to determine how many requests were blocked.
However, this is not very convenient because it requires manually analyzing the data and does not provide a quick overview of blocking activity. A separate "blocked requests" statistic on the dashboard would be much clearer, more accurate, and easier to monitor over time
Concrete use case
No response
Mockups, screenshots, or examples
A simple example of the desired UI would be:
Statistics
Ideally, "blocked requests" should be displayed as a separate statistic/card on the main dashboard and use the same time-range filters as the existing statistics.
No specific configuration changes are required from the user; the value should be calculated automatically from the panel's existing request/filtering data. Let's take an example, adguard home
Which parts of the panel would this affect?
Frontend (UI / panel pages), Statistics / traffic counters
Are you willing to help?
Before submitting
@github-actions[bot] commented on GitHub (Aug 18, 2026):
The panel does not count requests anywhere today, so this would be a new counting mechanism rather than a new card computed from existing data. Everything currently labelled "statistics" is either a byte counter or a live gauge:
internal/xray/api.go:46-47matchinbound|outbound>>>tag>>>traffic>>>uplink|downlinkanduser>>>email>>>traffic>>>uplink|downlink, nothing else. Stored values are bytes (Up/Downininternal/xray/client_traffic.go:12-13).frontend/src/pages/index/ConnectionsCard.tsx:35).What already exists closest to your request:
GetXrayLogsininternal/web/service/server.go:1170tags each access-log line Direct / Blocked / Proxied, marking it Blocked when the line's outbound tag matches ablackholeoutbound (GetDefaultLogOutboundTags,internal/web/service/server.go:289, falling back to the tagblocked). The Direct/Blocked/Proxy checkboxes are infrontend/src/pages/index/XrayLogModal.tsx:181-189. It lists the entries; it never totals them.This requires the access log to be on — the shipped template sets
"access": "none"(internal/web/service/config.json:21). Enable it in Xray Configs → Basics → Access log, where the only two options arenoneand./access.log(frontend/src/pages/xray/basics/constants.ts:3).statsOutboundUplinkandstatsOutboundDownlinkship disabled (internal/web/service/config.json:58-59) and can be turned on in the same Basics tab (frontend/src/pages/xray/basics/BasicsTab.tsx:280). With them on, the traffic job records per-outbound-tag totals (internal/web/service/outbound/outbound.go:41, modelOutboundTraffics) and the Outbounds tab shows traffic for theblockedoutbound. That gives blocked bytes, not a blocked request count.Two constraints anyone implementing this would hit:
PruneXrayLogsJobtruncates the access and error logs once either exceeds 64 MiB (internal/web/job/clear_logs_job.go:12), so totals derived from the file would drop history at each truncation.internal/web/service/metric_history.go:32-36).One note on the AdGuard Home comparison: AdGuard counts DNS queries it filters, whereas 3x-ui proxies connections and takes its numbers from Xray, which exposes byte counters rather than request counters. Whether to add per-request counting is @MHSanaei's decision.
This reply was generated automatically. A maintainer may follow up.
@LORD07Sson commented on GitHub (Aug 18, 2026):
Exactly, I didn't think about that. Thanks