| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389 |
- <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="*" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
- <Grid Grid.Row="0" Margin="24,24,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>
- <Border Grid.Row="2" Margin="0,24,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="1"
- x:Name="RemoteDetailsBorder"
- 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>
- </Border>
- </Grid>
- </Window>
|