[GH-ISSUE #6245] [Feature]: Removing a single HWID #4239

Closed
opened 2026-10-31 20:38:12 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @baryman on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6245

Most services will want to set a limit on the number of devices, but they won’t have the option to remove a “linked” device in order to add a new one.

Describe the solution you'd like

Add the ability to delete devices one by one. For example, in this modal window (UI) and via the API.

Image

Alternatives you've considered

No response

Concrete use case

Real situation: a person has linked the maximum number of devices to the subscription. Wanted to share the subscription with a loved one, but can’t unlink the unnecessary device.

Mockups, screenshots, or examples

No response

Which parts of the panel would this affect?

Backend (API endpoints, login, settings), Frontend (UI / panel pages)

Are you willing to help?

  • I'd like to implement this feature myself and open a PR.
  • I can help test once a PR is open.

Before submitting

  • I searched existing issues and this feature has not been requested.
  • This feature request is written in English.
Originally created by @baryman on GitHub (Aug 17, 2026). Original GitHub issue: https://github.com/MHSanaei/3x-ui/issues/6245 ### Is your feature request related to a problem? Most services will want to set a limit on the number of devices, but they won’t have the option to remove a “linked” device in order to add a new one. ### Describe the solution you'd like Add the ability to delete devices one by one. For example, in this modal window (UI) and via the API. <img width="543" height="258" alt="Image" src="https://github.com/user-attachments/assets/8b054caa-d510-46ce-bd14-d843c1eebcf4" /> ### Alternatives you've considered _No response_ ### Concrete use case Real situation: a person has linked the maximum number of devices to the subscription. Wanted to share the subscription with a loved one, but can’t unlink the unnecessary device. ### Mockups, screenshots, or examples _No response_ ### Which parts of the panel would this affect? Backend (API endpoints, login, settings), Frontend (UI / panel pages) ### Are you willing to help? - [ ] I'd like to implement this feature myself and open a PR. - [x] I can help test once a PR is open. ### Before submitting - [x] I searched [existing issues](../issues?q=is%3Aissue) and this feature has not been requested. - [x] This feature request is written in English.
bsakaguchi 2026-10-31 20:38:12 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 17, 2026):

Confirmed as a gap: the panel currently has no way to remove a single registered HWID device — only "list" and "clear all" exist. I could not view the attached image, so I am assuming you mean the HWID Devices modal opened from the client edit form; if it is a different screen, please describe it in text.

What the source shows today (v3.6.0 line):

  • Routes: internal/web/controller/client.go:79-80 registers exactly two operations — POST /panel/api/clients/hwids/:email (list) and DELETE /panel/api/clients/hwids/:email (clear all). There is no per-device endpoint.
  • Service: ClearClientHwids in internal/web/service/client_hwid.go:191-201 deletes every client_hwid row for the client's subId, all or nothing.
  • UI: the modal in frontend/src/pages/clients/ClientFormModal.tsx:1081-1128 renders each device read-only and offers only Refresh / Clear all / Close.

Worth noting for whoever implements it: HWID rows are keyed by sub_id, not by client id, and the effective limit is MAX(limit_hwid) across all enabled clients sharing that subId (internal/web/service/client_hwid.go:70-77). The list endpoint already returns a stable per-device id (ClientHwidInfo.Id, internal/web/service/client_hwid.go:36-44), so a single-device delete has an obvious shape already available to the frontend.

Two workarounds until then:

  1. Clear all devices, then re-register only the ones you want to keep:

    curl -X DELETE "https://<panel>/<basepath>/panel/api/clients/hwids/<email>" \
      -H "Cookie: <session cookie>"
    

    or the "Clear all" button in the same modal. Registration happens when a client fetches the subscription with an X-HWID header (internal/sub/controller.go:612-614), so each device you want to keep re-registers on its next subscription update; the device you dropped only returns if it fetches again.

  2. Temporarily lower the client's HWID Limit and raise it back. On client update the panel trims the device list to the N most-recently-seen entries and deletes the rest (setClientLimitHwidByEmail → trimClientHwidsForSubID, internal/web/service/client_hwid.go:203-246, called from internal/web/service/client_crud.go:513). Caveat: it selects by last_seen, so you do not choose which device survives, and if several enabled clients share the same subId you must lower all of them for the effective limit to drop.

Related but not the same request: #6234 asks for the HWID field in the bulk-adjust dialog. Whether to add per-device removal, and in what form, is a maintainer decision.

This reply was generated automatically; a maintainer may follow up.

<!-- gh-comment-id:5319702350 --> @github-actions[bot] commented on GitHub (Aug 17, 2026): Confirmed as a gap: the panel currently has no way to remove a single registered HWID device — only "list" and "clear all" exist. I could not view the attached image, so I am assuming you mean the **HWID Devices** modal opened from the client edit form; if it is a different screen, please describe it in text. What the source shows today (v3.6.0 line): - Routes: `internal/web/controller/client.go:79-80` registers exactly two operations — `POST /panel/api/clients/hwids/:email` (list) and `DELETE /panel/api/clients/hwids/:email` (clear all). There is no per-device endpoint. - Service: `ClearClientHwids` in `internal/web/service/client_hwid.go:191-201` deletes every `client_hwid` row for the client's `subId`, all or nothing. - UI: the modal in `frontend/src/pages/clients/ClientFormModal.tsx:1081-1128` renders each device read-only and offers only Refresh / Clear all / Close. Worth noting for whoever implements it: HWID rows are keyed by `sub_id`, not by client id, and the effective limit is `MAX(limit_hwid)` across all enabled clients sharing that `subId` (`internal/web/service/client_hwid.go:70-77`). The list endpoint already returns a stable per-device `id` (`ClientHwidInfo.Id`, `internal/web/service/client_hwid.go:36-44`), so a single-device delete has an obvious shape already available to the frontend. Two workarounds until then: 1. Clear all devices, then re-register only the ones you want to keep: ```bash curl -X DELETE "https://<panel>/<basepath>/panel/api/clients/hwids/<email>" \ -H "Cookie: <session cookie>" ``` or the "Clear all" button in the same modal. Registration happens when a client fetches the subscription with an `X-HWID` header (`internal/sub/controller.go:612-614`), so each device you want to keep re-registers on its next subscription update; the device you dropped only returns if it fetches again. 2. Temporarily lower the client's HWID Limit and raise it back. On client update the panel trims the device list to the N most-recently-seen entries and deletes the rest (`setClientLimitHwidByEmail` → `trimClientHwidsForSubID`, `internal/web/service/client_hwid.go:203-246`, called from `internal/web/service/client_crud.go:513`). Caveat: it selects by `last_seen`, so you do not choose which device survives, and if several enabled clients share the same `subId` you must lower all of them for the effective limit to drop. Related but not the same request: #6234 asks for the HWID field in the bulk-adjust dialog. Whether to add per-device removal, and in what form, is a maintainer decision. *This reply was generated automatically; a maintainer may follow up.*
Sign in to join this conversation.
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
MHSanaei/3x-ui#4239
No description provided.