Просмотр исходного кода

refactor(ui): 移除主界面设备详情面板及冗余提示

将设备详情迁移至独立窗口,简化主界面布局并清理无用文案。
yangkaixiang 1 месяц назад
Родитель
Сommit
548ae082df

+ 37 - 41
windows/QuickIP.Client/DeviceDetailsWindow.xaml

@@ -9,37 +9,21 @@
         ShowInTaskbar="False"
         ShowInTaskbar="False"
         WindowStartupLocation="CenterOwner">
         WindowStartupLocation="CenterOwner">
     <Grid Background="#F5F7FB" Margin="20">
     <Grid Background="#F5F7FB" Margin="20">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="Auto" />
-            <RowDefinition Height="Auto" />
-            <RowDefinition Height="Auto" />
-            <RowDefinition Height="Auto" />
-            <RowDefinition Height="*" />
-        </Grid.RowDefinitions>
+        <Grid>
+            <Grid.RowDefinitions>
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="Auto" />
+                <RowDefinition Height="*" />
+            </Grid.RowDefinitions>
 
 
-        <Border x:Name="StatusMessageBorder"
-                Visibility="Collapsed"
-                Panel.ZIndex="100"
-                HorizontalAlignment="Center"
-                VerticalAlignment="Top"
-                Margin="24,12,24,0"
-                MaxWidth="860"
-                Padding="14,10"
-                Background="#111827"
-                CornerRadius="10">
-            <TextBlock x:Name="StatusMessageTextBlock"
-                       FontSize="13"
-                       Foreground="White"
-                       TextWrapping="Wrap"
-                       Text="" />
-        </Border>
-
-        <TextBlock FontSize="22"
-                   FontWeight="SemiBold"
-                   Foreground="#111827"
-                   Text="设备信息与 Linux 接口" />
+            <TextBlock FontSize="22"
+                       FontWeight="SemiBold"
+                       Foreground="#111827"
+                       Text="设备信息与 Linux 接口" />
 
 
-        <UniformGrid Grid.Row="1" Margin="0,12,0,0" Columns="4">
+            <UniformGrid Grid.Row="1" Margin="0,12,0,0" Columns="4">
             <Border Margin="0,0,12,0" Padding="14" Background="White" CornerRadius="10">
             <Border Margin="0,0,12,0" Padding="14" Background="White" CornerRadius="10">
                 <StackPanel>
                 <StackPanel>
                     <TextBlock FontSize="12" Foreground="#6B7280" Text="设备 ID" />
                     <TextBlock FontSize="12" Foreground="#6B7280" Text="设备 ID" />
@@ -64,9 +48,9 @@
                     <TextBlock x:Name="RemoteAgentVersionTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
                     <TextBlock x:Name="RemoteAgentVersionTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
                 </StackPanel>
                 </StackPanel>
             </Border>
             </Border>
-        </UniformGrid>
+            </UniformGrid>
 
 
-        <Border Grid.Row="2" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
+            <Border Grid.Row="2" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
             <StackPanel>
             <StackPanel>
                 <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="目标接口" />
                 <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="目标接口" />
                 <ComboBox x:Name="RemoteTargetInterfaceComboBox"
                 <ComboBox x:Name="RemoteTargetInterfaceComboBox"
@@ -75,16 +59,10 @@
                           VerticalContentAlignment="Center"
                           VerticalContentAlignment="Center"
                           DisplayMemberPath="DisplayName"
                           DisplayMemberPath="DisplayName"
                           SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
                           SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
-                <TextBlock x:Name="RemoteSummaryTextBlock"
-                           Margin="0,12,0,0"
-                           FontSize="12"
-                           Foreground="#3730A3"
-                           TextWrapping="Wrap"
-                           Text="正在读取 Linux 管理接口和建议目标接口。" />
             </StackPanel>
             </StackPanel>
-        </Border>
+            </Border>
 
 
-        <Border Grid.Row="3" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
+            <Border Grid.Row="3" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
             <UniformGrid Columns="4">
             <UniformGrid Columns="4">
                 <Border Margin="0,0,12,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
                 <Border Margin="0,0,12,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
                     <StackPanel>
                     <StackPanel>
@@ -111,9 +89,9 @@
                     </StackPanel>
                     </StackPanel>
                 </Border>
                 </Border>
             </UniformGrid>
             </UniformGrid>
-        </Border>
+            </Border>
 
 
-        <Border Grid.Row="4" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
+            <Border Grid.Row="4" Margin="0,12,0,0" Padding="14" Background="White" CornerRadius="10">
             <Grid>
             <Grid>
                 <Grid.RowDefinitions>
                 <Grid.RowDefinitions>
                     <RowDefinition Height="Auto" />
                     <RowDefinition Height="Auto" />
@@ -178,6 +156,24 @@
                     </Grid>
                     </Grid>
                 </Border>
                 </Border>
             </Grid>
             </Grid>
