|
@@ -88,10 +88,11 @@ class HomeController extends GetxController {
|
|
|
}
|
|
|
|
|
|
Future<void> handleButtonClick() async {
|
|
|
-
|
|
|
+ if(connectStatus.value == ConnectionStatus.connecting ){
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 如果当前状态是已连接或正在连接,则停止服务
|
|
|
- if (connectStatus.value == ConnectionStatus.connecting ||
|
|
|
- connectStatus.value == ConnectionStatus.stopped) {
|
|
|
+ if (connectStatus.value == ConnectionStatus.stopped) {
|
|
|
controllers.global.allowStatusUpdate = false;
|
|
|
await controllers.config.setBreakConnections(true);
|
|
|
// // 停止服务
|
|
@@ -129,15 +130,11 @@ class HomeController extends GetxController {
|
|
|
await controllers.global.systemProxySwitch(true);
|
|
|
}
|
|
|
|
|
|
- //await controllers.global.handleSetProxieGroup();
|
|
|
- await controllers.global.updateDate();
|
|
|
-
|
|
|
- // updateStatus(ConnectionStatus.connecting);
|
|
|
- // await Future.delayed(const Duration(seconds: 5));
|
|
|
- // updateStatus(ConnectionStatus.stopped);
|
|
|
- await controllers.tray.updateTray();
|
|
|
updateStatus(ConnectionStatus.connecting);
|
|
|
await Future.delayed(const Duration(seconds: 3));
|
|
|
+ await controllers.global.updateNode();
|
|
|
+ await controllers.global.updateDate();
|
|
|
+ await controllers.tray.updateTray();
|
|
|
updateStatus(ConnectionStatus.stopped);
|
|
|
}
|
|
|
}
|
|
@@ -237,8 +234,8 @@ class HomeController extends GetxController {
|
|
|
String GetExpiredAt() => "到期时间:${userMode.value.expiredAt}";
|
|
|
String GetTraffic() => "用户流量:${userMode.value.unusedTraffic}";
|
|
|
String GetNode() => controllers.global.selectedNode.value?.name ?? "未选择节点";
|
|
|
- String getHttp() => "https://127.0.0.1:${controllers.core.config.value.mixedPort}";
|
|
|
- String getSocket() => "socks5://127.0.0.1:${controllers.core.config.value.mixedPort}";
|
|
|
+ String getHttp() => "http 127.0.0.1:${controllers.core.config.value.mixedPort}";
|
|
|
+ String getSocket() => "socks 127.0.0.1:${controllers.core.config.value.mixedPort}";
|
|
|
|
|
|
void RouteNode() => Get.toNamed(Routes.NODE);
|
|
|
}
|