3x-ui/frontend/src
mrchatam 435ed976c0
fix(web): restart panel after ImportDB so subPath routes match (#6446) (#6456)
* fix(web): restart panel after ImportDB so subPath routes match (#6446)

ImportDB only restarted Xray, leaving the subscription HTTP server on
startup-registered paths. Schedule the same in-process restart hook used
by restartPanel so restored subPath (and related) routes take effect
without relying on a browser follow-up that can fail after session invalidation.

* fix(web): schedule the post-import panel restart once, via PanelService

ImportDB grew a private copy of PanelService.RestartPanel (same hook check,
same Windows bail-out, same SIGHUP fallback, already diverging in log
severity) while BackupModal kept POSTing restartPanel after a successful
import, so one restore bounced the panel and the public sub server twice
back to back. The service package cannot reuse PanelService (panel imports
service), so the importDB controller now calls the existing
RestartPanel(3s) after ImportDB succeeds, the duplicated helper is dropped,
and the browser follow-up is removed; it waits out the restart and reloads.

Test drives the importDB handler against a stub xray binary and fails when
no restart is scheduled through the global restart hook.

---------

Co-authored-by: mrchatam <mrchatam@users.noreply.github.com>
Co-authored-by: Sanaei <ho3ein.sanaei@gmail.com>
2026-09-13 21:39:15 +02:00
..
api feat(sub): leastLoad member weights for subscription balancers (#6304) 2026-09-02 20:21:27 +02:00
components feat(discord): add Discord notification bot service (#6486) 2026-09-13 14:04:53 +02:00
entries fix(frontend): isolate subscription language preference (#6394) 2026-09-03 16:33:37 +02:00
generated feat(settings): add setting for Reality scan candidates (#6471) 2026-09-13 14:48:28 +02:00
hooks fix(clients): preserve traffic reset schedule when toggling enable (#6502) 2026-09-13 21:27:15 +02:00
i18n fix(frontend): isolate subscription language preference (#6394) 2026-09-03 16:33:37 +02:00
layouts feat(discord): add Discord notification bot service (#6486) 2026-09-13 14:04:53 +02:00
lib fix(link): rebuild shadowsocks tcp/http obfuscation on import (#6505) 2026-09-13 19:58:27 +02:00
models feat(settings): add setting for Reality scan candidates (#6471) 2026-09-13 14:48:28 +02:00
pages fix(web): restart panel after ImportDB so subPath routes match (#6446) (#6456) 2026-09-13 21:39:15 +02:00
schemas feat(geodata): add standard source presets (#6504) 2026-09-13 20:02:43 +02:00
styles Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00
test fix(clients): preserve traffic reset schedule when toggling enable (#6502) 2026-09-13 21:27:15 +02:00
utils fix(frontend): isolate subscription language preference (#6394) 2026-09-03 16:33:37 +02:00
env.d.ts refactor(frontend): replace axios with the native Fetch API 2026-07-08 01:09:18 +02:00
main.tsx chore(deps): migrate to react-router 8 and refresh frontend dependencies 2026-07-25 02:07:15 +02:00
queryClient.ts feat(frontend): TanStack Query + React Router migration & in-panel API docs (#4541) 2026-05-24 21:34:52 +02:00
routes.tsx Move to TypeScript 7 and the oxc toolchain (oxlint + oxfmt) (#6262) 2026-08-19 15:36:27 +02:00