remove redundant fields

This commit is contained in:
Ahao
2025-05-20 23:07:50 +08:00
Unverified
parent 32ebc8d174
commit 29fd97e402
2 changed files with 4 additions and 7 deletions

View File

@@ -78,7 +78,7 @@
- 重构事件通知机制到独立线程,避免前端卡死
- 优化端口设置,每个端口可随机设置端口号
- 优化了随机端口和密钥机制,防止随机时卡死!
- 优化了保存机制,使用平滑函数,防止客户端卡死!优化了翻译问题!
- 优化了保存机制,使用平滑函数,防止客户端卡死!
## v2.2.3

View File

@@ -8,7 +8,6 @@ import {
import {
Alert,
Box,
Button,
CircularProgress,
FormControlLabel,
IconButton,
@@ -30,7 +29,7 @@ const generateRandomPort = (): number => {
};
const generateRandomPassword = (length: number = 32): string => {
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{}|;:'\",.<>/?";
const charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
let password = "";
for (let i = 0; i < length; i++) {
@@ -98,7 +97,7 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
}
});
// 生成随机配置并重启内核(静默模式)
// 生成随机配置并重启内核
const generateAndRestart = useLockFn(async () => {
try {
setIsRestarting(true);
@@ -131,11 +130,9 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
open: async () => {
setOpen(true);
// 如果自动生成开启,则生成新配置
if (autoGenerate) {
await generateAndRestart();
} else {
// 否则加载现有配置
setController(clashInfo?.server || "");
setSecret(clashInfo?.secret || "");
}
@@ -150,7 +147,7 @@ export const ControllerViewer = forwardRef<DialogRef>((props, ref) => {
}
}, [autoGenerate, open]);
// 优化后的保存函数
// 保存函数(优化)
const onSave = useLockFn(async () => {
if (!controller.trim()) {
showNotice('info', t("Controller address cannot be empty"), 3000);