Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IOptions<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<Reconnector>
<ReconnectingTemplate>
Expand Down Expand Up @@ -67,7 +67,7 @@
<div class="d-flex">
<div class="flex-fill">
<p>一套基于 <b>Bootstrap</b> 样式的企业级 <b>Blazor UI</b> 组件库,支持 Server 与 WebAssembly</p>
<p>适配移动端支持各种主流浏览器以及移动端,适配 <b>ABP</b>,同时支持 <b>NET6/NET7/NET8/NET9/NET10</b></p>
<p>适配移动端支持各种主流浏览器以及移动端,适配 <b>ABP</b>,同时支持 <b>@WebsiteOption.Value.GetTargets()</b></p>
<p></p>
<div>已提供项目模板方便快速上手 <a class="connection-link" href="@TemplateUrl" target="_blank">项目模板</a></div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/BootstrapBlazor.Server/Components/Pages/Index.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@layout HomeLayout
@layout HomeLayout
@page "/"
@page "/index"
@page "/home"
Expand All @@ -7,9 +7,9 @@
<section class="bd-masthead">
<div class="container-xxl bd-gutter">
<div class="text-center d-flex align-items-center flex-column">
<a class="d-inline-flex text-dark text-decoration-none" href="@WebsiteOption.Value.GithubRepositoryUrl" rel="noopener" target="_blank">
<a class="d-inline-flex text-dark text-decoration-none" href="@WebsiteOption.Value.GithubRepositoryUrl" target="_blank">
Copy link

Copilot AI Nov 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rel="noopener" attribute should not be removed when using target="_blank". This attribute prevents the opened page from accessing the window.opener object, which is a security best practice to prevent potential tabnabbing attacks.

Suggested change
<a class="d-inline-flex text-dark text-decoration-none" href="@WebsiteOption.Value.GithubRepositoryUrl" target="_blank">
<a class="d-inline-flex text-dark text-decoration-none" href="@WebsiteOption.Value.GithubRepositoryUrl" target="_blank" rel="noopener">

Copilot uses AI. Check for mistakes.
<span class="py-2 px-3 rounded-5 masthead-notice">
@Localizer["Support"]
@Localizer["Support"] @WebsiteOption.Value.GetTargets()
</span>
</a>
<div class="bb-logo d-sm-block mx-auto my-5">
Expand Down
14 changes: 7 additions & 7 deletions src/BootstrapBlazor.Server/Components/Samples/Reconnectors.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@page "/reconnector"
@page "/reconnector"
@inject IStringLocalizer<Reconnectors> Localizer
@inject IOptions<WebsiteOptions> WebsiteOption

Expand Down Expand Up @@ -97,7 +97,7 @@
<div class="d-flex">
<div class="flex-fill">
<p>基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET6/NET7/NET8/NET9/NET10</b>,交流群 <b>795206915</b></p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>@WebsiteOption.Value.GetTargets()</b>,交流群 <b>795206915</b></p>
<p>已提供项目模板方便快速上手 <a class="connection-link" href="@TemplateUrl">项目模板</a></p>
</div>
<div class="connection-body-tail d-none d-sm-block"></div>
Expand Down Expand Up @@ -126,7 +126,7 @@
&lt;div class="d-flex"&gt;
&lt;div class="flex-fill"&gt;
&lt;div class="mb-2"&gt;基于 &lt;b&gt;Bootstrap&lt;/b&gt; 样式的 &lt;b&gt;Blazor UI&lt;/b&gt; 组件库&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;NET6/NET7/NET8/NET9/NET10&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;@WebsiteOption.Value.GetTargets()&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;已提供项目模板方便快速上手 &lt;a class="connection-link" href="@TemplateUrl"&gt;项目模板&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="connection-body-tail d-none d-sm-block"&gt;&lt;/div&gt;
Expand Down Expand Up @@ -157,7 +157,7 @@
<div class="d-flex">
<div class="flex-fill">
<p>基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET6/NET7/NET8</b>,交流群 <b>795206915</b></p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>@WebsiteOption.Value.GetTargets()</b>,交流群 <b>795206915</b></p>
<div>已提供项目模板方便快速上手 <a class="connection-link" href="@TemplateUrl">项目模板</a></div>
</div>
<div class="connection-body-tail d-none d-sm-block"></div>
Expand Down Expand Up @@ -187,7 +187,7 @@
&lt;div class="d-flex"&gt;
&lt;div class="flex-fill"&gt;
&lt;div class="mb-2"&gt;基于 &lt;b&gt;Bootstrap&lt;/b&gt; 样式的 &lt;b&gt;Blazor UI&lt;/b&gt; 组件库&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;NET6/NET7/NET8/NET9/NET10&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;@WebsiteOption.Value.GetTargets()&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;已提供项目模板方便快速上手 &lt;a class="connection-link" href="@TemplateUrl"&gt;项目模板&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="connection-body-tail d-none d-sm-block"&gt;&lt;/div&gt;
Expand Down Expand Up @@ -219,7 +219,7 @@
<div class="d-flex">
<div class="flex-fill">
<p>基于 <b>Bootstrap</b> 样式的 <b>Blazor UI</b> 组件库</p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>NET6/NET7/NET8</b>,交流群 <b>795206915</b></p>
<p>适配移动端支持各种主流浏览器,适配 <b>ABP</b>,同时支持 <b>@WebsiteOption.Value.GetTargets()</b>,交流群 <b>795206915</b></p>
<p>已提供项目模板方便快速上手 <a class="connection-link" href="@TemplateUrl">项目模板</a></p>
</div>
<div class="connection-body-tail d-none d-sm-block"></div>
Expand Down Expand Up @@ -248,7 +248,7 @@
&lt;div class="d-flex"&gt;
&lt;div class="flex-fill"&gt;
&lt;div class="mb-2"&gt;基于 &lt;b&gt;Bootstrap&lt;/b&gt; 样式的 &lt;b&gt;Blazor UI&lt;/b&gt; 组件库&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;NET6/NET7/NET8/NET9/NET10&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div class="mb-2"&gt;适配移动端支持各种主流浏览器,适配 &lt;b&gt;ABP&lt;/b&gt;,同时支持 &lt;b&gt;@WebsiteOption.Value.GetTargets()&lt;/b&gt;,交流群 &lt;b&gt;795206915&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;已提供项目模板方便快速上手 &lt;a class="connection-link" href="@TemplateUrl"&gt;项目模板&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="connection-body-tail d-none d-sm-block"&gt;&lt;/div&gt;
Expand Down
14 changes: 13 additions & 1 deletion src/BootstrapBlazor.Server/Data/WebsiteOptions.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone
Expand Down Expand Up @@ -130,6 +130,11 @@ public class WebsiteOptions
[NotNull]
public HashSet<ThemeOption>? Themes { get; set; }

