mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-11-02 03:05:02 +03:00
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:
@@ -0,0 +1,16 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
// Extensions belong to the Happ client and must survive a trip through this editor.
|
||||
export const HappRoutingProfileSchema = z
|
||||
.object({
|
||||
// The backend treats null lists as absent; preserve them until explicitly edited.
|
||||
DirectSites: z.array(z.string()).nullish(),
|
||||
DirectIp: z.array(z.string()).nullish(),
|
||||
ProxySites: z.array(z.string()).nullish(),
|
||||
ProxyIp: z.array(z.string()).nullish(),
|
||||
BlockSites: z.array(z.string()).nullish(),
|
||||
BlockIp: z.array(z.string()).nullish(),
|
||||
})
|
||||
.catchall(z.unknown());
|
||||
|
||||
export type HappRoutingProfile = z.infer<typeof HappRoutingProfileSchema>;
|
||||
Reference in New Issue
Block a user