+            </Border>
+        </Grid>
+
+        <Border x:Name="StatusMessageBorder"
+                Visibility="Collapsed"
+                Panel.ZIndex="100"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Top"
+                Margin="24,12,24,0"
+                MaxWidth="860"
+                Padding="14,10"
+                Background="#111827"
+                CornerRadius="10">
+            <TextBlock x:Name="StatusMessageTextBlock"
+                       FontSize="13"
+                       Foreground="White"
+                       TextWrapping="Wrap"
+                       Text="" />
         </Border>
         </Border>
     </Grid>
     </Grid>
 </Window>
 </Window>

+ 2 - 2
windows/QuickIP.Client/DeviceDetailsWindow.xaml.cs

@@ -48,11 +48,11 @@ public partial class DeviceDetailsWindow : Window
         var interfaces = await _agentApiService.GetInterfacesAsync(_baseAddress, _password, _localIPv4);
         var interfaces = await _agentApiService.GetInterfacesAsync(_baseAddress, _password, _localIPv4);
         if (interfaces is null)
         if (interfaces is null)
         {
         {
-            RemoteSummaryTextBlock.Text = "设备已连接,但暂时无法读取 Linux 接口列表。";
+            ShowStatusMessage("设备已连接,但暂时无法读取 Linux 接口列表。");
             return;
             return;
         }
         }
 
 
-        RemoteSummaryTextBlock.Text = $"当前管理接口:{interfaces.ManagementInterface};建议目标接口:{interfaces.SuggestedTargetInterface};{(interfaces.RequiresTargetSelection ? "需要手动选择目标接口。" : "已自动识别建议目标接口。")}";
+        ShowStatusMessage($"当前管理接口:{interfaces.ManagementInterface};建议目标接口:{interfaces.SuggestedTargetInterface};{(interfaces.RequiresTargetSelection ? "需要手动选择目标接口。" : "已自动识别建议目标接口。")}");
         var suggested = interfaces.Interfaces.FirstOrDefault(item => item.SystemName == interfaces.SuggestedTargetInterface)
         var suggested = interfaces.Interfaces.FirstOrDefault(item => item.SystemName == interfaces.SuggestedTargetInterface)
             ?? interfaces.Interfaces.FirstOrDefault(item => item.IsSuggestedTarget)
             ?? interfaces.Interfaces.FirstOrDefault(item => item.IsSuggestedTarget)
             ?? interfaces.Interfaces.FirstOrDefault(item => !item.IsManagementInterface);
             ?? interfaces.Interfaces.FirstOrDefault(item => !item.IsManagementInterface);

+ 15 - 201
windows/QuickIP.Client/MainWindow.xaml

@@ -11,29 +11,8 @@
          MinWidth="920"
          MinWidth="920"
          WindowStartupLocation="CenterScreen">
          WindowStartupLocation="CenterScreen">
     <Grid Background="#F5F7FB">
     <Grid Background="#F5F7FB">
-        <Grid.RowDefinitions>
-            <RowDefinition Height="*" />
-            <RowDefinition Height="Auto" />
-        </Grid.RowDefinitions>
 
 
-        <Border x:Name="StatusMessageBorder"
-                Visibility="Collapsed"
-                Panel.ZIndex="100"
-                HorizontalAlignment="Center"
-                VerticalAlignment="Top"
-                Margin="24,16,24,0"
-                MaxWidth="760"
-                Padding="14,10"
-                Background="#111827"
-                CornerRadius="10">
-            <TextBlock x:Name="StatusTextBlock"
-                       FontSize="13"
-                       Foreground="White"
-                       TextWrapping="Wrap"
-                       Text="" />
-        </Border>
-
-        <Grid Grid.Row="0" Margin="24,24,24,16">
+        <Grid Margin="24,24,24,24">
             <Grid.ColumnDefinitions>
             <Grid.ColumnDefinitions>
                 <ColumnDefinition Width="2.2*" />
                 <ColumnDefinition Width="2.2*" />
                 <ColumnDefinition Width="1.4*" />
                 <ColumnDefinition Width="1.4*" />
@@ -153,10 +132,6 @@
                                        FontWeight="SemiBold"
                                        FontWeight="SemiBold"
                                        Foreground="#111827"
                                        Foreground="#111827"
                                        Text="管理密码(必填)" />
                                        Text="管理密码(必填)" />
-                            <TextBlock Margin="0,6,0,0"
-                                       FontSize="12"
-                                       Foreground="#6B7280"
-                                       Text="用于连接 Linux Agent。客户端不会在界面上显示默认密码。" />
                             <Grid Margin="0,10,0,0">
                             <Grid Margin="0,10,0,0">
                                 <Grid.ColumnDefinitions>
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition Width="*" />
                                     <ColumnDefinition Width="*" />
@@ -181,10 +156,6 @@
                                         Click="TogglePasswordVisibilityButton_OnClick"
                                         Click="TogglePasswordVisibilityButton_OnClick"
                                         Content="👁" />
                                         Content="👁" />
                             </Grid>
                             </Grid>
