Skip to content

Commit 16057df

Browse files
authored
Feature: IP Geolocation app (#2522)
* Feature: IP Geolocation app * Chore: Rename to widgets / cleanup * Feature: IP Geolocation view * Chore: Refactoring based on Rider suggestions * Chore: Refactoring based on Rider suggestions * Chore: Refactoring based on Rider suggestions * Chore: Renaming some headers & refactoring * Feature: IP Geolocation * Feature: IP Geolocation profile * Feature: IP Geolocation & Refactoring
1 parent 82f12a6 commit 16057df

File tree

239 files changed

+6027
-2766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

239 files changed

+6027
-2766
lines changed

Source/GlobalAssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
[assembly: AssemblyTrademark("")]
77
[assembly: AssemblyCulture("")]
88

9-
[assembly: AssemblyVersion("2023.9.21.0")]
10-
[assembly: AssemblyFileVersion("2023.9.21.0")]
9+
[assembly: AssemblyVersion("2023.10.22.0")]
10+
[assembly: AssemblyFileVersion("2023.10.22.0")]

Source/NETworkManager.Documentation/DocumentationIdentifier.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public enum DocumentationIdentifier
105105
/// </summary>
106106
ApplicationWhois,
107107

108+
/// <summary>
109+
/// IP geolocation documentation page.
110+
/// </summary>
111+
ApplicationIPGeolocation,
112+
108113
/// <summary>
109114
/// Subnet Calculator documentation page.
110115
/// </summary>

Source/NETworkManager.Documentation/DocumentationManager.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public static class DocumentationManager
4141
new DocumentationInfo(DocumentationIdentifier.ApplicationDiscoveryProtocol, @"Documentation/Application/DiscoveryProtocol"),
4242
new DocumentationInfo(DocumentationIdentifier.ApplicationWakeOnLan, @"Documentation/Application/WakeOnLAN"),
4343
new DocumentationInfo(DocumentationIdentifier.ApplicationWhois, @"Documentation/Application/Whois"),
44+
new DocumentationInfo(DocumentationIdentifier.ApplicationIPGeolocation, @"Documentation/Application/IPGeolocation"),
4445
new DocumentationInfo(DocumentationIdentifier.ApplicationSubnetCalculator, @"Documentation/Application/SubnetCalculator"),
4546
new DocumentationInfo(DocumentationIdentifier.ApplicationBitCalculator, @"Documentation/Application/BitCalculator"),
4647
new DocumentationInfo(DocumentationIdentifier.ApplicationLookup, @"Documentation/Application/Lookup"),
@@ -131,6 +132,7 @@ public static DocumentationIdentifier GetIdentifierByApplicationName(Application
131132
ApplicationName.DiscoveryProtocol => DocumentationIdentifier.ApplicationDiscoveryProtocol,
132133
ApplicationName.WakeOnLAN => DocumentationIdentifier.ApplicationWakeOnLan,
133134
ApplicationName.Whois => DocumentationIdentifier.ApplicationWhois,
135+
ApplicationName.IPGeolocation => DocumentationIdentifier.ApplicationIPGeolocation,
134136
ApplicationName.SubnetCalculator => DocumentationIdentifier.ApplicationSubnetCalculator,
135137
ApplicationName.BitCalculator => DocumentationIdentifier.ApplicationBitCalculator,
136138
ApplicationName.Lookup => DocumentationIdentifier.ApplicationLookup,
@@ -176,7 +178,6 @@ public static DocumentationIdentifier GetIdentifierBySettingsName(SettingsName n
176178
SettingsName.SNMP => GetIdentifierByApplicationName(ApplicationName.SNMP),
177179
SettingsName.SNTPLookup => GetIdentifierByApplicationName(ApplicationName.SNTPLookup),
178180
SettingsName.WakeOnLAN => GetIdentifierByApplicationName(ApplicationName.WakeOnLAN),
179-
//SettingsName.Whois => GetIdentifierByApplicationName(ApplicationName.Whois),
180181
SettingsName.BitCalculator => GetIdentifierByApplicationName(ApplicationName.BitCalculator),
181182
_ => DocumentationIdentifier.Default,
182183
};

Source/NETworkManager.Localization/Resources/StaticStrings.Designer.cs

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

Source/NETworkManager.Localization/Resources/StaticStrings.resx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@
321321
<data name="ExamplePuTTYProfile" xml:space="preserve">
322322
<value>NETworkManager</value>
323323
</data>
324-
<data name="ExampleHostFQDN" xml:space="preserve">
324+
<data name="ExampleFqdn" xml:space="preserve">
325325
<value>server-01.borntoberoot.net</value>
326326
</data>
327327
<data name="ExampleGatewayDomain" xml:space="preserve">
@@ -348,4 +348,7 @@
348348
<data name="ExampleSNMPPrivSecret" xml:space="preserve">
349349
<value>Pr1v_S3cr3t%</value>
350350
</data>
351+
<data name="ExampleFqdnOrIPAddressPublic" xml:space="preserve">
352+
<value>borntoberoot.net or 1.1.1.1</value>
353+
</data>
351354
</root>

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

Lines changed: 18 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3676,4 +3676,10 @@ Try again in a few seconds.</value>
36763676
<data name="Watermark_RunCommand" xml:space="preserve">
36773677
<value>Run command... (Ctrl+Shift+P)</value>
36783678
</data>
3679+
<data name="ApplicationName_IPGeolocation" xml:space="preserve">
3680+
<value>IP Geolocation</value>
3681+
</data>
3682+
<data name="AddATabToQueryIPGeolocation" xml:space="preserve">
3683+
<value>Add a tab to query IP geolocation...</value>
3684+
</data>
36793685
</root>

Source/NETworkManager.Models/ApplicationManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public static Canvas GetIcon(ApplicationName name)
9494
case ApplicationName.Whois:
9595
canvas.Children.Add(new PackIconMaterial { Kind = PackIconMaterialKind.CloudSearchOutline });
9696
break;
97+
case ApplicationName.IPGeolocation:
98+
canvas.Children.Add(new PackIconMaterial { Kind = PackIconMaterialKind.MapSearchOutline });
99+
break;
97100
case ApplicationName.SubnetCalculator:
98101
canvas.Children.Add(new PackIconModern { Kind = PackIconModernKind.Calculator });
99102
break;

Source/NETworkManager.Models/ApplicationName.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public enum ApplicationName
105105
/// </summary>
106106
Whois,
107107

108+
/// <summary>
109+
/// IP geolocation application.
110+
/// </summary>
111+
IPGeolocation,
112+
108113
/// <summary>
109114
/// Subnet calculator application.
110115
/// </summary>

Source/NETworkManager.Models/IPApi/IPGeolocationService.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,15 @@ public class IPGeolocationService : SingletonBase<IPGeolocationService>
5151
/// <summary>
5252
/// Gets the IP geolocation details from the API asynchronously.
5353
/// </summary>
54+
/// <param name="ipAddressOrFqdn">IP address or FQDN to get the geolocation information's from.</param>
5455
/// <returns>IP geolocation information's as <see cref="IPGeolocationResult"/>.</returns>
55-
public async Task<IPGeolocationResult> GetIPGeolocationAsync(string ipAddress = "")
56+
public async Task<IPGeolocationResult> GetIPGeolocationAsync(string ipAddressOrFqdn = "")
5657
{
5758
if (IsInRateLimit())
5859
return new IPGeolocationResult(isRateLimitReached: true, _rateLimitRemainingTime);
5960

6061
// If the url is empty, the current IP address from which the request is made is used.
61-
var url = $"{BaseUrl}/{ipAddress}?fields={Fields}";
62+
var url = $"{BaseUrl}/{ipAddressOrFqdn}?fields={Fields}";
6263

6364
try
6465
{

0 commit comments

Comments
 (0)