mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[GH-ISSUE #7010] [Feature]: Consolidate Telegram bot admin workflows (Persian, quick plans/renewal, shareable exports, online users) #4618
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#4618
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 @HamedSanaei on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/7010
Summary
This is a single, coordinated Telegram-bot admin-workflow improvement covering requests #1, #2, #3, #5 and #7. The goal is to implement the overlapping bot screen/router/client changes on one feature branch (ideally one PR with logical commits), rather than creating conflicting PRs for closely related changes.
Out of scope: removing the Inbounds menu (#4), top-5 users by traffic over the last 5/15 minutes (#6), building a payment/shop bot, or adding a required external service.
Existing issues/PRs: avoid duplication
1. Fix remaining Persian translations and hardcoded bot text
Current:
internal/web/translation/fa-IR.jsoncontains untranslated bot labels such asBack,Find inbound…,Individual links, andInline mode is disabled. Some existing Persian labels are unnatural. Go code also embeds user-visible English in the new-client draft (e.g.New client draft,Unlimited(Reset)).Expected:
I18nBotkeys as appropriate. Add localized strings for the new flows in this issue.Relevant:
internal/web/translation/fa-IR.json,internal/web/service/tgbot/tgbot_client.go,screen_view.go,screen_inline.go,screen_legacy.go.2 + 7. One-tap subscription/QR sharing and concise TXT/config exports
Current:
screenClientLinkspresents the subscription URLs;screenClientQRpresents QR codes separately. The generatorclientSubLinkscan already return individual config links. There is no unified admin export/share workflow.Expected: Add a Share / Export action on the authorized admin's client card, with four clearly labelled modes:
client-configs.txt, containing all generatedvless://,trojan://, etc. links, one per line, without truncation.Reuse existing link generation and preserve the current QR sheet/individual-links screens. No dependency on having the client visit Telegram through an invite link. Handle missing URLs and generator errors explicitly. Respect Telegram's ~1024-character photo-caption and ~4096-character text limits. Do not disclose secrets via public/group inline results. Enforce admin authorization at action execution time and preserve client self-service access only to a client's own subscription.
Relevant:
screen_client_views.go,screen_client_qr.go,screen_legacy.go,tgbot_router.go,tgbot_send.go; coordinate with PR #6986.3. Predefined plan presets and quick client creation/renewal
Goal: Admins can define reusable presets, e.g. plan
A= 30 GB / 30 days / selected inbound(s), planB= 60 GB / 90 days. Include normal reusable client settings such as traffic cap, expiry duration/mode, attached inbound IDs, IP limit, reset policy and initial enable state. Generate per-client identities/protocol secrets freshly, never by copying another user's UUID/password.Quick creation example:
Populate the existing multi-inbound add-client draft using preset A and show an admin-only confirmation preview before calling the existing
ClientService.Create. Also offer a private-chat button/inline-keyboard path. Validate all inbound IDs and protocol compatibility at commit time.Quick renewal example:
Allow a named preset alternative. Show old → new usage, quota, expiry and reset behavior before confirmation. Explicitly distinguish add quota vs set total quota, and extend expiry vs reset expiry from now. Define handling for expired/disabled clients, negative (first-use) expiry and unlimited plans; avoid implicit reset of consumed data. Preserve UUID,
subId, TG binding, and multi-inbound assignments unless the admin explicitly requests otherwise. Observe existing global-aware traffic rules on multi-node setups.An inline query
@bot ...is a search/selection flow, not a safe transaction trigger. Do not mutate quotas or create clients simply when an inline query is typed or selected. Commands/callback confirmations must be admin-authorized and private-chat only. Protect against duplicate button taps, stale drafts, repeated confirmation, parallel admins and partial updates. Reuse existing client services and storage/migration conventions (SQLite + PostgreSQL). No shop/payment functionality.Relevant:
tgbot.go(clientDraft),tgbot_router.go,tgbot_client.go,ClientService.Createand existing client traffic/expiry update services.5. Correct online clients in multi-inbound setups
Current:
screenOnlinestakes an email-only set fromGetOnlineClients()and appends theRemarkof one associated inbound viaGetClientInboundByEmail(email). A client can be attached to multiple inbounds. This remark does not prove which inbound currently carries a live connection and can mislead administrators.Expected:
client_traffics.inbound_id, the first attached inbound or the first DB result.Relevant:
screen_views.go:screenOnlines,internal/xray/process.go:GetOnlineClients,internal/web/service/inbound_clients.go:GetClientInboundByEmail.Acceptance criteria
Implementation / PR coordination
Please develop this on one feature branch with logically separated commits and shared screen/actions helpers, then submit one coordinated PR if acceptable to maintainers. Integrate or rebase onto #6986 once available instead of duplicating its button restoration. Link #4778 as related, but do not auto-close it unless the actual active-inbound attribution gap is fully solved. All five parts are scoped here for development coordination; the commits should remain separable if review requires smaller PRs.