feat: 修改代码冲突
This commit is contained in:
@@ -133,11 +133,21 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
|
||||
if (value != null) {
|
||||
isQuickConnectEnabled.value = value;
|
||||
// 保存闪连状态到本地存储
|
||||
await _storage.kr_saveBool(key: _quickConnectKey, value: value);
|
||||
await _saveQuickConnectStatus(value);
|
||||
KRLogUtil.kr_i('闪连状态已更新: $value', tag: 'QuickConnect');
|
||||
}
|
||||
}
|
||||
|
||||
// 保存闪连状态到本地存储
|
||||
Future<void> _saveQuickConnectStatus(bool enabled) async {
|
||||
try {
|
||||
await _storage.kr_saveBool(key: _quickConnectKey, value: enabled);
|
||||
KRLogUtil.kr_i('闪连状态已保存到本地存储: $enabled', tag: 'QuickConnect');
|
||||
} catch (e) {
|
||||
KRLogUtil.kr_e('保存闪连状态失败: $e', tag: 'QuickConnect');
|
||||
}
|
||||
}
|
||||
|
||||
// 从本地存储加载闪连状态
|
||||
Future<void> _loadQuickConnectStatus() async {
|
||||
try {
|
||||
@@ -1889,7 +1899,7 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
|
||||
}
|
||||
|
||||
// 准备节点地址列表
|
||||
final nodeAddresses = <MapEntry<String, SocketAddress>>[];
|
||||
final nodeAddresses = []; // <MapEntry<String, SocketAddress>>[];
|
||||
|
||||
for (final node in testableNodes) {
|
||||
// 从节点配置中提取服务器地址和端口
|
||||
@@ -1897,7 +1907,7 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
|
||||
String host = node.serverAddr;
|
||||
int port = 0;
|
||||
|
||||
// 尝试从config中获取端口
|
||||
/*// 尝试从config中获取端口
|
||||
if (node.config.containsKey('server_port')) {
|
||||
port = node.config['server_port'] as int;
|
||||
} else if (node.config.containsKey('port')) {
|
||||
@@ -1914,7 +1924,7 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
|
||||
KRLogUtil.kr_w('⚠️ 节点 ${node.tag} 缺少地址或端口信息', tag: 'HomeController');
|
||||
// 设置为失败
|
||||
node.urlTestDelay.value = 65535;
|
||||
}
|
||||
}*/
|
||||
} catch (e) {
|
||||
KRLogUtil.kr_e('❌ 解析节点 ${node.tag} 配置失败: $e', tag: 'HomeController');
|
||||
node.urlTestDelay.value = 65535;
|
||||
@@ -1932,7 +1942,7 @@ class KRHomeController extends GetxController with WidgetsBindingObserver {
|
||||
final results = await KRLatencyTester.testMultipleNodes(
|
||||
nodes: nodeAddresses,
|
||||
concurrency: 10, // 每批10个并发
|
||||
timeout: 5000, // 超时时间5秒(毫秒)
|
||||
timeout: const Duration(seconds: 5),
|
||||
);
|
||||
|
||||
// 更新节点延迟
|
||||
|
||||
Reference in New Issue
Block a user