-                            <TextBlock Margin="0,10,0,0"
-                                       FontSize="12"
-                                       Foreground="#6B7280"
-                                       Text="客户端会自动保存并回填你上次输入的密码。" />
                         </StackPanel>
                         </StackPanel>
                     </Border>
                     </Border>
 
 
@@ -214,178 +185,21 @@
             </Border>
             </Border>
         </Grid>
         </Grid>
 
 
-        <Border Grid.Row="1"
-                x:Name="RemoteDetailsBorder"
+        <Border x:Name="StatusMessageBorder"
                 Visibility="Collapsed"
                 Visibility="Collapsed"
-                Margin="24,0,24,24"
-                Padding="16"
-                Background="White"
-                CornerRadius="12">
-            <Grid>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                    <RowDefinition Height="Auto" />
-                </Grid.RowDefinitions>
-
-                <TextBlock FontSize="18"
-                           FontWeight="SemiBold"
-                           Foreground="#111827"
-                           Text="设备信息与 Linux 接口" />
-
-                <UniformGrid Grid.Row="1" Margin="0,16,0,0" Columns="4">
-                    <Border Margin="0,0,12,0" Padding="14" Background="#F9FAFB" CornerRadius="10">
-                        <StackPanel>
-                            <TextBlock FontSize="12" Foreground="#6B7280" Text="设备 ID" />
-                            <TextBlock x:Name="RemoteDeviceIdTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                        </StackPanel>
-                    </Border>
-                    <Border Margin="0,0,12,0" Padding="14" Background="#F9FAFB" CornerRadius="10">
-                        <StackPanel>
-                            <TextBlock FontSize="12" Foreground="#6B7280" Text="主机名" />
-                            <TextBlock x:Name="RemoteHostnameTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                        </StackPanel>
-                    </Border>
-                    <Border Margin="0,0,12,0" Padding="14" Background="#F9FAFB" CornerRadius="10">
-                        <StackPanel>
-                            <TextBlock FontSize="12" Foreground="#6B7280" Text="Ubuntu 版本" />
-                            <TextBlock x:Name="RemoteOsVersionTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                        </StackPanel>
-                    </Border>
-                    <Border Padding="14" Background="#F9FAFB" CornerRadius="10">
-                        <StackPanel>
-                            <TextBlock FontSize="12" Foreground="#6B7280" Text="Agent 版本" />
-                            <TextBlock x:Name="RemoteAgentVersionTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                        </StackPanel>
-                    </Border>
-                </UniformGrid>
-
-                <Border Grid.Row="2" Margin="0,16,0,0" Padding="16" Background="#F9FAFB" CornerRadius="10">
-                    <Grid>
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                        </Grid.RowDefinitions>
-
-                        <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="目标接口" />
-                        <ComboBox x:Name="RemoteTargetInterfaceComboBox"
-                                  Grid.Row="1"
-                                  Margin="0,12,0,0"
-                                  MinHeight="36"
-                                  DisplayMemberPath="DisplayName"
-                                  SelectionChanged="RemoteTargetInterfaceComboBox_OnSelectionChanged" />
-
-                        <UniformGrid Grid.Row="2" Margin="0,16,0,0" Columns="4">
-                            <Border Margin="0,0,12,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
-                                <StackPanel>
-                                    <TextBlock FontSize="12" Foreground="#6B7280" Text="接口名" />
-                                    <TextBlock x:Name="RemoteConfigInterfaceTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                                </StackPanel>
-                            </Border>
-                            <Border Margin="0,0,12,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
-                                <StackPanel>
-                                    <TextBlock FontSize="12" Foreground="#6B7280" Text="当前 IP" />
-                                    <TextBlock x:Name="RemoteConfigIpTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                                </StackPanel>
-                            </Border>
-                            <Border Margin="0,0,12,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
-                                <StackPanel>
-                                    <TextBlock FontSize="12" Foreground="#6B7280" Text="当前网关" />
-                                    <TextBlock x:Name="RemoteConfigGatewayTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                                </StackPanel>
-                            </Border>
-                            <Border Padding="12" Background="#EEF2FF" CornerRadius="10">
-                                <StackPanel>
-                                    <TextBlock FontSize="12" Foreground="#6B7280" Text="当前 DNS" />
-                                    <TextBlock x:Name="RemoteConfigDnsTextBlock" Margin="0,8,0,0" FontSize="14" FontWeight="SemiBold" Foreground="#111827" Text="-" />
-                                </StackPanel>
-                            </Border>
-                        </UniformGrid>
-                    </Grid>
-                </Border>
-
-                <Border Grid.Row="3" Margin="0,16,0,0" Padding="12" Background="#EEF2FF" CornerRadius="10">
-                    <TextBlock x:Name="RemoteSummaryTextBlock"
-                                FontSize="12"
-                                Foreground="#3730A3"
-                                TextWrapping="Wrap"
-                                Text="连接成功后,这里会显示 Linux 管理接口和建议目标接口。" />
-                </Border>
-
-                <Border Grid.Row="4" Margin="0,12,0,0" Padding="12" Background="#F9FAFB" CornerRadius="10">
-                    <Grid>
-                        <Grid.RowDefinitions>
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                            <RowDefinition Height="Auto" />
-                        </Grid.RowDefinitions>
-
-                        <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="新配置" />
-
-                        <StackPanel Grid.Row="1" Margin="0,12,0,0" Orientation="Horizontal">
-                            <Button x:Name="ReloadInterfaceConfigButton"
-                                    MinHeight="36"
-                                    Padding="14,0"
-                                    Click="ReloadInterfaceConfigButton_OnClick"
-                                    Content="1. 读取当前配置" />
-                            <Button x:Name="ValidateConfigButton"
-                                    Margin="10,0,0,0"
-                                    MinHeight="36"
-                                    Padding="14,0"
-                                    Click="ValidateConfigButton_OnClick"
-                                    Content="2. 校验配置" />
-                            <Button x:Name="ApplyConfigButton"
-                                    Margin="10,0,0,0"
-                                    MinHeight="36"
-                                    Padding="14,0"
-                                    Click="ApplyConfigButton_OnClick"
-                                    Content="3. 应用配置" />
-                        </StackPanel>
-
-                        <UniformGrid Grid.Row="2" Margin="0,12,0,0" Columns="2">
-                            <StackPanel Margin="0,0,12,12">
-                                <TextBlock FontSize="12" Foreground="#6B7280" Text="IP 地址" />
-                                <TextBox x:Name="NewIpTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
-                            </StackPanel>
-                            <StackPanel Margin="0,0,0,12">
-                                <TextBlock FontSize="12" Foreground="#6B7280" Text="子网掩码" />
-                                <TextBox x:Name="NewMaskTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
-                            </StackPanel>
-                            <StackPanel Margin="0,0,12,0">
-                                <TextBlock FontSize="12" Foreground="#6B7280" Text="网关" />
-                                <TextBox x:Name="NewGatewayTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
-                            </StackPanel>
-                            <StackPanel Margin="0,0,0,0">
-                                <TextBlock FontSize="12" Foreground="#6B7280" Text="首选 DNS" />
-                                <TextBox x:Name="NewDnsTextBox" Margin="0,8,0,0" MinHeight="32" TextChanged="ConfigInputChanged_OnChanged" />
-                            </StackPanel>
-                        </UniformGrid>
-
-                        <Border Grid.Row="3" Margin="0,12,0,0" Padding="10" Background="#EEF2FF" CornerRadius="10">
-                            <TextBlock x:Name="ConfigValidationTextBlock"
-                                       FontSize="12"
-                                       Foreground="#3730A3"
-                                       TextWrapping="Wrap"
-                                       Text="点击 1/2/3 按顺序操作:先读取当前配置,再校验,最后应用。" />
-                        </Border>
-
-                        <Border Grid.Row="4" Margin="0,12,0,0" Padding="10" Background="#ECFDF5" CornerRadius="10">
-                            <TextBlock x:Name="ApplyTaskStatusTextBlock"
-                                       FontSize="12"
-                                       Foreground="#065F46"
-                                       TextWrapping="Wrap"
-                                       Text="尚未提交配置任务。" />
-                        </Border>
-                    </Grid>
-                </Border>
-            </Grid>
+                Panel.ZIndex="100"
+                HorizontalAlignment="Center"
+                VerticalAlignment="Top"
+                Margin="24,16,24,0"
+                MaxWidth="760"
+                Padding="14,10"
+                Background="#111827"
+                CornerRadius="10">
+            <TextBlock x:Name="StatusTextBlock"
+                       FontSize="13"
+                       Foreground="White"
+                       TextWrapping="Wrap"
+                       Text="" />
         </Border>
         </Border>
     </Grid>
     </Grid>
 </Window>
 </Window>

