3x-ui/frontend
MHSanaei d6fe3d3823
build(frontend): bump eslint to 10 + add flat config + clean lint warnings
- Upgrade eslint 9.39 -> 10.3 and eslint-plugin-vue 9.33 -> 10.9
- Add eslint.config.js (flat config required by ESLint 10) with
  vue3-recommended rules, sensible defaults, and exemptions for the
  project's existing formatting style
- Drop --ext from the lint script (removed in ESLint 10)
- vue/no-mutating-props is left off because the form-modal pattern
  ports straight from Vue 2 (parent passes a reactive object, child
  mutates it); a real fix is an architectural rewire, separate task

Lint warning cleanup:
- utils/index.js: var -> let/const in the X25519 routines, replace
  obj.hasOwnProperty(...) with Object.prototype.hasOwnProperty.call(...)
- Remove unused imports (reactive, ref, Inbound) in ClientFormModal,
  InboundInfoModal, QrCodeModal, DnsServerModal, OutboundFormModal,
  SubPage; remove unused locals (isClientOnline, ONLINE_GRACE_MS,
  fetchAll, isSocks, isHTTP, _antdAlgorithm)
- XrayStatusCard: declare 'open-logs' on defineEmits (was emitted but
  not declared)
- RuleFormModal: rename v-for var t -> tag (shadowed useI18n's t)
- Drop stale eslint-disable directives (no-new, no-unused-vars)
- OutboundsTab/InboundList: drop redundant initial null assigns
- InboundInfoModal/OutboundFormModal: explicit eslint-disable for the
  intentional local-ref-shadows-prop pattern in modal drafts

`npm run lint` now passes with 0 errors and 0 warnings.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-09 02:36:47 +02:00
..
src build(frontend): bump eslint to 10 + add flat config + clean lint warnings 2026-05-09 02:36:47 +02:00
.gitignore build(frontend): Phase 2 — scaffold Vite + Vue 3 + AD-Vue 4 2026-05-08 10:36:03 +02:00
eslint.config.js build(frontend): bump eslint to 10 + add flat config + clean lint warnings 2026-05-09 02:36:47 +02:00
inbounds.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
index.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
login.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
package-lock.json build(frontend): bump eslint to 10 + add flat config + clean lint warnings 2026-05-09 02:36:47 +02:00
package.json build(frontend): bump eslint to 10 + add flat config + clean lint warnings 2026-05-09 02:36:47 +02:00
README.md build(frontend): Phase 2 — scaffold Vite + Vue 3 + AD-Vue 4 2026-05-08 10:36:03 +02:00
settings.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
subpage.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
vite.config.js revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00
xray.html revert(frontend): keep entry HTML files at frontend/ root 2026-05-09 02:36:26 +02:00

3x-ui frontend

Vue 3 + Ant Design Vue 4 + Vite. Builds into ../web/dist/, which the Go binary will embed via embed.FS once the migration reaches the page handlers (Phase 4+).

This directory exists alongside the legacy web/html/ Vue 2 templates during the migration. Pages will move over one at a time on the vue3-migration branch.

Dev

cd frontend
npm install
npm run dev

The dev server runs on http://localhost:5173/ and proxies API calls to the Go panel at http://localhost:2053/ — start the Go panel first (go run main.go), then start Vite.

Production build

npm run build

Outputs to ../web/dist/. The Go binary picks it up at compile time via embed.FS.

Where things live

  • src/main.js — app entrypoint (createApp, install Antd, mount)
  • src/App.vue — root component (currently a smoke-test placeholder)
  • vite.config.js — build + dev-server config
  • index.html — Vite HTML template

Adding new pages

For each legacy page being migrated, add an entry to vite.config.js rollupOptions.input. Each entry produces its own HTML file in web/dist/, which the Go panel route handler will serve.