[PR #6412] [MERGED] feat(sub): add dummy info node and status configs for subscriptions #6258

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

📋 Pull Request Information

Original PR: https://github.com/MHSanaei/3x-ui/pull/6412
Author: @rqzbeh
Created: 9/4/2026
Status: ✅ Merged
Merged: 9/8/2026
Merged by: @MHSanaei

Base: main ← Head: feat/subscription-info-node


📝 Commits (6)

  • a7304d6 feat(settings): add subInfoNodeEnable and status template settings
  • fe0f9ea feat(sub): add dummy info node and status configs for raw links
  • 7041753 feat(sub): support dummy info node in clash and json subscriptions
  • e4a1b5f feat(ui): add subscription info node switch and status templates to settings
  • 6b2efe1 style: apply gofumpt formatting
  • 0cc1440 fix(sub): address review feedback on subscription info node

📊 Changes

33 files changed (+1375 additions, -36 deletions)

View changed files

📝 docs/public/openapi.json (+24 -0)
📝 frontend/public/openapi.json (+24 -0)
📝 frontend/src/generated/examples.ts (+6 -0)
📝 frontend/src/generated/schemas.ts (+24 -0)
📝 frontend/src/generated/types.ts (+6 -0)
📝 frontend/src/generated/zod.ts (+6 -0)
📝 frontend/src/models/setting.ts (+4 -0)
📝 frontend/src/pages/settings/SubscriptionGeneralTab.tsx (+35 -0)
📝 frontend/src/schemas/setting.ts (+3 -0)
➕ frontend/src/test/setting-sub-info-node.test.ts (+27 -0)
➕ internal/sub/clash_info_node_test.go (+248 -0)
📝 internal/sub/clash_service.go (+41 -0)
➕ internal/sub/json_info_node_test.go (+247 -0)
📝 internal/sub/json_service.go (+45 -0)
📝 internal/sub/remark_vars.go (+1 -1)
📝 internal/sub/service.go (+102 -10)
➕ internal/sub/service_info_node_test.go (+365 -0)
📝 internal/web/entity/entity.go (+9 -6)
📝 internal/web/service/setting.go (+22 -5)
➕ internal/web/service/setting_sub_info_node_test.go (+44 -0)

...and 13 more files

📄 Description

Summary

Adds an opt-in setting (subInfoNodeEnable) to serve subscription remarks, remaining traffic, and days left as a dedicated dummy SOCKS info node (127.0.0.1:1080) at the top of subscriptions, and return a status-only info node when a subscriber account is expired or traffic-depleted.

Why

Many users and client apps prefer having a dedicated, visually clean status node at the top of their subscription list rather than embedding dynamic usage counters inside the name of connection links. Furthermore, when an account expires or its data quota is exhausted, returning a clear status node informs the subscriber directly inside their client app why their connection is inactive.

Type of change

  • New feature

Areas affected

  • Frontend (UI / panel pages)
  • Backend (API endpoints, login, settings)
  • Subscription (share links / Clash / JSON)

How was this tested?

  • Tested raw base64 subscription links, Clash YAML, and Xray JSON endpoints for:
    • Active subscriber (dummy node at top + clean server links).
    • Expired subscriber (exclusive expired dummy node).
    • Traffic-depleted subscriber (exclusive depleted dummy node).
    • Feature disabled (confirmed 100% backward compatibility with existing remark behavior).
  • Ran all Go package tests (go test ./internal/...) and frontend Vitest tests (npm test).
  • Verified build and typecheck with npm run build and npm run typecheck.

Screenshots / recordings

  • Toggle switch and custom template fields are located under Panel Settings > Subscription > Information.

Breaking changes

None. This feature is opt-in (subInfoNodeEnable: false by default).

Checklist

  • I tested the change locally and confirmed the described behavior.
  • I added or updated tests for the new behavior (when applicable).
  • go build ./... and the test suite pass locally.
  • For frontend changes: npm run lint, npm run typecheck, and npm run build pass.
  • My commits follow the project's existing message style.
  • I have no unrelated changes mixed into this PR.

🤖 Generated with Claude Code


🔄 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/6412 **Author:** [@rqzbeh](https://github.com/rqzbeh) **Created:** 9/4/2026 **Status:** ✅ Merged **Merged:** 9/8/2026 **Merged by:** [@MHSanaei](https://github.com/MHSanaei) **Base:** `main` ← **Head:** `feat/subscription-info-node` --- ### 📝 Commits (6) - [`a7304d6`](https://github.com/MHSanaei/3x-ui/commit/a7304d6b0f3d55533d184a5072f2659dcda324c1) feat(settings): add subInfoNodeEnable and status template settings - [`fe0f9ea`](https://github.com/MHSanaei/3x-ui/commit/fe0f9ea65cb409582cedcaa1d29927818dbde4ad) feat(sub): add dummy info node and status configs for raw links - [`7041753`](https://github.com/MHSanaei/3x-ui/commit/7041753539349d187961ada271a9530a4923cfea) feat(sub): support dummy info node in clash and json subscriptions - [`e4a1b5f`](https://github.com/MHSanaei/3x-ui/commit/e4a1b5f2772a16e69eed13673b57c2693537754d) feat(ui): add subscription info node switch and status templates to settings - [`6b2efe1`](https://github.com/MHSanaei/3x-ui/commit/6b2efe19dd7af5737ed192761048d730c6b89e85) style: apply gofumpt formatting - [`0cc1440`](https://github.com/MHSanaei/3x-ui/commit/0cc14404c68a3682a803bb5fdeaf7469fb4f0b4b) fix(sub): address review feedback on subscription info node ### 📊 Changes **33 files changed** (+1375 additions, -36 deletions) <details> <summary>View changed files</summary> 📝 `docs/public/openapi.json` (+24 -0) 📝 `frontend/public/openapi.json` (+24 -0) 📝 `frontend/src/generated/examples.ts` (+6 -0) 📝 `frontend/src/generated/schemas.ts` (+24 -0) 📝 `frontend/src/generated/types.ts` (+6 -0) 📝 `frontend/src/generated/zod.ts` (+6 -0) 📝 `frontend/src/models/setting.ts` (+4 -0) 📝 `frontend/src/pages/settings/SubscriptionGeneralTab.tsx` (+35 -0) 📝 `frontend/src/schemas/setting.ts` (+3 -0) ➕ `frontend/src/test/setting-sub-info-node.test.ts` (+27 -0) ➕ `internal/sub/clash_info_node_test.go` (+248 -0) 📝 `internal/sub/clash_service.go` (+41 -0) ➕ `internal/sub/json_info_node_test.go` (+247 -0) 📝 `internal/sub/json_service.go` (+45 -0) 📝 `internal/sub/remark_vars.go` (+1 -1) 📝 `internal/sub/service.go` (+102 -10) ➕ `internal/sub/service_info_node_test.go` (+365 -0) 📝 `internal/web/entity/entity.go` (+9 -6) 📝 `internal/web/service/setting.go` (+22 -5) ➕ `internal/web/service/setting_sub_info_node_test.go` (+44 -0) _...and 13 more files_ </details> ### 📄 Description ## Summary Adds an opt-in setting (`subInfoNodeEnable`) to serve subscription remarks, remaining traffic, and days left as a dedicated dummy SOCKS info node (`127.0.0.1:1080`) at the top of subscriptions, and return a status-only info node when a subscriber account is expired or traffic-depleted. ## Why Many users and client apps prefer having a dedicated, visually clean status node at the top of their subscription list rather than embedding dynamic usage counters inside the name of connection links. Furthermore, when an account expires or its data quota is exhausted, returning a clear status node informs the subscriber directly inside their client app why their connection is inactive. ## Type of change - [x] New feature ## Areas affected - [x] Frontend (UI / panel pages) - [x] Backend (API endpoints, login, settings) - [x] Subscription (share links / Clash / JSON) ## How was this tested? - Tested raw base64 subscription links, Clash YAML, and Xray JSON endpoints for: - Active subscriber (dummy node at top + clean server links). - Expired subscriber (exclusive expired dummy node). - Traffic-depleted subscriber (exclusive depleted dummy node). - Feature disabled (confirmed 100% backward compatibility with existing remark behavior). - Ran all Go package tests (`go test ./internal/...`) and frontend Vitest tests (`npm test`). - Verified build and typecheck with `npm run build` and `npm run typecheck`. ## Screenshots / recordings - Toggle switch and custom template fields are located under **Panel Settings > Subscription > Information**. ## Breaking changes None. This feature is opt-in (`subInfoNodeEnable: false` by default). ## Checklist - [x] I tested the change locally and confirmed the described behavior. - [x] I added or updated tests for the new behavior (when applicable). - [x] `go build ./...` and the test suite pass locally. - [x] For frontend changes: `npm run lint`, `npm run typecheck`, and `npm run build` pass. - [x] My commits follow the project's existing message style. - [x] I have no unrelated changes mixed into this PR. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-02 04:07:27 +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#6258
No description provided.