feat(happ): add routing editor, optional ad blocking, and LAN bypass preset (#6545)

* feat(happ): make ad blocking optional in routing presets

Add an independent AdBlock toggle for Iran, China, and global presets, applied only when generating routing rules. Update the China preset to Bypass-CN and cover preset behavior and localized controls.

* feat: add visual routing editor with JSON support and localization updates

- Implemented a new modal for editing routing profiles with basic and advanced tabs.
- Added functionality to load, parse, and generate routing profiles in JSON format.
- Enhanced user experience with validation and error handling for JSON input.
- Updated translations for Russian, Turkish, Ukrainian, Vietnamese, Chinese (Simplified and Traditional) to include new routing editor terms.
- Created helper functions for managing routing profiles and generating deep links.
- Added unit tests for routing editor functionalities and JSON handling.

* feat: update routing editor to preserve null lists in profiles and enhance validation messages
This commit is contained in:
NgaiYeanCoi
2026-09-27 04:57:01 +08:00
committed by GitHub
parent 94fa317e76
commit 5e15120cec
22 changed files with 1363 additions and 209 deletions
+15 -4
View File
@@ -1572,9 +1572,11 @@
"subHappPerAppList": "Android 套件名稱",
"subHappPerAppListDesc": "要納入或排除的 Android 應用程式套件名稱,以逗號分隔(例如 org.telegram.messenger)。",
"subHappPresetIran": "伊朗直連",
"subHappPresetChina": "中國直連",
"subHappPresetAdblock": "廣告封鎖(AdBlock)",
"subHappPresetChina": "中國直連(Bypass-CN)",
"subHappIncludeAdblock": "附加 AdBlock",
"subHappApplyPreset": "套用預設",
"subHappPresetGlobal": "全域代理",
"subHappPresetLocal": "全域代理,略過區域網路 (Global Bypass Local Network)",
"subHappPresetOff": "停用路由(happ://routing/off)",
"subHappColorBlue": "藍色(標準 / 預設)",
"subHappColorGreen": "綠色(成功)",
@@ -1598,9 +1600,18 @@
"subHappPerAppBypass": "繞過(排除清單中的應用程式)",
"subHappPresetApplied": "已將 Happ 範本套用至路由規則",
"subHappPresets": "路由範本",
"subHappPresetsDesc": "為 Happ 用戶端量身打造的預先設定路由規則範本。",
"subHappPresetsDesc": "選擇基礎預設及是否附加廣告封鎖,然後套用以取代目前的分流規則。",
"subHappVisualBuilder": "視覺化規則產生器",
"subHappVisualBuilderDesc": "從網域與 IP 清單建立自訂路由深層連結。",
"subHappVisualBuilderDesc": "載入目前的路由設定檔,編輯其規則或完整 JSON。",
"subHappEditorBasic": "基礎規則",
"subHappEditorAdvanced": "進階編輯器",
"subHappEditorListHint": "每行一條規則。設定檔中的其他欄位會保留。",
"subHappEditorAdvancedHint": "編輯完整的 JSON 設定檔。變更會與基礎規則分頁同步。",
"subHappEditorInvalidJson": "請輸入 JSON 物件。路由清單欄位(若存在)必須為字串陣列或 null。",
"subHappEditorLoadInvalid": "目前的規則不是有效的 Happ 路由連結或 JSON 設定檔。",
"subHappEditorLoadRemote": "此處無法載入遠端 URL。請先貼上 Happ 路由連結或 JSON 設定檔。",
"subHappEditorLoadOff": "路由已停用。請套用預設或清空路由規則,以建立設定檔。",
"subHappEditorNew": "目前沒有規則。從空白的自訂設定檔開始。",
"subHappBuildDeeplink": "產生深層連結",
"subHappModalTitle": "Happ 視覺化路由規則產生器",
"subHappDirectDomains": "直連網域(繞過)",