Skip to content

Commit 5d57abc

Browse files
BornToBeRootclaude
andcommitted
Feature: Show "Open in Whois" in the center of the RDAP view
If no RDAP server is known for a domain, the error stays in the status line and the center of the view (instead of the "Enter a domain..." placeholder) shows a hint and an "Open in Whois" button, like the WebView2 hint in Web Console. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 949d9be commit 5d57abc

3 files changed

Lines changed: 59 additions & 19 deletions

File tree

‎Source/NETworkManager.Localization/Resources/Strings.Designer.cs‎

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Source/NETworkManager.Localization/Resources/Strings.resx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,4 +4700,7 @@ Cloudflare may log your IP address and network information. See Cloudflare's pri
47004700
<data name="RDAPReferralPrivateAddressX" xml:space="preserve">
47014701
<value>The referral to the RDAP server of the registrar was not followed, because it points to a local or private address: {0}</value>
47024702
</data>
4703+
<data name="DomainCannotBeQueriedViaRDAPTryWhois" xml:space="preserve">
4704+
<value>This domain cannot be queried via RDAP. Try Whois instead.</value>
4705+
</data>
47034706
</root>

‎Source/NETworkManager/Views/RDAPView.xaml‎

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -296,22 +296,10 @@
296296
</Style>
297297
</mahAppsControls:MetroProgressBar.Style>
298298
</mahAppsControls:MetroProgressBar>
299-
<Grid Grid.Row="2" Margin="0,10,0,0"
300-
Visibility="{Binding IsStatusMessageDisplayed, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
301-
<Grid.ColumnDefinitions>
302-
<ColumnDefinition Width="*" />
303-
<ColumnDefinition Width="Auto" />
304-
</Grid.ColumnDefinitions>
305-
<TextBlock Grid.Column="0" Foreground="{DynamicResource MahApps.Brushes.Accent}"
306-
Text="{Binding StatusMessage}"
307-
Style="{DynamicResource StatusMessageTextBlock}"
308-
VerticalAlignment="Center" />
309-
<Button Grid.Column="1" Margin="10,0,0,0"
310-
Command="{Binding OpenInWhoisCommand}"
311-
Content="{x:Static localization:Strings.OpenInWhois}"
312-
Style="{StaticResource DefaultButton}"
313-
Visibility="{Binding IsOpenInWhoisVisible, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}" />
314-
</Grid>
299+
<TextBlock Grid.Row="2" Foreground="{DynamicResource MahApps.Brushes.Accent}"
300+
Text="{Binding StatusMessage}"
301+
Visibility="{Binding IsStatusMessageDisplayed, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}"
302+
Style="{DynamicResource StatusMessageTextBlock}" Margin="0,10,0,0" />
315303
</Grid>
316304
<Grid Grid.Row="2"
317305
Visibility="{Binding IsResultVisible, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
@@ -382,12 +370,52 @@
382370
<TextBlock Grid.Row="2"
383371
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
384372
Text="{x:Static localization:Strings.EnterAQueryToQueryRDAPDots}"
385-
Visibility="{Binding IsResultVisible, Converter={StaticResource BooleanReverseToVisibilityCollapsedConverter}}"
386-
Style="{StaticResource HeaderTextBlock}"
387373
VerticalAlignment="Center"
388374
HorizontalAlignment="Center"
389375
TextWrapping="Wrap"
390376
TextAlignment="Center"
391-
Margin="10" />
377+
Margin="10">
378+
<TextBlock.Style>
379+
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource HeaderTextBlock}">
380+
<Style.Triggers>
381+
<DataTrigger Binding="{Binding IsResultVisible}" Value="True">
382+
<Setter Property="Visibility" Value="Collapsed" />
383+
</DataTrigger>
384+
<DataTrigger Binding="{Binding IsOpenInWhoisVisible}" Value="True">
385+
<Setter Property="Visibility" Value="Collapsed" />
386+
</DataTrigger>
387+
</Style.Triggers>
388+
</Style>
389+
</TextBlock.Style>
390+
</TextBlock>
391+
<!-- No RDAP server known for the domain: offer to query it with Whois -->
392+
<StackPanel Grid.Row="2" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="10"
393+
Visibility="{Binding IsOpenInWhoisVisible, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
394+
<TextBlock Foreground="{DynamicResource MahApps.Brushes.Gray3}"
395+
Text="{x:Static localization:Strings.DomainCannotBeQueriedViaRDAPTryWhois}"
396+
Style="{StaticResource HeaderTextBlock}"
397+
HorizontalAlignment="Center"
398+
TextWrapping="Wrap"
399+
TextAlignment="Center" />
400+
<Button Command="{Binding OpenInWhoisCommand}"
401+
Style="{StaticResource ImageWithTextButton}"
402+
HorizontalAlignment="Center">
403+
<Button.Content>
404+
<Grid>
405+
<Grid.ColumnDefinitions>
406+
<ColumnDefinition Width="Auto" />
407+
<ColumnDefinition Width="*" />
408+
</Grid.ColumnDefinitions>
409+
<Rectangle Style="{StaticResource ButtonWithImageRectangle}">
410+
<Rectangle.OpacityMask>
411+
<VisualBrush Stretch="Uniform" Visual="{iconPacks:Material Kind=CloudSearchOutline}" />
412+
</Rectangle.OpacityMask>
413+
</Rectangle>
414+
<TextBlock Grid.Column="1" Text="{x:Static localization:Strings.OpenInWhois}"
415+
Style="{StaticResource ButtonWithImageTextBlock}" />
416+
</Grid>
417+
</Button.Content>
418+
</Button>
419+
</StackPanel>
392420
</Grid>
393421
</UserControl>

0 commit comments

Comments
 (0)