|
@@ -21,7 +21,18 @@ class ConnectionService {
|
|
|
final ServiceController serviceController = Get.find<ServiceController>();
|
|
|
|
|
|
ConnectionService(this.globalController, this.updateStatus);
|
|
|
-
|
|
|
+ Future<void> startConnectionMac() async {
|
|
|
+ updateStatus(ConnectionStatus.connecting);
|
|
|
+ globalController.updateMsg("正在启动连接...");
|
|
|
+ await globalController.updateNode();
|
|
|
+ await globalController.swift(globalController.selectedNode.value?.name ?? "");
|
|
|
+ // 等待连接建立
|
|
|
+ await Future.delayed(Duration(seconds: 2));
|
|
|
+ updateStatus(ConnectionStatus.connected);
|
|
|
+ globalController.connectStatus.value = true;
|
|
|
+ globalController.updateMsg("连接成功");
|
|
|
+ await globalController.openProxy();
|
|
|
+ }
|
|
|
|
|
|
Future<void> startConnectionWin() async {
|
|
|
try {
|