Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(IP2Region): add IP2Region package #5402

Merged
merged 10 commits into from
Feb 20, 2025
5 changes: 3 additions & 2 deletions src/BootstrapBlazor.Server/BootstrapBlazor.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<IsWebProject>true</IsWebProject>
Expand Down Expand Up @@ -31,7 +31,7 @@
<PackageReference Include="BootstrapBlazor.Chart" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.CherryMarkdown" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.Dock" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.DockView" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.DockView" Version="9.1.1" />
<PackageReference Include="BootstrapBlazor.DriverJs" Version="9.0.3" />
<PackageReference Include="BootstrapBlazor.ElementIcon" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.FileViewer" Version="9.0.0" />
Expand All @@ -41,6 +41,7 @@
<PackageReference Include="BootstrapBlazor.Html2Pdf" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.IconPark" Version="9.0.2" />
<PackageReference Include="BootstrapBlazor.ImageCropper" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.IP2Region" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Live2DDisplay" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.Markdown" Version="9.0.1" />
<PackageReference Include="BootstrapBlazor.MaterialDesign" Version="9.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ protected override void OnInitialized()
{
base.OnInitialized();

_providers = IpLocatorProviders.Select(provider => new SelectedItem
_providers = [.. IpLocatorProviders.Select(provider => new SelectedItem
{
Text = provider.GetType().Name,
Value = provider.GetType().Name
}).ToList();
})];
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ public static IServiceCollection AddBootstrapBlazorServices(this IServiceCollect
// 增加 Table Excel 导出服务
services.AddBootstrapBlazorTableExportService();

// 增加离线 IP 定位服务
services.AddBootstrapBlazorIP2RegionfService();

// 增加 PetaPoco ORM 数据服务操作类
// 需要时打开下面代码
//services.AddPetaPoco(option =>
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -4142,7 +4142,7 @@
"LocatorsNormalInputText": "IpAddress",
"LocatorsNormalDisplayText": "Geographical location",
"LocatorsNormalButtonText": "Locating",
"LocatorsProviderDesc": "The component library has two built-in geolocation locators: <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code>"
"LocatorsProviderDesc": "<p>The component library has two built-in free online geolocation locators, <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code><p><p>The component library has a built-in paid online geolocation locator <code>JuHeIpLocatorProvider</code> <a href=\"https://juhe.cn\" target=\"_blank\">Official website address</a></p><p>The component library has a built-in free offline geolocation locator <code>BootstrapBlazor.IP2Region</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.IP2Region\" target=\"_blank\">Nuget package</a></p>"
},
"BootstrapBlazor.Server.Components.Samples.Print": {
"PrintsTitle": "Print",
Expand Down
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -4142,7 +4142,7 @@
"LocatorsNormalInputText": "Ip 地址",
"LocatorsNormalDisplayText": "地理位置",
"LocatorsNormalButtonText": "定位",
"LocatorsProviderDesc": "组件库内置两个地理位置定位器分别为 <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code>"
"LocatorsProviderDesc": "<p>组件库内置两个免费在线地理位置定位器分别为 <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code><p><p>组件库内置一个收费在线地理位置定位器 <code>JuHeIpLocatorProvider</code> <a href=\"https://juhe.cn\" target=\"_blank\">官网地址</a></p><p>组件库内置一个免费离线地理位置定位器 <code>BootstrapBlazor.IP2Region</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.IP2Region\" target=\"_blank\">Nuget 包</a></p>"
},
"BootstrapBlazor.Server.Components.Samples.Print": {
"PrintsTitle": "Print 打印按钮",
Expand Down
1 change: 0 additions & 1 deletion src/BootstrapBlazor.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone

using BootstrapBlazor.Server.Components;
using BootstrapBlazor.Server.Components.Layout;
using Microsoft.AspNetCore.HttpOverrides;
using Microsoft.Extensions.Options;
using System.Text;
Expand Down