Эх сурвалжийг харах

fix: add valid clash field

GyDi 2 жил өмнө
parent
commit
35de2334fb

+ 26 - 2
src/services/enhance.ts

@@ -2,7 +2,20 @@ import { emit, listen, Event } from "@tauri-apps/api/event";
 import { appWindow } from "@tauri-apps/api/window";
 import ignoreCase from "@/utils/ignore-case";
 
-const DEFAULT_FIELDS = [
+export const HANDLE_FIELDS = [
+  "port",
+  "socks-port",
+  "redir-port",
+  "tproxy-port",
+  "mixed-port",
+  "allow-lan",
+  "mode",
+  "log-level",
+  "ipv6",
+  "external-controller",
+];
+
+export const DEFAULT_FIELDS = [
   "rules",
   "proxies",
   "proxy-groups",
@@ -10,15 +23,26 @@ const DEFAULT_FIELDS = [
   "rule-providers",
 ] as const;
 
-const USE_FLAG_FIELDS = [
+export const USE_FLAG_FIELDS = [
   "tun",
   "dns",
+  "ebpf",
   "hosts",
   "script",
   "profile",
   "payload",
+  "auto-redir",
+  "experimental",
   "interface-name",
   "routing-mark",
+  "tproxy-port",
+  "iptables",
+  "external-ui",
+  "bind-address",
+  "authentication",
+  "sniffer", // meta
+  "geodata-mode", // meta
+  "tcp-concurrent", // meta
 ] as const;
 
 /**

+ 12 - 0
src/services/types.d.ts

@@ -178,6 +178,18 @@ declare namespace CmdType {
     "append-proxies"?: any[];
     "prepend-proxy-groups"?: any[];
     "append-proxy-groups"?: any[];
+    // fix
+    ebpf?: any;
+    experimental?: any;
+    iptables?: any;
+    sniffer?: any;
+    authentication?: any;
+    "bind-address"?: any;
+    "external-ui"?: any;
+    "auto-redir"?: any;
+    "tproxy-port"?: any;
+    "geodata-mode"?: any;
+    "tcp-concurrent"?: any;
   }
 
   // partial of the clash config