+ 2 - 338
windows/QuickIP.Client/MainWindow.xaml.cs

@@ -19,10 +19,6 @@ public partial class MainWindow : Window
     private readonly AgentApiService _agentApiService = new();
     private readonly AgentApiService _agentApiService = new();
     private readonly AdminPrivilegeService _adminPrivilegeService = new();
     private readonly AdminPrivilegeService _adminPrivilegeService = new();
     private IReadOnlyList<AdapterInfo> _adapters = [];
     private IReadOnlyList<AdapterInfo> _adapters = [];
-    private string _connectedBaseAddress = string.Empty;
-    private string _connectedLocalIPv4 = string.Empty;
-    private bool _configValidated;
-    private bool _suppressConfigChangeHandling;
     private bool _isShowingPassword;
     private bool _isShowingPassword;
     private bool _isBusy;
     private bool _isBusy;
     private bool _suppressPasswordSync;
     private bool _suppressPasswordSync;
@@ -74,7 +70,6 @@ public partial class MainWindow : Window
         }
         }
 
 
         AppendLog("客户端已加载连接页。", true);
         AppendLog("客户端已加载连接页。", true);
-        ClearRemoteDetails();
         UpdateButtonStates();
         UpdateButtonStates();
     }
     }
 
 
@@ -83,14 +78,12 @@ public partial class MainWindow : Window
         if (AdapterComboBox.SelectedItem is not AdapterInfo adapter)
         if (AdapterComboBox.SelectedItem is not AdapterInfo adapter)
         {
         {
             UpdateAdapterDetails(null);
             UpdateAdapterDetails(null);
-            ClearRemoteDetails();
             SetStatus("请选择一块有线网卡。", false);
             SetStatus("请选择一块有线网卡。", false);
             UpdateButtonStates();
             UpdateButtonStates();
             return;
             return;
         }
         }
 
 
         UpdateAdapterDetails(adapter);
         UpdateAdapterDetails(adapter);
