mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 21:18:19 +07:00
[PR #6598] [CLOSED] feat(links): add the panel-side UI for the external links library #6369
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#6369
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/6598
Author: @BlindMaster24
Created: 9/18/2026
Status: ❌ Closed
Base:
main← Head:feat/external-links-ui📝 Commits (6)
5afa867feat(links): make external links a panel-wide library with scopeseac7ef0feat(links): add the panel-side UI for the external links libraryc920e1atest(links): cover the library page, its form and the assignment targets1d1c90ctest(links): pin the id gating of the targets and client-links queries4e9c37btest(nodes): stop the history chart assertion racing its own effect07644ebfix(links): translate the refreshed toast and cover the refresh action📊 Changes
71 files changed (+8827 additions, -330 deletions)
View changed files
📝
docs/content/docs/en/reference/api/clients.mdx(+29 -21)➕
docs/content/docs/en/reference/api/external-links.mdx(+122 -0)📝
docs/public/openapi.json(+1069 -2)📝
frontend/public/openapi.json(+1069 -2)➕
frontend/src/api/queries/useGroupOptions.ts(+22 -0)➕
frontend/src/api/queries/useLinkMutations.ts(+85 -0)➕
frontend/src/api/queries/useLinksQuery.ts(+80 -0)📝
frontend/src/api/queryKeys.ts(+6 -0)📝
frontend/src/generated/examples.ts(+69 -0)📝
frontend/src/generated/schemas.ts(+338 -0)📝
frontend/src/generated/types.ts(+74 -0)📝
frontend/src/generated/zod.ts(+79 -0)📝
frontend/src/layouts/AppSidebar.tsx(+5 -1)📝
frontend/src/lib/clients/external-link.ts(+13 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+275 -3)📝
frontend/src/pages/clients/ClientFormModal.tsx(+42 -1)➕
frontend/src/pages/links/LinkFormModal.tsx(+148 -0)➕
frontend/src/pages/links/LinkTargetsModal.tsx(+194 -0)➕
frontend/src/pages/links/LinksPage.tsx(+362 -0)📝
frontend/src/routes.tsx(+2 -0)...and 51 more files
📄 Description
What
Supply B of the external-links work: the panel side of the library that
#6571 added as an API. Until now the library could only be written with
curl,and a client's inherited links were invisible in the panel.
/links, sidebar entry + route): the library in display orderwith kind, value, remark, how many clients inherit each row, last fetch state,
and per-row enable, move up/down, refresh (subscriptions), edit, delete, and
the targets dialog (assign / unassign to client, group, inbound, every client,
new clients).
granted each row, so an operator can see where a link comes from instead of
only seeing what the client owns.
src/schemas/api/link.ts(Zod, contract-shaped), link querykeys,
useLinksQuery/useLinkMutations/useGroupOptions.dead-keys test pins both directions).
Stacked on #6571
This branch is based on
feat/external-links-library(head of #6571), so thediff below also contains that PR's commit —
5afa8677is A,eac7ef04is B.Merge #6571 first and I will rebase this onto
main; the diff then shrinks tothe UI commit alone. Nothing here is merged.
Two defects found while reviewing this change
Both were introduced by this change and are fixed in it:
The form offered to clear User-Agent / cache TTL, and clearing silently did
nothing.
ExternalLinkLibrarySavewrites those two columns only when theycarry a value (
internal/web/service/external_link_library.go:132), so anempty field was a change the endpoint dropped — the operator cleared it,
reopened the row, and found the old value. The payload now omits a blank
field instead of sending one, and both fields carry a hint saying a blank
value keeps the stored one. Pinned by a red-first test
(
toLinkSaveRequest): with the twodeletes reverted the test fails, withthem restored it passes.
Residual limitation, deliberately not papered over: the panel can set or
replace those two fields but cannot remove them, because the endpoint has no
way to express "clear" — that needs the column to become nullable, which is a
separate change to the API contract, not part of a UI PR.
The "Last fetch" column ignored the panel's datepicker setting. It used
new Date(value).toLocaleString(), unlike the rest of the panel, which goesthrough
IntlUtil.formatDate(value, datepicker); on a Jalali panel, and inany language, it rendered a different format from every other table. Now it
uses the house helper.
Verification
npx tsc --noEmitclean,npm run lint(oxlint) 0/0,oxfmt --checkclean,npm run buildsucceeds.npx vitest run --project unit— 79/80 files pass, 11 tests green in thefiles this change touches (
links-request-payloads,i18n-dead-keys,client-external-link-expiry).node scripts/build-openapi.mjs— no drift; this change adds no routes and noGo structs, so
frontend/public/openapi.jsonanddocs/public/openapi.jsonare untouched.
Three failure classes are local-environment only, not this change — none of them
can see the code here, and CI is the arbiter:
src/test/input-number-guard.test.ts(pre-existing): the installed oxlint is1.82.0 while
frontend/package.jsonpins 1.83.0, so the AST-walkingguard reports nothing to the test's
execFileSync. The fixtures and the ruleare untouched by this branch; run directly, the guard still reports all three
hits.
FormField.stories.tsx > Traffic Transform: the story asserts107,374,182,400 bytes, but the storybook browser takes the host locale(
ru-RU) and renders NBSP separators.TextModal/NotificationLayoutstories:Failed to fetch dynamically imported modulefrom the Vitest browser server (one of themaxe-core) —infrastructure flake in the local runner.
Go and DB-backed tests cannot run on this machine (no C compiler, so
internal/databasedoes not build); CI runs them.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.