feat: manage multiple desktop device connections independently
This commit is contained in:
1 parent
08d60de364
commit
05d4d5fea6
12 files changed
+504
-249
No files matched your search
@@ -24,20 +24,48 @@
|
||||
<TabItem Header="设备与连接">
|
||||
<Grid ColumnDefinitions="320,*" Margin="0,16,0,0">
|
||||
<Border Classes="card" Margin="0,0,16,0">
|
||||
<Grid RowDefinitions="Auto,*,Auto,Auto">
|
||||
<Grid RowDefinitions="Auto,*,Auto,Auto,Auto">
|
||||
<TextBlock Text="在线设备" Classes="section"/>
|
||||
<ListBox x:Name="DeviceList" Grid.Row="1" ItemsSource="{Binding Devices}" SelectedItem="{Binding SelectedDevice}" Margin="0,14,0,12" Background="Transparent">
|
||||
<ListBox.ItemTemplate><DataTemplate><StackPanel Margin="5,10" Spacing="6"><TextBlock Text="{Binding Id}" FontSize="17" TextWrapping="Wrap"/><TextBlock Text="{Binding Description}" Classes="label" TextWrapping="Wrap"/></StackPanel></DataTemplate></ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
<TextBlock Grid.Row="2" Text="{Binding DeviceSummary}" Classes="label" TextWrapping="Wrap"/>
|
||||
<CheckBox Grid.Row="3" Content="自动刷新设备列表" IsChecked="{Binding AutoRefresh}" Margin="0,12,0,0"/>
|
||||
<TextBlock Grid.Row="2" Text="{Binding ConnectionSummary}" Foreground="#66D9C0" Margin="0,0,0,8" TextWrapping="Wrap"/>
|
||||
<TextBlock Grid.Row="3" Text="{Binding DeviceSummary}" Classes="label" TextWrapping="Wrap"/>
|
||||
<CheckBox Grid.Row="4" Content="自动刷新设备列表" IsChecked="{Binding AutoRefresh}" Margin="0,12,0,0"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ScrollViewer Grid.Column="1">
|
||||
<StackPanel Spacing="14">
|
||||
<Border Classes="card">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="连接管理" Classes="section"/>
|
||||
<Grid ColumnDefinitions="*,Auto"><TextBlock Text="多设备连接总览" Classes="section"/><TextBlock Grid.Column="1" Text="{Binding ConnectionSummary}" Foreground="#66D9C0" VerticalAlignment="Center"/></Grid>
|
||||
<WrapPanel><Button x:Name="ConnectAllButton" Content="连接全部空闲设备" Command="{Binding ConnectAllCommand}"/><Button Content="投屏全部就绪设备" Command="{Binding StartAllScreensCommand}"/><Button x:Name="DisconnectAllButton" Content="断开全部" Command="{Binding DisconnectAllCommand}"/></WrapPanel>
|
||||
<ScrollViewer MaxHeight="380">
|
||||
<ItemsControl x:Name="ConnectionsList" ItemsSource="{Binding Connections}">
|
||||
<ItemsControl.ItemTemplate><DataTemplate>
|
||||
<Border Background="#101923" CornerRadius="8" Padding="12" Margin="0,0,0,8">
|
||||
<StackPanel Spacing="6">
|
||||
<Grid ColumnDefinitions="*,Auto"><TextBlock Text="{Binding DeviceId}" FontSize="17" FontWeight="SemiBold"/><TextBlock Grid.Column="1" Text="{Binding Mode}" Foreground="#66D9C0"/></Grid>
|
||||
<TextBlock Text="{Binding Status}" Foreground="#66D9C0"/>
|
||||
<TextBlock Text="{Binding Endpoint}" Classes="label"/><TextBlock Text="{Binding PortSummary}" Classes="label" FontSize="12" TextWrapping="Wrap"/><TextBlock Text="{Binding TransportStatus}" Classes="label" TextWrapping="Wrap"/>
|
||||
<WrapPanel>
|
||||
<Button Content="查看" Command="{Binding $parent[Window].DataContext.SelectConnectionCommand}" CommandParameter="{Binding}" Padding="10,6"/>
|
||||
<Button Content="打开控制" Command="{Binding $parent[Window].DataContext.StartScreenDeviceCommand}" CommandParameter="{Binding}" IsEnabled="{Binding Ready}" Padding="10,6"/>
|
||||
<Button Content="停止投屏" Command="{Binding $parent[Window].DataContext.StopScreenDeviceCommand}" CommandParameter="{Binding}" IsEnabled="{Binding ScreenRunning}" Padding="10,6"/>
|
||||
<Button Content="重连" Command="{Binding $parent[Window].DataContext.ReconnectDeviceCommand}" CommandParameter="{Binding}" Padding="10,6"/>
|
||||
<Button Content="断开" Command="{Binding $parent[Window].DataContext.DisconnectDeviceCommand}" CommandParameter="{Binding}" Padding="10,6"/>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</DataTemplate></ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
<TextBlock Text="端口自动分配;每台手机可打开独立控制窗口。切换左侧设备不会断开其他连接。" Classes="label" TextWrapping="Wrap" FontSize="12"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Classes="card">
|
||||
<StackPanel Spacing="12">
|
||||
<TextBlock Text="所选设备 · 连接管理" Classes="section"/>
|
||||
<TextBlock x:Name="ConnectionStatusText" Text="{Binding Status}" Foreground="#66D9C0" FontSize="19" TextWrapping="Wrap"/>
|
||||
<TextBlock x:Name="TransportStatusText" Text="{Binding TransportStatus}" Foreground="#A8B7CC" TextWrapping="Wrap"/>
|
||||
<TextBlock x:Name="EndpointText" Text="{Binding ActiveEndpoint}" Classes="label" TextWrapping="Wrap"/>
|
||||
@@ -100,14 +128,14 @@
|
||||
<CheckBox x:Name="UsbModeCheck" Content="将远程手机挂载为本机 USB ADB 设备" IsChecked="{Binding UsbMode}"/>
|
||||
<TextBlock Text="需要安装 USBip 虚拟控制器驱动。仅模拟 ADB 接口;首次使用仍需手机授权,修改在下次连接生效。" Classes="label" TextWrapping="Wrap"/>
|
||||
<TextBlock Text="usbip.exe 路径"/><TextBox Text="{Binding UsbipPath}" Watermark="C:\Program Files\USBip\usbip.exe"/>
|
||||
<Grid ColumnDefinitions="*,180"><TextBlock Text="本机 USB/IP 端口" VerticalAlignment="Center"/><NumericUpDown Grid.Column="1" Value="{Binding UsbPort}" Minimum="1024" Maximum="65535"/></Grid>
|
||||
<Grid ColumnDefinitions="*,180"><TextBlock Text="起始 USB/IP 端口(自动分配)" VerticalAlignment="Center"/><NumericUpDown Grid.Column="1" Value="{Binding UsbPort}" Minimum="1024" Maximum="65535"/></Grid>
|
||||
<TextBlock Text="驱动安装方式见项目 docs/windows-usb.md;默认网络 ADB 模式不需要此组件。" Classes="label" TextWrapping="Wrap"/>
|
||||
</StackPanel></Border>
|
||||
<Border Classes="card"><StackPanel Spacing="12">
|
||||
<TextBlock Text="本地连接" Classes="section"/>
|
||||
<CheckBox x:Name="RelayOnlyCheck" Content="仅使用中继(关闭时 P2P 优先,失败自动选择中继节点)" IsChecked="{Binding RelayOnly}"/>
|
||||
<Grid ColumnDefinitions="*,180"><TextBlock Text="本地 ADB 端口" VerticalAlignment="Center"/><NumericUpDown Grid.Column="1" Value="{Binding Port}" Minimum="1024" Maximum="65535"/></Grid>
|
||||
<WrapPanel><Button Content="清理占用端口" Command="{Binding ClearPortCommand}" ToolTip.Tip="结束当前所选端口的监听进程"/><TextBlock Text="{Binding PortCleanupStatus}" Classes="label" TextWrapping="Wrap" MaxWidth="580" VerticalAlignment="Center"/></WrapPanel>
|
||||
<Grid ColumnDefinitions="*,180"><TextBlock Text="起始 ADB 端口(自动分配)" VerticalAlignment="Center"/><NumericUpDown Grid.Column="1" Value="{Binding Port}" Minimum="1024" Maximum="65535"/></Grid>
|
||||
<WrapPanel><Button Content="清理占用端口" Command="{Binding ClearPortCommand}" ToolTip.Tip="清理所选设备的隧道端口;未连接时清理起始端口"/><TextBlock Text="{Binding PortCleanupStatus}" Classes="label" TextWrapping="Wrap" MaxWidth="580" VerticalAlignment="Center"/></WrapPanel>
|
||||
<CheckBox Content="关闭窗口时保留连接并最小化到托盘" IsChecked="{Binding MinimizeToTray}"/>
|
||||
<TextBlock Text="配置修改在下一次连接生效。完全退出工作台会停止本机连接;远程守护程序继续运行。" TextWrapping="Wrap" Classes="label"/>
|
||||
<Button Content="保存配置" Command="{Binding SaveCommand}" HorizontalAlignment="Left"/>
|
||||
|
||||
Reference in new issue
Block a user