-        ClearRemoteDetails();
         SetStatus(adapter.HasLink
         SetStatus(adapter.HasLink
             ? $"已选择 {adapter.RecommendationLabel} 网卡,可切换到维护网络。{adapter.RecommendationReason}"
             ? $"已选择 {adapter.RecommendationLabel} 网卡,可切换到维护网络。{adapter.RecommendationReason}"
             : "当前网卡未检测到链路,请检查网线连接。", true);
             : "当前网卡未检测到链路,请检查网线连接。", true);
@@ -182,10 +175,8 @@ public partial class MainWindow : Window
                 var directResult = await _agentApiService.CheckHealthAsync("http://169.254.100.2:48888", GetCurrentPassword(), adapter.IPv4Address);
                 var directResult = await _agentApiService.CheckHealthAsync("http://169.254.100.2:48888", GetCurrentPassword(), adapter.IPv4Address);
                 if (directResult.Success)
                 if (directResult.Success)
                 {
                 {
-                    _connectedBaseAddress = "http://169.254.100.2:48888";
-                    _connectedLocalIPv4 = adapter.IPv4Address;
                     SetStatus("连接成功,无需切换本机网卡。", true);
                     SetStatus("连接成功,无需切换本机网卡。", true);
-                    OpenDeviceDetailsWindow(_connectedBaseAddress, _connectedLocalIPv4);
+                    OpenDeviceDetailsWindow("http://169.254.100.2:48888", adapter.IPv4Address);
                     return;
                     return;
                 }
                 }
 
 
@@ -220,10 +211,8 @@ public partial class MainWindow : Window
             var discoveredResult = await _agentApiService.CheckHealthAsync($"http://{device.Lan2Ip}:48888", GetCurrentPassword(), selectedAdapter?.IPv4Address ?? string.Empty);
             var discoveredResult = await _agentApiService.CheckHealthAsync($"http://{device.Lan2Ip}:48888", GetCurrentPassword(), selectedAdapter?.IPv4Address ?? string.Empty);
             if (discoveredResult.Success)
             if (discoveredResult.Success)
             {
             {
-                _connectedBaseAddress = $"http://{device.Lan2Ip}:48888";
-                _connectedLocalIPv4 = selectedAdapter?.IPv4Address ?? string.Empty;
                 SetStatus("连接成功。", true);
                 SetStatus("连接成功。", true);
-                OpenDeviceDetailsWindow(_connectedBaseAddress, _connectedLocalIPv4);
+                OpenDeviceDetailsWindow($"http://{device.Lan2Ip}:48888", selectedAdapter?.IPv4Address ?? string.Empty);
             }
             }
             else
             else
             {
             {
@@ -232,7 +221,6 @@ public partial class MainWindow : Window
         }
         }
         catch (Exception ex)
         catch (Exception ex)
         {
         {
-            ClearRemoteDetails();
             SetStatus($"连接失败:{ex.Message}", true);
             SetStatus($"连接失败:{ex.Message}", true);
             MessageBox.Show(this, ex.Message, "连接失败", MessageBoxButton.OK, MessageBoxImage.Error);
             MessageBox.Show(this, ex.Message, "连接失败", MessageBoxButton.OK, MessageBoxImage.Error);
         }
         }
@@ -264,9 +252,6 @@ public partial class MainWindow : Window
         RefreshAdaptersButton.IsEnabled = !_isBusy;
         RefreshAdaptersButton.IsEnabled = !_isBusy;
         SwitchMaintenanceButton.IsEnabled = !_isBusy && hasAdapter;
         SwitchMaintenanceButton.IsEnabled = !_isBusy && hasAdapter;
         DiscoverConnectButton.IsEnabled = !_isBusy && hasAdapter && adapter!.HasLink;
         DiscoverConnectButton.IsEnabled = !_isBusy && hasAdapter && adapter!.HasLink;
-        ReloadInterfaceConfigButton.IsEnabled = RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo;
-        ValidateConfigButton.IsEnabled = RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo;
-        ApplyConfigButton.IsEnabled = _configValidated && RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo;
     }
     }
 
 
     private async Task RefreshAdaptersAsync(string? selectedAdapterId = null)
     private async Task RefreshAdaptersAsync(string? selectedAdapterId = null)
