Skip to content

Commit 860181d

Browse files
committed
Merge branch 'main' into refactor-options
2 parents d8faadd + 096d3a7 commit 860181d

File tree

14 files changed

+74
-24
lines changed

14 files changed

+74
-24
lines changed

src/BootstrapBlazor.Server/Components/Pages/Index.razor

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,20 @@
77
<section class="bd-masthead">
88
<div class="container-xxl bd-gutter">
99
<div class="col-md-8 mx-auto text-center">
10-
<a class="d-flex flex-column flex-lg-row justify-content-center align-items-center mb-4 text-dark lh-sm text-decoration-none" href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" rel="noopener" target="_blank">
11-
<span class="d-sm-inline-flex align-items-center gap-1 py-2 px-3 mb-lg-0 rounded-5 masthead-notice">
10+
<a class="d-inline-flex text-dark text-decoration-none" href="https://github.com/dotnetcore/BootstrapBlazor?wt.mc_id=DT-MVP-5004174" rel="noopener" target="_blank">
11+
<span class="py-2 px-3 rounded-5 masthead-notice">
1212
@Localizer["Support"]
1313
</span>
1414
</a>
15-
<img src="./favicon.png" alt="bootstrap-blazor" class="bb-logo d-none d-sm-block mx-auto my-5">
15+
<img src="./favicon.png" alt="bootstrap-blazor" class="bb-logo d-sm-block mx-auto my-5">
1616
<h1 class="mb-3 fw-semibold">@Localizer["Title"]</h1>
1717
<p class="lead mb-4">
1818
@Localizer["SubTitle"]
1919
</p>
20-
<div class="d-flex flex-column flex-lg-row align-items-md-stretch justify-content-md-center gap-3 mb-4">
21-
<a href="introduction/" class="btn btn-lg bd-btn-lg btn-bd-primary d-flex align-items-center justify-content-center fw-semibold">
22-
<i class="fa-solid fa-book-open"></i>
23-
<span class="ms-2">@Localizer["Docs"]</span>
24-
</a>
25-
</div>
20+
<a href="introduction" class="btn btn-lg bd-btn-lg btn-bd-primary mb-4 d-inline-flex align-items-center justify-content-center fw-semibold">
21+
<i class="fa-solid fa-book-open"></i>
22+
<span class="ms-2">@Localizer["Docs"]</span>
23+
</a>
2624
<p class="text-body-secondary mb-0">
2725
Currently <strong>@_versionString</strong>
2826
<span class="px-1">·</span>

src/BootstrapBlazor.Server/Components/Pages/Index.razor.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
--bd-pink-rgb: 214, 51, 132;
55
--bd-violet-rgb: 112.520718, 44.062154, 249.437846;
66
--bd-accent-rgb: 255, 228, 132;
7-
padding-top: calc(3rem + var(--bs-header-height));
7+
padding-top: 3rem;
88
background-image: linear-gradient(180deg, rgba(var(--bs-body-bg-rgb), 0.01), rgba(var(--bs-body-bg-rgb), 1) 85%), radial-gradient(ellipse at top left, rgba(var(--bs-primary-rgb), 0.5), transparent 50%), radial-gradient(ellipse at top right, rgba(var(--bd-accent-rgb), 0.5), transparent 50%), radial-gradient(ellipse at center right, rgba(var(--bd-violet-rgb), 0.5), transparent 50%), radial-gradient(ellipse at center left, rgba(var(--bd-pink-rgb), 0.5), transparent 50%);
99
margin-top: calc(0px - var(--bs-header-height));
1010
}
@@ -88,10 +88,14 @@
8888
}
8989

