3x-ui/internal/web/controller
MHSanaei bc309ed9f8
refactor(frontend): replace axios with the native Fetch API
Drop the axios (and qs) dependencies in favor of a native fetch wrapper.
axios only ever handled same-origin JSON/form calls, a CSRF header, a 401
redirect, and a 403-retry, all of which the platform now provides directly.

- New src/api/http-init.ts (replaces axios-init.ts) reimplements the
  request/response interceptors on fetch: base-path prefixing,
  X-Requested-With, same-origin credentials, the CSRF token on unsafe
  methods, a single 403 retry with token refresh, and the 401
  redirect-and-latch. A small encodeForm() reproduces qs's
  arrayFormat:'repeat' encoding, so the request wire format is unchanged.
- HttpUtil (src/utils/index.ts) keeps its public signatures and the Msg
  envelope, so the ~49 API call sites are untouched. HttpOptions is now
  hand-rolled instead of extending AxiosRequestConfig.
- PanelUpdateModal drops its lone direct axios.get in favor of HttpUtil.get
  with { silent, timeout }.
- Add tests for the fetch core (CSRF header, form/JSON/FormData bodies,
  base-path prefix, 403 retry, 401 redirect, tolerant body parse) and for
  HttpUtil's envelope unwrap / toast / error mapping; this logic was
  previously untested.
- Remove the vendor-axios manualChunks branch and the qs type shim, and
  reword stale "axios" mentions in docs and route comments.
2026-07-08 01:09:18 +02:00
..
api.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
api_auth_test.go feat(node): node hardening — mTLS, hashed+zstd reconcile transport, per-node net metrics (#5382) 2026-06-16 12:19:33 +02:00
api_docs_test.go fix(api-docs): exclude /panel/outbound and /panel/routing from route guard 2026-06-22 23:48:58 +02:00
base.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
client.go feat(clients): add bulk enable/disable and move selection actions into More menu 2026-06-25 19:21:42 +02:00
dist.go feat(panel): surface dev-build version in UI, bot, and CLI 2026-06-25 02:36:41 +02:00
dist_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
group.go feat(groups): reset group traffic without touching client counters 2026-06-27 16:33:36 +02:00
host.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
host_test.go feat(hosts): managed Hosts for per-host subscription link overrides (#5409) 2026-06-17 12:06:55 +02:00
inbound.go style: adopt golangci-lint v2 and resolve all findings 2026-06-27 15:42:22 +02:00
index.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
login_limiter.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
login_limiter_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
node.go feat(nodes): add Dev channel option to node panel updates 2026-06-25 00:29:03 +02:00
panel_update_test.go fix: make all self-managed file downloads/installs atomic, with real completion status (#5711) 2026-07-02 18:19:33 +02:00
server.go fix: make all self-managed file downloads/installs atomic, with real completion status (#5711) 2026-07-02 18:19:33 +02:00
setting.go feat(settings): let users clear stored secrets from the UI 2026-07-02 13:57:34 +02:00
spa.go refactor(frontend): replace axios with the native Fetch API 2026-07-08 01:09:18 +02:00
spa_test.go fix(web): serve panel SPA routes from NoRoute (#5536) 2026-06-24 21:19:12 +02:00
util.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
util_test.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
websocket.go refactor: focused service files, leaf subpackages, and an internal/ layout (#5167) 2026-06-10 15:19:22 +02:00
xray_setting.go refactor(frontend): replace axios with the native Fetch API 2026-07-08 01:09:18 +02:00