| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- <Window x:Class="QuickIP.Client.MainWindow"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d"
- Title="QuickIP"
- Height="680"
- Width="980"
- MinHeight="640"
- MinWidth="920"
- WindowStartupLocation="CenterScreen">
- <Grid Background="#F5F7FB">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Border Grid.Row="0"
- Margin="24,24,24,16"
- Padding="24"
- Background="White"
- CornerRadius="12">
- <StackPanel>
- <TextBlock FontSize="28"
- FontWeight="SemiBold"
- Foreground="#111827"
- Text="QuickIP 连接页" />
- <TextBlock Margin="0,8,0,0"
- FontSize="14"
- Foreground="#4B5563"
- Text="先选择本机有线网卡,客户端会优先尝试直连管理口;只有直连失败时,才需要切换到维护网络。" />
- </StackPanel>
- </Border>
- <Grid Grid.Row="1" Margin="24,0,24,16">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2.2*" />
- <ColumnDefinition Width="1.4*" />
- </Grid.ColumnDefinitions>
- <Border Grid.Column="0"
- Margin="0,0,16,0"
- Padding="24"
- Background="White"
- CornerRadius="12">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <TextBlock FontSize="20"
- FontWeight="SemiBold"
- Foreground="#111827"
- Text="本机网卡与连接" />
- <StackPanel Grid.Row="1" Margin="0,20,0,0">
- <TextBlock FontSize="13"
- Foreground="#374151"
- Text="本机有线网卡" />
- <ComboBox x:Name="AdapterComboBox"
- Margin="0,8,0,0"
- MinHeight="36"
- DisplayMemberPath="DisplayName"
- SelectionChanged="AdapterComboBox_OnSelectionChanged" />
- <Border Margin="0,12,0,0" Padding="12" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#6B7280" Text="建议选择" />
- <TextBlock x:Name="RecommendedAdapterTextBlock"
- Margin="0,8,0,0"
- FontSize="14"
- FontWeight="SemiBold"
- Foreground="#111827"
- Text="-" />
- <TextBlock x:Name="RecommendedReasonTextBlock"
- Margin="0,8,0,0"
- FontSize="12"
- Foreground="#4B5563"
- Text="-" />
- <TextBlock x:Name="ProbeReasonTextBlock"
- Margin="0,8,0,0"
- FontSize="12"
- Foreground="#4B5563"
- Text="尚未对 169.254.100.2 进行可达性探测。" />
- </StackPanel>
- </Border>
- </StackPanel>
- <UniformGrid Grid.Row="2" Margin="0,24,0,0" Columns="2">
- <Border Margin="0,0,12,12" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#6B7280" Text="网卡名称 / 级别" />
- <TextBlock x:Name="AdapterNameTextBlock" Margin="0,8,0,0" FontSize="16" FontWeight="SemiBold" Foreground="#111827" Text="-" />
- </StackPanel>
- </Border>
- <Border Margin="0,0,0,12" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#6B7280" Text="链路状态" />
- <TextBlock x:Name="AdapterLinkTextBlock" Margin="0,8,0,0" FontSize="16" FontWeight="SemiBold" Foreground="#111827" Text="-" />
- </StackPanel>
- </Border>
- <Border Margin="0,0,12,0" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#6B7280" Text="当前 IPv4" />
- <TextBlock x:Name="AdapterIPv4TextBlock" Margin="0,8,0,0" FontSize="16" FontWeight="SemiBold" Foreground="#111827" Text="-" />
- </StackPanel>
- </Border>
- <Border Margin="0,0,0,0" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#6B7280" Text="网卡类型" />
- <TextBlock x:Name="AdapterTypeTextBlock" Margin="0,8,0,0" FontSize="16" FontWeight="SemiBold" Foreground="#111827" Text="-" />
- </StackPanel>
- </Border>
- </UniformGrid>
- <Border Grid.Row="2" Margin="0,156,0,0" Padding="16" Background="#ECFDF5" CornerRadius="10" VerticalAlignment="Top">
- <StackPanel>
- <TextBlock FontSize="12" Foreground="#065F46" Text="管理口探测结果" />
- <TextBlock x:Name="AdapterProbeTextBlock"
- Margin="0,8,0,0"
- FontSize="16"
- FontWeight="SemiBold"
- Foreground="#065F46"
- Text="-" />
- </StackPanel>
- </Border>
- <Border Grid.Row="3" Margin="0,24,0,0" Padding="16" Background="#EEF2FF" CornerRadius="10">
- <StackPanel>
- <TextBlock x:Name="StatusTextBlock"
- FontSize="13"
- Foreground="#3730A3"
- TextWrapping="Wrap"
- Text="请选择一块有线网卡。" />
- <TextBlock x:Name="DiscoveredDeviceTextBlock"
- Margin="0,10,0,0"
- FontSize="12"
- Foreground="#4B5563"
- TextWrapping="Wrap"
- Text="尚未发现设备。" />
- </StackPanel>
- </Border>
- </Grid>
- </Border>
- <Border Grid.Column="1"
- Padding="24"
- Background="White"
- CornerRadius="12">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <TextBlock FontSize="20"
- FontWeight="SemiBold"
- Foreground="#111827"
- Text="操作" />
- <Border Grid.Row="1" Margin="0,20,0,0" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="13"
- FontWeight="SemiBold"
- Foreground="#111827"
- Text="管理密码(必填)" />
- <TextBlock Margin="0,6,0,0"
- FontSize="12"
- Foreground="#6B7280"
- Text="用于连接 Linux Agent。客户端不会在界面上显示默认密码。" />
- <Grid Margin="0,10,0,0">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <PasswordBox x:Name="PasswordBox"
- MinHeight="38"
- VerticalContentAlignment="Center"
- PasswordChanged="PasswordBox_OnPasswordChanged"
- ToolTip="请输入当前 Agent 使用的管理密码。" />
- <TextBox x:Name="PasswordTextBox"
- Visibility="Collapsed"
- MinHeight="38"
- VerticalContentAlignment="Center"
- TextChanged="PasswordTextBox_OnTextChanged"
- ToolTip="请输入当前 Agent 使用的管理密码。" />
- <Button x:Name="TogglePasswordVisibilityButton"
- Grid.Column="1"
- Margin="8,0,0,0"
- MinWidth="42"
- Padding="10,0"
- Click="TogglePasswordVisibilityButton_OnClick"
- Content="👁" />
- </Grid>
- <TextBlock Margin="0,10,0,0"
- FontSize="12"
- Foreground="#6B7280"
- Text="客户端会自动保存并回填你上次输入的密码。" />
- </StackPanel>
- </Border>
- <Button x:Name="SwitchMaintenanceButton"
- Grid.Row="2"
- Margin="0,16,0,0"
- MinHeight="42"
- Click="SwitchMaintenanceButton_OnClick"
- Content="切换到维护网络" />
- <Button x:Name="DiscoverConnectButton"
- Grid.Row="3"
- Margin="0,12,0,0"
- MinHeight="42"
- Click="DiscoverConnectButton_OnClick"
- Content="发现并连接" />
- <Border Grid.Row="4" Margin="0,16,0,0" Padding="12" Background="#FEF3C7" CornerRadius="10">
- <TextBlock x:Name="AdminStateTextBlock"
- FontSize="12"
- Foreground="#92400E"
- TextWrapping="Wrap"
- Text="管理员状态:未知" />
- </Border>
- <Border Grid.Row="5" Margin="0,16,0,0" Padding="16" Background="#F9FAFB" CornerRadius="10">
- <StackPanel>
- <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="当前执行顺序" />
- <TextBlock Margin="0,12,0,0" Foreground="#4B5563" Text="1. 选择本机有线网卡" />
- <TextBlock Margin="0,8,0,0" Foreground="#4B5563" Text="2. 先尝试直接访问 169.254.100.2" />
- <TextBlock Margin="0,8,0,0" Foreground="#4B5563" Text="3. 如果直连失败,再切换到维护网络" />
- <TextBlock Margin="0,8,0,0" Foreground="#4B5563" Text="4. 自动带出或输入密码并验证连接" />
- </StackPanel>
- </Border>
- <Border Grid.Row="6" Margin="0,16,0,0" Padding="16" Background="#F3F4F6" CornerRadius="10">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <TextBlock FontSize="13" FontWeight="SemiBold" Foreground="#111827" Text="运行日志" />
- <ListBox x:Name="EventLogListBox"
- Grid.Row="1"
- Margin="0,12,0,0"
- MinHeight="180" />
- </Grid>
- </Border>
- </Grid>
- </Border>
- </Grid>
- <Border Grid.Row="2"
- Margin="24,0,24,24"
- Padding="16"
- Background="White"
- CornerRadius="12">
- <TextBlock Foreground="#6B7280"
- Text="当前版本已支持推荐网卡、本机密码保存、切换到维护网络、UDP 发现和最小 HTTP 连接验证。点击按钮后会在右侧日志里显示详细步骤。" />
- </Border>
- </Grid>
- </Window>
|