9090
@media (min-width: 768px) {
91-
.bd-masthead .lead {
92-
font-size: calc(1.275rem + .3vw);
91+
.bd-masthead {
92+
padding-top: calc(3rem + var(--bs-header-height));
9393
}
9494

95+
.bd-masthead .lead {
96+
font-size: calc(1.275rem + .3vw);
97+
}
98+
9599
.welcome-header {
96100
margin-top: 0;
97101
margin-bottom: 0;

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ private async Task GetFingerCodeAsync()
1212
}</Pre>
1313
<BootstrapInputGroup>
1414
<BootstrapInputGroupLabel DisplayText="Browser-Finger"></BootstrapInputGroupLabel>
15-
<BootstrapInput @bind-Value="@_code" />
15+
<BootstrapInput Value="@_code" Readonly="true" />
16+
</BootstrapInputGroup>
17+
18+
<BootstrapInputGroup class="mt-3">
19+
<BootstrapInputGroupLabel DisplayText="ClientHubId"></BootstrapInputGroupLabel>
20+
<BootstrapInput Value="@_clientHubId" Readonly="true" />
1621
</BootstrapInputGroup>
1722
</DemoBlock>
1823

src/BootstrapBlazor.Server/Components/Samples/BrowserFingers.razor.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public partial class BrowserFingers
1515
private IBrowserFingerService? BrowserFingerService { get; set; }
1616

1717
private string? _code;
18+
private string? _clientHubId;
1819

1920
/// <summary>
2021
/// <inheritdoc/>
@@ -25,10 +26,13 @@ protected override async Task OnInitializedAsync()
2526
await base.OnInitializedAsync();
2627

2728
_code = await GetFingerCodeAsync();
29+
_clientHubId = await GetClientHubIdAsync();
2830
}
2931

3032
private Task<string?> GetFingerCodeAsync() => BrowserFingerService.GetFingerCodeAsync();
3133

34+
private Task<string?> GetClientHubIdAsync() => BrowserFingerService.GetClientHubIdAsync();
35+
3236
private MethodItem[] GetMethods() =>
3337
[
3438
new()
@@ -37,6 +41,13 @@ private MethodItem[] GetMethods() =>
3741
Description = Localizer["GetFingerCodeAsync"],
3842
Parameters = " — ",
3943
ReturnValue = "Task<string?>"
44+
},
45+
new()
46+
{
47+
Name = "GetClientHubIdAsync",
48+
Description = Localizer["GetClientHubIdAsync"],
49+
Parameters = " — ",
50+
ReturnValue = "Task<string?>"
4051
}
4152
];
4253
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,12 @@
1111
text-align: center;
1212
}
1313
14+
@@media(max-width: 768px) {
1415
.otp-input-demo .bb-otp-input {
1516
--bb-otp-item-width: 32px;
1617
--bb-otp-font-size: 1.2em;
1718
}
19+
}
1820
</style>
1921
</HeadContent>
2022

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6687,7 +6687,8 @@
66876687
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66886688
"BrowserFingerTitle": "Browser fingerprint",
66896689
"BrowserFingerIntro": "Obtain the client browser fingerprint by calling the <code>IBrowserFingerService</code> service instance method <code>GetFingerCodeAsync</code>. The fingerprint is consistent in privacy mode",
6690-
"GetFingerCodeAsync": "Method for obtaining fingerprints"
6690+
"GetFingerCodeAsync": "Method for obtaining fingerprints",
6691+
"GetClientHubIdAsync": "Method for obtaining client hub Id"
66916692
},
66926693
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66936694
"SvgEditorTitle": "SvgEditor",

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6687,7 +6687,8 @@
66876687
"BootstrapBlazor.Server.Components.Samples.BrowserFingers": {
66886688
"BrowserFingerTitle": "浏览器指纹",
66896689
"BrowserFingerIntro": "通过调用 <code>IBrowserFingerService</code> 服务实例方法 <code>GetFingerCodeAsync</code> 获得客户端浏览器指纹,隐私模式下指纹是一致的",
6690-
"GetFingerCodeAsync": "获得指纹方法"
6690+
"GetFingerCodeAsync": "获得指纹方法",
6691+
"GetClientHubIdAsync": "获得客户端连接 Id 方法"
66916692
},
66926693
"BootstrapBlazor.Server.Components.Samples.SvgEditors": {
66936694
"SvgEditorTitle": "Svg 编辑器",

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.9.1-beta05</Version>
4+
<Version>9.9.1-beta06</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Services/DefaultBrowserFingerService.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ class DefaultBrowserFingerService(IJSRuntime jSRuntime) : IBrowserFingerService
1313
[NotNull]
1414
private JSModule? _module = null;
1515

16-
/// <summary>
17-
/// 获取剪切板数据方法
18-
/// </summary>
1916
public async Task<string?> GetFingerCodeAsync(CancellationToken token = default)
2017
{
2118
_module ??= await jSRuntime.LoadUtility();
2219
return await _module.InvokeAsync<string?>("getFingerCode", token);
2320
}
21+
22+
public async Task<string?> GetClientHubIdAsync(CancellationToken token = default)
23+
{
24+
_module ??= await jSRuntime.LoadUtility();
25+
return await _module.InvokeAsync<string?>("getClientHubId", token);
26+
}
2427
}

src/BootstrapBlazor/Services/IBrowserFingerService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,11 @@ public interface IBrowserFingerService
1515
/// </summary>
1616
/// <returns></returns>
1717
Task<string?> GetFingerCodeAsync(CancellationToken token = default);
18+
19+
/// <summary>
20+
/// 获得当前连接的客户端 ID 由 BootstrapBlazor 组件框架提供
21+
/// </summary>
22+
/// <param name="token"></param>
23+
/// <returns></returns>
24+
Task<string?> GetClientHubIdAsync(CancellationToken token = default);
1825
}

0 commit comments

Comments
 (0)