/// <summary>
/// 获得/设置 目标框架集合
/// </summary>
public List<string> TargetFrameworks { get; set; } = [];

/// <summary>
/// 构造函数
/// </summary>
Expand Down Expand Up @@ -174,4 +179,11 @@ public string GetAssetUrl(string url)
/// <param name="id"></param>
/// <returns></returns>
public string GetAvatarUrl(int id) => $"{AssetRootPath}images/avatars/150-{Math.Max(1, id % 25)}.jpg";

/// <summary>
/// 获得目标框架字符串
/// </summary>
/// <param name="separator"></param>
/// <returns></returns>
public string GetTargets(string separator = "/") => string.Join(separator, TargetFrameworks);
}
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Locales/en-US.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"BootstrapBlazor.Server.Components.Pages.Online": {
"SubTitle": "Online population statistics",
"ConnectionTime": "ConnectionTime",
Expand Down Expand Up @@ -34,7 +34,7 @@
"CopiedText": "Copied"
},
"BootstrapBlazor.Server.Components.Pages.Index": {
"Support": "Support NET6.0 & NET7.0 & NET8.0 & NET9.0 & NET10.0",
"Support": "Support",
"Title": "Bootstrap Blazor UI",
"SubTitle": "BootstrapBlazor is an enterprise-grade library that fuses Bootstrap with Blazor, offering developers a powerful toolkit for building responsive and interactive web applications effortlessly.",
"Docs": "Read the docs",
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Locales/zh-CN.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"BootstrapBlazor.Server.Components.Pages.Online": {
"SubTitle": "在线人数统计",
"ConnectionTime": "连接时间",
Expand Down Expand Up @@ -34,7 +34,7 @@
"CopiedText": "复制代码成功"
},
"BootstrapBlazor.Server.Components.Pages.Index": {
"Support": "支持 NET6.0 & NET7.0 & NET8.0 & NET9.0 & NET10.0",
"Support": "支持",
"Title": "Bootstrap Blazor UI",
"SubTitle": "BootstrapBlazor 是一套基于 Bootstrap 和 Blazor 的企业级组件库,无缝整合了 Bootstrap 框架与 Blazor 技术。它提供了一整套强大的工具,使开发者能够轻松创建响应式和交互式的 Web 应用程序。",
"Docs": "阅读文档",
Expand Down
7 changes: 2 additions & 5 deletions src/BootstrapBlazor.Server/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down Expand Up @@ -72,12 +72,9 @@
"JuHe": {
"IpLocatorKey": ""
},
"Cache-Control": {
"Files": [ ".png", ".gif", ".jpg", ".jpeg", ".svg" ],
"Max-Age": 600
},
"WebsiteOptions": {
"ServerUrl": "https://www.blazor.zone",
"TargetFrameworks": ["NET6.0", "NET7.0", "NET8.0", "NET9.0", "NET10.0"],
"Themes": [
{
"key": "bootstrap",
Expand Down
Loading