@@ -301,44 +286,6 @@ public partial class MainWindow : Window
         AdapterProbeTextBlock.Text = $"{adapter.ProbeStatus} / {adapter.ProbeReason}";
         AdapterProbeTextBlock.Text = $"{adapter.ProbeStatus} / {adapter.ProbeReason}";
     }
     }
 
 
-    private async Task LoadRemoteDetailsAsync(string baseAddress, string localIPv4)
-    {
-        ClearRemoteDetails();
-        RemoteDetailsBorder.Visibility = Visibility.Visible;
-        SetStatus("正在读取设备信息。", true);
-        var device = await _agentApiService.GetDeviceInfoAsync(baseAddress, GetCurrentPassword(), localIPv4);
-        if (device is not null)
-        {
-            RemoteDeviceIdTextBlock.Text = device.DeviceId;
-            RemoteHostnameTextBlock.Text = device.Hostname;
-            RemoteOsVersionTextBlock.Text = device.OSVersion;
-            RemoteAgentVersionTextBlock.Text = device.AgentVersion;
-        }
-
-        SetStatus("正在读取 Linux 接口列表。", true);
-        var interfaces = await _agentApiService.GetInterfacesAsync(baseAddress, GetCurrentPassword(), localIPv4);
-        if (interfaces is not null)
-        {
-            RemoteSummaryTextBlock.Text = $"当前管理接口:{interfaces.ManagementInterface};建议目标接口:{interfaces.SuggestedTargetInterface};{(interfaces.RequiresTargetSelection ? "需要手动选择目标接口。" : "已自动识别建议目标接口。")}";
-
-            var suggested = interfaces.Interfaces.FirstOrDefault(item => item.SystemName == interfaces.SuggestedTargetInterface)
-                ?? interfaces.Interfaces.FirstOrDefault(item => item.IsSuggestedTarget)
-                ?? interfaces.Interfaces.FirstOrDefault(item => !item.IsManagementInterface);
-
-            RemoteTargetInterfaceComboBox.ItemsSource = interfaces.Interfaces;
-            if (suggested is not null)
-            {
-                RemoteTargetInterfaceComboBox.SelectedItem = suggested;
-                await LoadRemoteInterfaceConfigAsync(suggested.SystemName);
-            }
-
-            SetStatus("已加载设备信息和 Linux 接口列表。", true);
-            return;
-        }
-
-        RemoteSummaryTextBlock.Text = "设备已连接,但暂时无法读取 Linux 接口列表。";
-    }
-
     private void OpenDeviceDetailsWindow(string baseAddress, string localIPv4)
     private void OpenDeviceDetailsWindow(string baseAddress, string localIPv4)
     {
     {
         var window = new DeviceDetailsWindow(baseAddress, localIPv4, GetCurrentPassword())
         var window = new DeviceDetailsWindow(baseAddress, localIPv4, GetCurrentPassword())
@@ -348,289 +295,6 @@ public partial class MainWindow : Window
         window.ShowDialog();
         window.ShowDialog();
     }
     }
 
 
