feat: support clash fields filter in ui
This commit is contained in:
parent
c5289dc0e8
commit
ab429dfeb6
@ -20,6 +20,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
const [open, setOpen] = useState(false);
|
const [open, setOpen] = useState(false);
|
||||||
const [values, setValues] = useState({
|
const [values, setValues] = useState({
|
||||||
autoCloseConnection: false,
|
autoCloseConnection: false,
|
||||||
|
enableClashFields: true,
|
||||||
enableBuiltinEnhanced: true,
|
enableBuiltinEnhanced: true,
|
||||||
proxyLayoutColumn: 6,
|
proxyLayoutColumn: 6,
|
||||||
defaultLatencyTest: "",
|
defaultLatencyTest: "",
|
||||||
@ -30,6 +31,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
setOpen(true);
|
setOpen(true);
|
||||||
setValues({
|
setValues({
|
||||||
autoCloseConnection: verge?.auto_close_connection ?? false,
|
autoCloseConnection: verge?.auto_close_connection ?? false,
|
||||||
|
enableClashFields: verge?.enable_clash_fields ?? true,
|
||||||
enableBuiltinEnhanced: verge?.enable_builtin_enhanced ?? true,
|
enableBuiltinEnhanced: verge?.enable_builtin_enhanced ?? true,
|
||||||
proxyLayoutColumn: verge?.proxy_layout_column || 6,
|
proxyLayoutColumn: verge?.proxy_layout_column || 6,
|
||||||
defaultLatencyTest: verge?.default_latency_test || "",
|
defaultLatencyTest: verge?.default_latency_test || "",
|
||||||
@ -42,6 +44,7 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
try {
|
try {
|
||||||
await patchVerge({
|
await patchVerge({
|
||||||
auto_close_connection: values.autoCloseConnection,
|
auto_close_connection: values.autoCloseConnection,
|
||||||
|
enable_clash_fields: values.enableClashFields,
|
||||||
enable_builtin_enhanced: values.enableBuiltinEnhanced,
|
enable_builtin_enhanced: values.enableBuiltinEnhanced,
|
||||||
proxy_layout_column: values.proxyLayoutColumn,
|
proxy_layout_column: values.proxyLayoutColumn,
|
||||||
default_latency_test: values.defaultLatencyTest,
|
default_latency_test: values.defaultLatencyTest,
|
||||||
@ -75,6 +78,17 @@ export const MiscViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
/>
|
/>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
||||||
|
<ListItem sx={{ padding: "5px 2px" }}>
|
||||||
|
<ListItemText primary="Clash Fields Filter" />
|
||||||
|
<Switch
|
||||||
|
edge="end"
|
||||||
|
checked={values.enableClashFields}
|
||||||
|
onChange={(_, c) =>
|
||||||
|
setValues((v) => ({ ...v, enableClashFields: c }))
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</ListItem>
|
||||||
|
|
||||||
<ListItem sx={{ padding: "5px 2px" }}>
|
<ListItem sx={{ padding: "5px 2px" }}>
|
||||||
<ListItemText primary="Enable Builtin Enhanced" />
|
<ListItemText primary="Enable Builtin Enhanced" />
|
||||||
<Switch
|
<Switch
|
||||||
|
1
src/services/types.d.ts
vendored
1
src/services/types.d.ts
vendored
@ -182,6 +182,7 @@ interface IVergeConfig {
|
|||||||
};
|
};
|
||||||
auto_close_connection?: boolean;
|
auto_close_connection?: boolean;
|
||||||
default_latency_test?: string;
|
default_latency_test?: string;
|
||||||
|
enable_clash_fields?: boolean;
|
||||||
enable_builtin_enhanced?: boolean;
|
enable_builtin_enhanced?: boolean;
|
||||||
proxy_layout_column?: number;
|
proxy_layout_column?: number;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user