[PR #5625] [CLOSED] feat: add reusable links management #5935

Closed
opened 2026-11-02 04:05:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/5625
Author: @saeedhasani
Created: 6/28/2026
Status: ❌ Closed

Base: main ← Head: main


📝 Commits (3)

  • c463a11 feat: add reusable links management
  • 69f201c style(links): drop inline comments per repo convention
  • 9c71307 Merge remote-tracking branch 'upstream/main' into feat/links-management-clean

📊 Changes

35 files changed (+2602 additions, -35 deletions)

View changed files

📝 frontend/public/openapi.json (+485 -0)
➕ frontend/src/api/queries/useLinkMutations.ts (+73 -0)
➕ frontend/src/api/queries/useLinksQuery.ts (+33 -0)
📝 frontend/src/api/queryKeys.ts (+4 -0)
📝 frontend/src/layouts/AppSidebar.tsx (+4 -1)
📝 frontend/src/pages/api-docs/endpoints.ts (+81 -0)
📝 frontend/src/pages/clients/ClientFormModal.tsx (+119 -3)
➕ frontend/src/pages/links/AttachExistingClientsModal.tsx (+249 -0)
➕ frontend/src/pages/links/LinkFormModal.tsx (+96 -0)
➕ frontend/src/pages/links/LinksPage.tsx (+365 -0)
📝 frontend/src/routes.tsx (+2 -0)
➕ frontend/src/schemas/api/link.ts (+35 -0)
📝 internal/database/db.go (+1 -0)
📝 internal/database/migrate_data.go (+1 -0)
📝 internal/database/model/model.go (+13 -0)
📝 internal/web/controller/api.go (+5 -0)
📝 internal/web/controller/api_docs_test.go (+3 -1)
➕ internal/web/controller/link.go (+186 -0)
📝 internal/web/controller/spa.go (+1 -0)
📝 internal/web/service/client.go (+7 -5)

...and 15 more files

📄 Description

Summary

Adds a dedicated reusable Links management feature, separate from the newer Plugins work. This PR only covers globally managed external share links and remote subscription URLs that can be copied into client external-link lists.

What changed

  • Add a links table and migration wiring for reusable link/subscription records.
  • Add /panel/api/links/* endpoints for listing, creating, updating, deleting, enabling/disabling, reordering, and assigning links to clients.
  • Add a Links page to the sidebar with CRUD controls, bulk enable/disable/delete, ordering, and assignment to existing clients.
  • Add client-form integration so admins can select managed links/subscriptions when editing a client.
  • Batch the assign path by loading existing client external links once and creating new rows with CreateInBatches.
  • Add API docs and regenerate frontend/public/openapi.json; the assign example now uses the API field attached.
  • Add Links i18n keys to all 13 locale files.

Scope

This PR intentionally contains only the Links feature. It does not include the Plugins page, plugin install API, or plugin contract changes from PR #5789.

Testing

  • go test ./internal/web/controller ./internal/web/service ./internal/database
  • npm run build

Note on Claude Bot run

The linked Claude Bot run failed while trying to fetch the PR head into a local branch named main (git fetch origin --depth=20 pull/5625/head:main) while main was already checked out. That is a checkout/ref-name issue caused by this PR being opened from the fork branch named main, not a code/test failure.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/MHSanaei/3x-ui/pull/5625 **Author:** [@saeedhasani](https://github.com/saeedhasani) **Created:** 6/28/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (3) - [`c463a11`](https://github.com/MHSanaei/3x-ui/commit/c463a110f783d7195ef92e312d7dcd236ba3358a) feat: add reusable links management - [`69f201c`](https://github.com/MHSanaei/3x-ui/commit/69f201c946313fec5f90a8a3f1547a64a6e6b866) style(links): drop inline comments per repo convention - [`9c71307`](https://github.com/MHSanaei/3x-ui/commit/9c713070013a191d06b91cf2c56a506145f903a4) Merge remote-tracking branch 'upstream/main' into feat/links-management-clean ### 📊 Changes **35 files changed** (+2602 additions, -35 deletions) <details> <summary>View changed files</summary> 📝 `frontend/public/openapi.json` (+485 -0) ➕ `frontend/src/api/queries/useLinkMutations.ts` (+73 -0) ➕ `frontend/src/api/queries/useLinksQuery.ts` (+33 -0) 📝 `frontend/src/api/queryKeys.ts` (+4 -0) 📝 `frontend/src/layouts/AppSidebar.tsx` (+4 -1) 📝 `frontend/src/pages/api-docs/endpoints.ts` (+81 -0) 📝 `frontend/src/pages/clients/ClientFormModal.tsx` (+119 -3) ➕ `frontend/src/pages/links/AttachExistingClientsModal.tsx` (+249 -0) ➕ `frontend/src/pages/links/LinkFormModal.tsx` (+96 -0) ➕ `frontend/src/pages/links/LinksPage.tsx` (+365 -0) 📝 `frontend/src/routes.tsx` (+2 -0) ➕ `frontend/src/schemas/api/link.ts` (+35 -0) 📝 `internal/database/db.go` (+1 -0) 📝 `internal/database/migrate_data.go` (+1 -0) 📝 `internal/database/model/model.go` (+13 -0) 📝 `internal/web/controller/api.go` (+5 -0) 📝 `internal/web/controller/api_docs_test.go` (+3 -1) ➕ `internal/web/controller/link.go` (+186 -0) 📝 `internal/web/controller/spa.go` (+1 -0) 📝 `internal/web/service/client.go` (+7 -5) _...and 15 more files_ </details> ### 📄 Description ## Summary Adds a dedicated reusable Links management feature, separate from the newer Plugins work. This PR only covers globally managed external share links and remote subscription URLs that can be copied into client external-link lists. ## What changed - Add a `links` table and migration wiring for reusable link/subscription records. - Add `/panel/api/links/*` endpoints for listing, creating, updating, deleting, enabling/disabling, reordering, and assigning links to clients. - Add a Links page to the sidebar with CRUD controls, bulk enable/disable/delete, ordering, and assignment to existing clients. - Add client-form integration so admins can select managed links/subscriptions when editing a client. - Batch the assign path by loading existing client external links once and creating new rows with `CreateInBatches`. - Add API docs and regenerate `frontend/public/openapi.json`; the assign example now uses the API field `attached`. - Add Links i18n keys to all 13 locale files. ## Scope This PR intentionally contains only the Links feature. It does not include the Plugins page, plugin install API, or plugin contract changes from PR #5789. ## Testing - `go test ./internal/web/controller ./internal/web/service ./internal/database` - `npm run build` ## Note on Claude Bot run The linked Claude Bot run failed while trying to fetch the PR head into a local branch named `main` (`git fetch origin --depth=20 pull/5625/head:main`) while `main` was already checked out. That is a checkout/ref-name issue caused by this PR being opened from the fork branch named `main`, not a code/test failure. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:05:08 +07:00
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#5935
No description provided.