-    private void ClearRemoteDetails()
-    {
-        RemoteDetailsBorder.Visibility = Visibility.Collapsed;
-        RemoteDeviceIdTextBlock.Text = "-";
-        RemoteHostnameTextBlock.Text = "-";
-        RemoteOsVersionTextBlock.Text = "-";
-        RemoteAgentVersionTextBlock.Text = "-";
-        RemoteTargetInterfaceComboBox.ItemsSource = null;
-        RemoteConfigInterfaceTextBlock.Text = "-";
-        RemoteConfigIpTextBlock.Text = "-";
-        RemoteConfigGatewayTextBlock.Text = "-";
-        RemoteConfigDnsTextBlock.Text = "-";
-        NewIpTextBox.Text = string.Empty;
-        NewMaskTextBox.Text = string.Empty;
-        NewGatewayTextBox.Text = string.Empty;
-        NewDnsTextBox.Text = string.Empty;
-        ConfigValidationTextBlock.Text = "读取目标接口当前配置后,可在此修改并校验。";
-        ApplyTaskStatusTextBlock.Text = "尚未提交配置任务。";
-        _configValidated = false;
-        RemoteSummaryTextBlock.Text = "连接成功后,这里会显示 Linux 管理接口和建议目标接口。";
-        UpdateButtonStates();
-    }
-
-    private async void RemoteTargetInterfaceComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
-    {
-        if (RemoteTargetInterfaceComboBox.SelectedItem is not RemoteInterfaceInfo selected || string.IsNullOrWhiteSpace(_connectedBaseAddress))
-        {
-            return;
-        }
-
-        await LoadRemoteInterfaceConfigAsync(selected.SystemName);
-    }
-
-    private async Task LoadRemoteInterfaceConfigAsync(string interfaceName)
-    {
-        SetStatus($"正在读取目标接口 {interfaceName} 当前配置。", true);
-        var result = await _agentApiService.GetInterfaceConfigAsync(_connectedBaseAddress, GetCurrentPassword(), _connectedLocalIPv4, interfaceName);
-        if (!result.Success || result.Data is null)
-        {
-            RemoteConfigInterfaceTextBlock.Text = interfaceName;
-            RemoteConfigIpTextBlock.Text = "读取失败";
-            RemoteConfigGatewayTextBlock.Text = "读取失败";
-            RemoteConfigDnsTextBlock.Text = "读取失败";
-            SetStatus($"读取目标接口 {interfaceName} 配置失败:{result.Message}", true);
-            return;
-        }
-
-        var config = result.Data;
-        RemoteConfigInterfaceTextBlock.Text = config.Interface;
-        RemoteConfigIpTextBlock.Text = string.IsNullOrWhiteSpace(config.IP) ? "无" : $"{config.IP}/{config.Prefix}";
-        RemoteConfigGatewayTextBlock.Text = string.IsNullOrWhiteSpace(config.Gateway) ? "无" : config.Gateway;
-        RemoteConfigDnsTextBlock.Text = config.DnsSummary;
-        _suppressConfigChangeHandling = true;
-        NewIpTextBox.Text = config.IP;
-        NewMaskTextBox.Text = PrefixToMask(config.Prefix);
-        NewGatewayTextBox.Text = config.Gateway;
-        NewDnsTextBox.Text = config.Dns.FirstOrDefault() ?? string.Empty;
-        _suppressConfigChangeHandling = false;
-        _configValidated = false;
-        ConfigValidationTextBlock.Text = "已回填目标接口当前配置,可直接修改后校验。";
-        ApplyTaskStatusTextBlock.Text = "尚未提交配置任务。";
-        UpdateButtonStates();
-        SetStatus($"已读取目标接口 {interfaceName} 当前配置。", true);
-    }
-
-    private async void ReloadInterfaceConfigButton_OnClick(object sender, RoutedEventArgs e)
-    {
-        if (RemoteTargetInterfaceComboBox.SelectedItem is not RemoteInterfaceInfo selected)
-        {
-            return;
-        }
-
-        await LoadRemoteInterfaceConfigAsync(selected.SystemName);
-    }
-
-    private async void ValidateConfigButton_OnClick(object sender, RoutedEventArgs e)
-    {
-        if (RemoteTargetInterfaceComboBox.SelectedItem is not RemoteInterfaceInfo selected)
-        {
-            return;
-        }
-
-        var request = BuildConfigRequest(selected.SystemName);
-        if (request is null)
-        {
-            return;
-        }
-
-        SetStatus($"正在校验目标接口 {selected.SystemName} 的新配置。", true);
-        var result = await _agentApiService.ValidateInterfaceConfigAsync(_connectedBaseAddress, GetCurrentPassword(), _connectedLocalIPv4, request);
-        _configValidated = result.Success && result.Data?.Valid == true;
-        if (result.Data is not null)
-        {
-            var warnings = result.Data.Warnings.Count > 0 ? $" 警告:{string.Join(";", result.Data.Warnings)}" : string.Empty;
-            var errors = result.Data.Errors.Count > 0 ? $" 错误:{string.Join(";", result.Data.Errors)}" : string.Empty;
-            ConfigValidationTextBlock.Text = result.Success ? $"校验通过。{warnings}" : $"校验失败。{errors}{warnings}";
-        }
-        else
-        {
-            ConfigValidationTextBlock.Text = $"校验失败:{result.Message}";
-        }
-
-        ApplyTaskStatusTextBlock.Text = _configValidated ? "配置已通过校验,可提交应用。" : "当前配置尚未通过校验。";
-        UpdateButtonStates();
-    }
-
-    private async void ApplyConfigButton_OnClick(object sender, RoutedEventArgs e)
-    {
-        if (RemoteTargetInterfaceComboBox.SelectedItem is not RemoteInterfaceInfo selected)
-        {
-            return;
-        }
-
-        var request = BuildConfigRequest(selected.SystemName);
-        if (request is null)
-        {
-            return;
-        }
-
-        var confirmMessage = $"将要把以下配置应用到接口 {selected.SystemName}:\n\n" +
-                             $"IP:{request.IP}/{request.Prefix}\n" +
-                             $"网关:{(string.IsNullOrWhiteSpace(request.Gateway) ? "无" : request.Gateway)}\n" +
-                             $"DNS:{(request.Dns.Count == 0 ? "无" : string.Join(", ", request.Dns))}\n\n" +
-                             "请确认是否继续。";
-        if (MessageBox.Show(this, confirmMessage, "确认应用配置", MessageBoxButton.OKCancel, MessageBoxImage.Question) != MessageBoxResult.OK)
-        {
-            return;
-        }
-
-        SetStatus($"正在提交目标接口 {selected.SystemName} 的配置任务。", true);
-        var applyResult = await _agentApiService.ApplyInterfaceConfigAsync(_connectedBaseAddress, GetCurrentPassword(), _connectedLocalIPv4, request);
-        if (!applyResult.Success || applyResult.Data is null)
-        {
-            ApplyTaskStatusTextBlock.Text = $"提交配置任务失败:{applyResult.Message}";
-            return;
-        }
-
-        ApplyTaskStatusTextBlock.Text = $"配置任务已提交:{applyResult.Data.TaskId},正在轮询状态。";
-        await PollTaskAsync(applyResult.Data.TaskId);
-    }
-
-    private async Task PollTaskAsync(string taskId)
-    {
-        var transientFailureCount = 0;
-        for (var i = 0; i < 20; i++)
-        {
-            await Task.Delay(1000);
-            var result = await _agentApiService.GetTaskAsync(_connectedBaseAddress, GetCurrentPassword(), _connectedLocalIPv4, taskId);
-            if (!result.Success || result.Data is null)
-            {
-                if (result.StatusCode is null)
-                {
-                    transientFailureCount++;
-                    ApplyTaskStatusTextBlock.Text = $"任务 {taskId} 轮询中,检测到短暂断连,正在重试({transientFailureCount})。";
-                    continue;
-                }
-
-                ApplyTaskStatusTextBlock.Text = $"读取任务状态失败:{result.Message}";
-                return;
-            }
-
-            transientFailureCount = 0;
-            var task = result.Data;
-            ApplyTaskStatusTextBlock.Text = $"任务 {task.TaskId} / {task.Status} / {task.Step} / {task.Detail}";
-            if (task.Status is "success" or "failed" or "rolled_back")
-            {
-                if (RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo selected)
-                {
-                    await LoadRemoteInterfaceConfigAsync(selected.SystemName);
-                }
-
-                return;
-            }
-        }
-
-        ApplyTaskStatusTextBlock.Text = $"任务 {taskId} 轮询超时,请稍后手动刷新。";
-    }
-
-    private RemoteInterfaceConfig? BuildConfigRequest(string interfaceName)
-    {
-        if (string.IsNullOrWhiteSpace(NewIpTextBox.Text))
-        {
-            ConfigValidationTextBlock.Text = "IP 地址不能为空。";
-            return null;
-        }
-
-        if (!TryMaskToPrefix(NewMaskTextBox.Text, out var prefix))
-        {
-            ConfigValidationTextBlock.Text = "子网掩码格式不正确。";
-            return null;
-        }
-
-        var dns = string.IsNullOrWhiteSpace(NewDnsTextBox.Text)
-            ? Array.Empty<string>()
-            : new[] { NewDnsTextBox.Text.Trim() };
-
-        return new RemoteInterfaceConfig
-        {
-            Interface = interfaceName,
-            IP = NewIpTextBox.Text.Trim(),
-            Prefix = prefix,
-            Gateway = NewGatewayTextBox.Text.Trim(),
-            Dns = dns,
-        };
-    }
-
-    private static string PrefixToMask(int prefix)
-    {
-        if (prefix < 0 || prefix > 32)
-        {
-            return string.Empty;
-        }
-
-        var mask = prefix == 0 ? 0u : uint.MaxValue << (32 - prefix);
-        return string.Join('.', new[]
-        {
-            (mask >> 24) & 255,
-            (mask >> 16) & 255,
-            (mask >> 8) & 255,
-            mask & 255,
-        });
-    }
-
-    private static bool TryMaskToPrefix(string maskText, out int prefix)
-    {
-        prefix = 0;
-        if (string.IsNullOrWhiteSpace(maskText))
-        {
-            return false;
-        }
-
-        var parts = maskText.Trim().Split('.');
-        if (parts.Length != 4)
-        {
-            return false;
-        }
-
-        uint mask = 0;
-        foreach (var part in parts)
-        {
-            if (!byte.TryParse(part, out var octet))
-            {
-                return false;
-            }
-
-            mask = (mask << 8) | octet;
-        }
-
-        var seenZero = false;
-        for (var i = 31; i >= 0; i--)
-        {
-            var bit = (mask & (1u << i)) != 0;
-            if (bit && seenZero)
-            {
-                return false;
-            }
-
-            if (bit)
-            {
-                prefix++;
-            }
-            else
-            {
-                seenZero = true;
-            }
-        }
-
-        return true;
-    }
-
-    private void ConfigInputChanged_OnChanged(object sender, TextChangedEventArgs e)
-    {
-        if (_suppressConfigChangeHandling)
-        {
-            return;
-        }
-
-        _configValidated = false;
-        ConfigValidationTextBlock.Text = "配置内容已变更,请重新点击“校验配置”。";
-        ApplyTaskStatusTextBlock.Text = "当前配置尚未通过校验。";
-        UpdateButtonStates();
-    }
-
     private void SetStatus(string message, bool addLog)
     private void SetStatus(string message, bool addLog)
     {
     {
         ApplyStatusMessageStyle(message);
         ApplyStatusMessageStyle(message);