mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-10-02 04:02:07 +03:00
5e15120cec
* 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
17 lines
634 B
TypeScript
17 lines
634 B
TypeScript
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>;
|