mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6265] [MERGED] feat(clients): allow removing a single HWID device #6202
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#6202
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?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6265
Author: @kuzzrus
Created: 8/19/2026
Status: ✅ Merged
Merged: 8/21/2026
Merged by: @MHSanaei
Base:
main← Head:upstream-pr/hwid-single-delete📝 Commits (10+)
7217f60feat(clients): allow removing a single HWID device7ca9b4efeat(clients): surface HWID limit + device log in the client info cardc6bb087i18n: add HWID single-delete strings to all 13 locales78c185efix(clients): address automated review of HWID single-delete PRe489f09chore: retrigger CI (previous run stuck installing Playwright Chromium)b7786ffMerge branch 'main' into upstream-pr/hwid-single-delete7a1ca9efix(clients): address the arbiter review on the HWID single-delete PR6950418Merge branch 'main' into upstream-pr/hwid-single-delete2551c53fix(clients): trim HWID list comment blocks to 2 lines1aaeae4chore: retrigger CI📊 Changes
25 files changed (+663 additions, -119 deletions)
View changed files
📝
docs/content/docs/en/reference/api/clients.mdx(+20 -1)📝
docs/public/openapi.json(+144 -0)📝
frontend/public/openapi.json(+50 -0)➕
frontend/src/components/clients/ClientHwidList.tsx(+129 -0)➕
frontend/src/hooks/useClientHwids.ts(+75 -0)➕
frontend/src/lib/clients/hwid-log.ts(+21 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+10 -0)📝
frontend/src/pages/clients/ClientFormModal.tsx(+28 -118)📝
frontend/src/pages/clients/ClientInfoModal.tsx(+52 -0)📝
internal/web/controller/client.go(+14 -0)📝
internal/web/service/client_hwid.go(+21 -0)📝
internal/web/service/client_hwid_test.go(+47 -0)📝
internal/web/translation/ar-EG.json(+4 -0)📝
internal/web/translation/en-US.json(+4 -0)📝
internal/web/translation/es-ES.json(+4 -0)📝
internal/web/translation/fa-IR.json(+4 -0)📝
internal/web/translation/id-ID.json(+4 -0)📝
internal/web/translation/ja-JP.json(+4 -0)📝
internal/web/translation/pt-BR.json(+4 -0)📝
internal/web/translation/ru-RU.json(+4 -0)...and 5 more files
📄 Description
Summary
Adds the ability to remove a single registered HWID device, instead of only "list" and "clear all", in both the client edit form's HWID modal and the (previously IP-limit-only) client info card.
Why
Closes #6245. Once a client hits its HWID limit, the only way to free up a slot today is to clear every device and wait for the ones you want to keep to re-register on their next subscription fetch — there's no way to drop just the one device you no longer need. This is the exact scenario described in the issue: sharing a subscription with someone new when you're already at the device cap.
Type of change
Areas affected
How was this tested?
internal/web/service/internal/web/controllertransitively importinternal/database(CGO/sqlite3), which I wasn't able to compile in my local environment — verified withgofmtandgo build ./...(fails only at the pre-existing CGO boundary, no new errors) instead.go build ./.../backend tests should be confirmed by CI.Frontend verified for real:
tsc --noEmit,oxlint,oxfmt --check, and the fullvitestsuite are all clean (the only 2 failures in the suite are pre-existing and environment-specific to this Windows dev machine — a POSIX-onlyexecFileSyncpath ininput-number-guard.test.tsand a default-locale-dependenttoLocaleString()assertion in a Storybook story — neither touches anything in this diff).Manually tested end-to-end against a real running instance (screenshots below): opened a client with two registered HWID devices, deleted one from the client info card's new "HWID Devices" modal, confirmed it disappeared from the list and the counter updated, and confirmed the remaining device and its metadata (model, OS, first/last seen, user agent) were untouched.
Screenshots / recordings
Breaking changes
None.
Checklist
TestDeleteClientHwid(internal/web/service/client_hwid_test.go), covering the happy path, rejecting a delete against another client'ssub_id, and rejecting an unknown device id.go build ./...and the test suite pass locally. (same CGO blocker; should be green in CI)npm run lint,npm run typecheck, andnpm run buildpass.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.