mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 17:02:22 +08:00
remove redundant fields
This commit is contained in:
@@ -78,7 +78,7 @@
|
|||||||
- 重构事件通知机制到独立线程,避免前端卡死
|
- 重构事件通知机制到独立线程,避免前端卡死
|
||||||
- 优化端口设置,每个端口可随机设置端口号
|
- 优化端口设置,每个端口可随机设置端口号
|
||||||
- 优化了随机端口和密钥机制,防止随机时卡死!
|
- 优化了随机端口和密钥机制,防止随机时卡死!
|
||||||
- 优化了保存机制,使用平滑函数,防止客户端卡死!优化了翻译问题!
|
- 优化了保存机制,使用平滑函数,防止客户端卡死!
|
||||||
|
|
||||||
## v2.2.3
|
## v2.2.3
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
Alert,
|
Alert,
|
||||||
Box,
|
Box,
|
||||||
Button,
|
|
||||||
CircularProgress,
|
CircularProgress,
|
||||||
FormControlLabel,
|
FormControlLabel,
|
||||||
IconButton,
|
IconButton,
|
||||||
@@ -30,7 +29,7 @@ const generateRandomPort = (): number => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const generateRandomPassword = (length: number = 32): string => {
|
const generateRandomPassword = (length: number = 32): string => {
|
||||||
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:'\",.<>/?";
|
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
||||||
let password = "";
|
let password = "";
|
||||||
|
|
||||||
for (let i = 0; i < length; i++) {
|
for (let i = 0; i < length; i++) {
|
||||||
@@ -98,7 +97,7 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 生成随机配置并重启内核(静默模式)
|
// 生成随机配置并重启内核
|
||||||
const generateAndRestart = useLockFn(async () => {
|
const generateAndRestart = useLockFn(async () => {
|
||||||
try {
|
try {
|
||||||
setIsRestarting(true);
|
setIsRestarting(true);
|
||||||
@@ -131,11 +130,9 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
open: async () => {
|
open: async () => {
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
|
|
||||||
// 如果自动生成开启,则生成新配置
|
|
||||||
if (autoGenerate) {
|
if (autoGenerate) {
|
||||||
await generateAndRestart();
|
await generateAndRestart();
|
||||||
} else {
|
} else {
|
||||||
// 否则加载现有配置
|
|
||||||
setController(clashInfo?.server || "");
|
setController(clashInfo?.server || "");
|
||||||
setSecret(clashInfo?.secret || "");
|
setSecret(clashInfo?.secret || "");
|
||||||
}
|
}
|
||||||
@@ -150,7 +147,7 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
|
|||||||
}
|
}
|
||||||
}, [autoGenerate, open]);
|
}, [autoGenerate, open]);
|
||||||
|
|
||||||
// 优化后的保存函数
|
// 保存函数(优化)
|
||||||
const onSave = useLockFn(async () => {
|
const onSave = useLockFn(async () => {
|
||||||
if (!controller.trim()) {
|
if (!controller.trim()) {
|
||||||
showNotice('info', t("Controller address cannot be empty"), 3000);
|
showNotice('info', t("Controller address cannot be empty"), 3000);
|
||||||
|
|||||||
Reference in New Issue
Block a user