Skip to content

Commit d5cd54c

Browse files
authored
doc(IpLocator): add WebClientOptions usage documentation (#6208)
1 parent f94e3c0 commit d5cd54c

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/BootstrapBlazor.Server/Components/Samples/Locators.razor

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ private IIpLocatorFactory? IpLocatorFactory { get; set; }
3535
<DemoBlock Title="@Localizer["LocatorsNormalTitle"]" Introduction="@Localizer["LocatorsNormalIntro"]" Name="Normal">
3636
<section ignore>
3737
@((MarkupString)Localizer["LocatorsProviderDesc"].Value)
38+
<Tips>
39+
<p>@((MarkupString)Localizer["LocatorsProviderOptions"].Value)</p>
40+
</Tips>
41+
<Pre>{
42+
"BootstrapBlazorOptions": {
43+
"WebClientOptions": {
44+
"EnableIpLocator": true
45+
}
46+
}
47+
}</Pre>
48+
<Pre>services.AddBootstrapBlazor(op =>
49+
{
50+
op.WebClientOptions.EnableIpLocator = true;
51+
});</Pre>
52+
<Pre>services.Configure&lt;BootstrapBlazorOptions&gt;(op =>
53+
{
54+
op.WebClientOptions.EnableIpLocator = true;
55+
});</Pre>
3856
</section>
3957
<div class="row g-3 form-inline">
4058
<div class="col-12 col-sm-6">

src/BootstrapBlazor.Server/Locales/en-US.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4223,7 +4223,8 @@
42234223
"LocatorsNormalInputText": "IpAddress",
42244224
"LocatorsNormalDisplayText": "Geographical location",
42254225
"LocatorsNormalButtonText": "Locating",
4226-
"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>BootstrapBlazor.JuHeIpLocatorProvider</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.JuHeIpLocatorProvider\" target=\"_blank\">Nuget package</a> <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>"
4226+
"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>BootstrapBlazor.JuHeIpLocatorProvider</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.JuHeIpLocatorProvider\" target=\"_blank\">Nuget package</a> <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>",
4227+
"LocatorsProviderOptions": "<code>BootstrapBlazorOptions</code> section <code>WebClientOptions</code> By default it is <code>false</code>, which means the IP address location function is not enabled. Please change it to <code>true</code> in the configuration file or code."
42274228
},
42284229
"BootstrapBlazor.Server.Components.Samples.Print": {
42294230
"PrintsTitle": "Print",

src/BootstrapBlazor.Server/Locales/zh-CN.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4223,7 +4223,8 @@
42234223
"LocatorsNormalInputText": "Ip 地址",
42244224
"LocatorsNormalDisplayText": "地理位置",
42254225
"LocatorsNormalButtonText": "定位",
4226-
"LocatorsProviderDesc": "<p>组件库内置两个免费在线地理位置定位器分别为 <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code><p><p>组件库内置一个收费在线地理位置定位器 <code>BootstrapBlazor.JuHeIpLocatorProvider</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.JuHeIpLocatorProvider\" target=\"_blank\">Nuget 包</a> <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>"
4226+
"LocatorsProviderDesc": "<p>组件库内置两个免费在线地理位置定位器分别为 <code>BaiduIpLocatorProvider</code> <code>BaiduIpLocatorProviderV2</code><p><p>组件库内置一个收费在线地理位置定位器 <code>BootstrapBlazor.JuHeIpLocatorProvider</code> <a href=\"https://www.nuget.org/packages/BootstrapBlazor.JuHeIpLocatorProvider\" target=\"_blank\">Nuget 包</a> <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>",
4227+
"LocatorsProviderOptions": "全局配置定位器选项 <code>WebClientOptions</code> 默认 <code>false</code> 没有启用 IP 地址定位功能,请在配置文件中或者代码中更改为 <code>true</code>"
42274228
},
42284229
"BootstrapBlazor.Server.Components.Samples.Print": {
42294230
"PrintsTitle": "Print 打印按钮",

0 commit comments

Comments
 (0)