feat: migrate Flutter to Cupertino with daily logs and computer groups

This commit is contained in:
tongtong committed 2026-11-13 11:27:46 +08:00
1 parent c568749d23
commit 87e1fff59b
22 files changed
+808 -55

No files matched your search

+13 -1
View File
@@ -95,7 +95,12 @@ class AgentService implements AgentApi {
final code = await child.exitCode.timeout(const Duration(seconds: 22));
final result = ProcessResult(child.pid, code, await out, await error);
if (code != 0) {
throw StateError(redact(result.stderr as String));
var message = redact(result.stderr as String);
if (message.contains('unknown variant') &&
message.contains('devices_discover')) {
message = '本机 adsctl 或 Agent 版本过旧,请同步更新两者后重启 Agent';
}
throw StateError(message);
}
return result;
} on TimeoutException {
@@ -142,6 +147,9 @@ class AgentService implements AgentApi {
@override
Future<void> start(String path) async {
if (!await File(path).exists()) {
throw StateError("请先导入 agent.env 并初始化本机配置,再启动 Agent");
}
try {
await local(path, {'op': 'status'});
return;
@@ -160,6 +168,10 @@ class AgentService implements AgentApi {
@override
Future<void> install(String path) async {
if (Platform.isLinux) {
await _cli(['--config', path, 'service', 'install']);
return;
}
if (!Platform.isWindows) {
throw UnsupportedError('请在终端运行 adsctl service install,系统级服务加 --system');
}