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

@@ -59,7 +59,8 @@ class Settings {
class Device {
final String id;
final bool busy;
const Device(this.id, this.busy);
final String agentId, computerName;
const Device(this.id, this.busy, {this.agentId = "", this.computerName = ""});
}
class Session {
@@ -144,14 +145,16 @@ class ManagerRepository {
}
String findTool(String name) {
final exe = '$name.exe';
final exe = Platform.isWindows ? '$name.exe' : name;
final base = p.dirname(Platform.resolvedExecutable);
final candidates = [
p.join(base, exe),
p.join(base, 'tools', 'scrcpy', exe),
if (root != null) p.join(root!.path, 'bin', exe),
if (root != null) p.join(root!.path, 'bin', 'tools', 'scrcpy', exe),
for (final dir in (Platform.environment['PATH'] ?? '').split(';'))
for (final dir in (Platform.environment['PATH'] ?? '').split(
Platform.isWindows ? ';' : ':',
))
p.join(dir, exe),
];
return candidates.firstWhere(
@@ -265,7 +268,12 @@ class ManagerRepository {
if (!RegExp(r'^[a-zA-Z0-9_.-]{1,128}$').hasMatch(id)) {
throw const FormatException('无效设备 ID');
}
return Device(id, j['busy'] == true);
return Device(
id,
j['busy'] == true,
agentId: j['agent_id'] as String? ?? '',
computerName: j['computer_name'] as String? ?? '',
);
}).toList()..sort((a, b) => a.id.compareTo(b.id));
}