From 57f502525fab1e96169611fbeb90d0d9fbf2274e Mon Sep 17 00:00:00 2001 From: MHSanaei Date: Fri, 8 May 2026 14:23:02 +0200 Subject: [PATCH] =?UTF-8?q?feat(frontend):=20Phase=206-iii=20=E2=80=94=20x?= =?UTF-8?q?ray=20Routing=20tab=20+=20rule=20modal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the Routing tab placeholder with a full editor for templateSettings.routing.rules: - RoutingTab.vue: a-table over the parsed rules with the legacy six- column layout (action / source / network / destination / inbound / outbound) and the same "lead value + N more" pill renderer for multi-value criteria. Mobile drops source/network/destination for readability. Per-row dropdown handles edit / move-up / move-down / delete; the array-mutation reordering replaces the legacy jQuery Sortable drag handle without pulling in a sortable lib. - RuleFormModal.vue: full form mirroring xray_rule_modal.html — CSV inputs for sourceIP/sourcePort/vlessRoute/ip/domain/user/port, Network select, Protocol multi-select, Attrs key/value pairs, inbound-tag multi-select sourced from templateSettings.inbounds + parent inboundTags + dnsTag, outbound-tag single-select sourced from templateSettings.outbounds + clientReverseTags, and balancerTag from templateSettings.routing.balancers. Submit serializes via the same shape the legacy `getResult` produces (CSV → array, drop empty fields). - XrayPage.vue: imports RoutingTab and exposes inboundTags + clientReverseTags from useXraySetting so the modal can populate its tag pools. Co-Authored-By: Claude Opus 4.7 --- frontend/src/pages/xray/RoutingTab.vue | 401 ++++++++++++++++++++++ frontend/src/pages/xray/RuleFormModal.vue | 254 ++++++++++++++ frontend/src/pages/xray/XrayPage.vue | 10 +- 3 files changed, 664 insertions(+), 1 deletion(-) create mode 100644 frontend/src/pages/xray/RoutingTab.vue create mode 100644 frontend/src/pages/xray/RuleFormModal.vue diff --git a/frontend/src/pages/xray/RoutingTab.vue b/frontend/src/pages/xray/RoutingTab.vue new file mode 100644 index 00000000..8687bec5 --- /dev/null +++ b/frontend/src/pages/xray/RoutingTab.vue @@ -0,0 +1,401 @@ + + + + + diff --git a/frontend/src/pages/xray/RuleFormModal.vue b/frontend/src/pages/xray/RuleFormModal.vue new file mode 100644 index 00000000..0f10ac47 --- /dev/null +++ b/frontend/src/pages/xray/RuleFormModal.vue @@ -0,0 +1,254 @@ + + + + + diff --git a/frontend/src/pages/xray/XrayPage.vue b/frontend/src/pages/xray/XrayPage.vue index 71ddb73e..e9888e8e 100644 --- a/frontend/src/pages/xray/XrayPage.vue +++ b/frontend/src/pages/xray/XrayPage.vue @@ -16,6 +16,7 @@ import { useMediaQuery } from '@/composables/useMediaQuery.js'; import { message } from 'ant-design-vue'; import AppSidebar from '@/components/AppSidebar.vue'; import BasicsTab from './BasicsTab.vue'; +import RoutingTab from './RoutingTab.vue'; import { useXraySetting } from './useXraySetting.js'; // Phase 6-i: scaffold + advanced JSON tab. Other tabs (Basics, Routing, @@ -36,6 +37,8 @@ const { xraySetting, templateSettings, outboundTestUrl, + inboundTags, + clientReverseTags, restartResult, saveAll, restartXray, @@ -140,7 +143,12 @@ function confirmRestart() { - +