Monitor ADB device presence and withdraw stale registrations in 0.2.6
This commit is contained in:
1 parent
03e729a60b
commit
dc29a20a41
17 files changed
+488
-23
No files matched your search
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup><Version>0.2.5</Version><OutputType>WinExe</OutputType><TargetFramework>net8.0</TargetFramework><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup>
|
||||
<PropertyGroup><Version>0.2.6</Version><OutputType>WinExe</OutputType><TargetFramework>net8.0</TargetFramework><Nullable>enable</Nullable><ImplicitUsings>enable</ImplicitUsings></PropertyGroup>
|
||||
<ItemGroup><PackageReference Include="Avalonia.Desktop" Version="11.3.8"/><PackageReference Include="Semi.Avalonia" Version="11.3.7.3"/><PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0"/></ItemGroup>
|
||||
<ItemGroup><AvaloniaResource Include="Assets/**"/></ItemGroup></Project>
|
||||
@@ -12,7 +12,7 @@ public sealed record ManagedDevice(
|
||||
[property:JsonPropertyName("device_port")] int DevicePort, bool Enabled, bool Connected,
|
||||
[property:JsonPropertyName("last_error")] string? LastError)
|
||||
{
|
||||
public string Description => $"{Id} · {(Enabled ? Connected ? LastError==null ? "已注册" : "转发异常" : "等待注册" : "已停用")} · {Target ?? AdbSerial}";
|
||||
public string Description => $"{Id} · {(Enabled ? Connected ? LastError==null ? "已注册" : "转发异常:"+LastError : LastError==null ? "等待注册" : "未就绪:"+LastError : "已停用")} · {Target ?? AdbSerial}";
|
||||
}
|
||||
public sealed record ManagedStatus(string Id, string Name, string Hostname, string Os, string Arch, string Version, int Pid,
|
||||
[property:JsonPropertyName("uptime_seconds")] long UptimeSeconds, bool Supervised, long Revision, string Instance, ManagedDevice[] Devices);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Ads.Desktop;
|
||||
public sealed record DeviceItem(string Id, bool Busy, bool IsLocal, bool Online = true, string LocalSummary = "", string ComputerName="", string AgentId="")
|
||||
{
|
||||
public string ComputerLabel => "电脑:"+(ComputerName.Length==0?"未上报电脑名":ComputerName)+(AgentId.Length==0?"":" · "+AgentId);
|
||||
public string Description => IsLocal ? "本机 · " + LocalSummary : !Online ? "远程暂时离线" : Busy ? "在线 · 其他客户端使用中" : "在线 · 可连接";
|
||||
public string Description => !Online ? (IsLocal ? "远端离线 · 本机通道等待恢复" : "远程暂时离线") : IsLocal ? "本机 · " + LocalSummary : Busy ? "在线 · 其他客户端使用中" : "在线 · 可连接";
|
||||
}
|
||||
|
||||
public partial class MainViewModel : ObservableObject, IDisposable
|
||||
|
||||
Reference in new issue
Block a user