From a31a42fcc50b910222e5339ae3d5aa6fc12720a8 Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 14:44:46 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=206-vi=20=E2=80=94=20WA?= =?UTF-8?q?RP=20+=20NordVPN=20provisioning=20modals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the toast stubs on the Basics tab and Outbounds toolbar with the legacy WARP + NordVPN provisioning flows. Both modals now stage their wireguard outbounds back into templateSettings.outbounds through the same event channels OutboundsTab uses, so the existing add / reset / delete / refresh-traffic surface keeps working. - WarpModal.vue: empty state shows a single Create button that generates a wireguard keypair locally (Wireguard.generateKeypair) and posts it to /panel/xray/warp/reg; populated state surfaces the access_token / device_id / license_key / private_key, lets the user upgrade to WARP+ via /panel/xray/warp/license, refreshes the account info from /panel/xray/warp/config (plan / quota / usage in human-readable bytes), and stages a wireguard outbound with the WARP-specific reserved-byte encoding pulled from client_id. Add / Reset / Delete go through events the parent routes back to templateSettings.outbounds. - NordModal.vue: dual-tab login (NordVPN access token → /panel/xray/nord/reg, or paste a NordLynx private key → /panel/xray/nord/setKey). Once authenticated, country / city / server selectors fetch from /panel/xray/nord/{countries,servers}, servers sort by load ascending, the lowest-load server in the current city auto-selects. Reset emits oldTag/newTag so the parent renames matching routing rules in place; logout emits a remove-routing-rules event with prefix `nord-` to purge any dangling references. - XrayPage.vue: holds warpOpen / nordOpen flags, ensures the outbounds array exists before mutating it, and wires the modal events (add-outbound / reset-outbound / remove-outbound / remove-routing-rules) to in-place edits of templateSettings. Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/xray/NordModal.vue | 395 ++++++++++++++++++++++++++ frontend/src/pages/xray/WarpModal.vue | 343 ++++++++++++++++++++++ frontend/src/pages/xray/XrayPage.vue | 75 ++++- 3 files changed, 810 insertions(+), 3 deletions(-) create mode 100644 frontend/src/pages/xray/NordModal.vue create mode 100644 frontend/src/pages/xray/WarpModal.vue diff --git a/frontend/src/pages/xray/NordModal.vue b/frontend/src/pages/xray/NordModal.vue new file mode 100644 index 00000000..2a1bde8c --- /dev/null +++ b/frontend/src/pages/xray/NordModal.vue @@ -0,0 +1,395 @@ + + + + + diff --git a/frontend/src/pages/xray/WarpModal.vue b/frontend/src/pages/xray/WarpModal.vue new file mode 100644 index 00000000..4c7d69fd --- /dev/null +++ b/frontend/src/pages/xray/WarpModal.vue @@ -0,0 +1,343 @@ + + + + + diff --git a/frontend/src/pages/xray/XrayPage.vue b/frontend/src/pages/xray/XrayPage.vue index b7cf1f58..90db51a6 100644 --- a/frontend/src/pages/xray/XrayPage.vue +++ b/frontend/src/pages/xray/XrayPage.vue @@ -1,5 +1,5 @@