Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Components/Components/BBLogo.razor
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<img alt="logo" class="bb-icon" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/logo.png")" />
<img alt="logo" class="bb-icon" src="@WebsiteOption.Value.GetAssetUrl("images/logo.png")" />
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<Reconnector>
<ReconnectingTemplate>
Expand Down Expand Up @@ -59,7 +59,7 @@
</Reconnector>

@code {
private string TemplateUrl => $"{WebsiteOption.CurrentValue.GiteeRepositoryUrl}/wikis/%E9%A1%B9%E7%9B%AE%E6%A8%A1%E6%9D%BF%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B";
private string TemplateUrl => $"{WebsiteOption.Value.GiteeRepositoryUrl}/wikis/%E9%A1%B9%E7%9B%AE%E6%A8%A1%E6%9D%BF%E4%BD%BF%E7%94%A8%E6%95%99%E7%A8%8B";

RenderFragment RenderBootstrapBlazor =>
@<div class="col-12 col-sm-5">
Expand All @@ -71,7 +71,7 @@
<p></p>
<div>已提供项目模板方便快速上手 <a class="connection-link" href="@TemplateUrl" target="_blank">项目模板</a></div>
</div>
<img altt="QQ" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/[email protected]")" alt="QQGroup" />
<img altt="QQ" src="@WebsiteOption.Value.GetAssetUrl("images/[email protected]")" alt="QQGroup" />
<div class="connection-body-tail d-none d-sm-block"></div>
</div>
</div>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ namespace BootstrapBlazor.Server.Components.Components;
public sealed partial class ComponentCard
{
[Inject, NotNull]
private IOptionsMonitor<WebsiteOptions>? WebsiteOption { get; set; }
private IOptions<WebsiteOptions>? WebsiteOption { get; set; }

private string ImageUrl => $"{WebsiteOption.CurrentValue.AssetRootPath}images/{Image}";
private string ImageUrl => $"{WebsiteOption.Value.AssetRootPath}images/{Image}";

private string? ClassString => CssBuilder.Default("col-12 col-sm-6 col-md-4 col-lg-3")
.AddClass("d-none", IsHide)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<span>@Label</span>
<Select Value="@SelectedCulture" OnSelectedItemChanged="@SetCulture">
<Options>
@foreach (var kv in BootstrapOptions.CurrentValue.GetSupportedCultures())
@foreach (var kv in BootstrapOptions.Value.GetSupportedCultures())
{
<SelectOption Text="@GetDisplayName(kv)" Value="@kv.Name" />
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public partial class CultureChooser
{
[Inject]
[NotNull]
private IOptionsMonitor<BootstrapBlazorOptions>? BootstrapOptions { get; set; }
private IOptions<BootstrapBlazorOptions>? BootstrapOptions { get; set; }

[Inject]
[NotNull]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<div class="bb-winbox-body">
<h3>Custom WinBox Content Create @DateTime.Now</h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ private async Task SetIconWinBox()
{
if (Option != null)
{
Option.Icon = $"{WebsiteOption.CurrentValue.AssetRootPath}images/Argo-C.png";
Option.Icon = $"{WebsiteOption.Value.AssetRootPath}images/Argo-C.png";
await WinBoxService.SetIcon(Option);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/BootstrapBlazor.Server/Components/Components/Header.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
<CultureChooser class="flex-md" />
<ul class="navbar-nav nav-repo ms-3">
<li class="nav-item">
<a class="nav-link p-2" href="@WebsiteOption.CurrentValue.GithubRepositoryUrl" target="_blank">
<img alt="git" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/git.svg")" />
<a class="nav-link p-2" href="@WebsiteOption.Value.GithubRepositoryUrl" target="_blank">
<img alt="git" src="@WebsiteOption.Value.GetAssetUrl("images/git.svg")" />
</a>
</li>
<li class="nav-item">
<a class="nav-link p-2" href="@WebsiteOption.CurrentValue.GiteeRepositoryUrl" target="_blank">
<img alt="gitee" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/gitee.svg")" />
<a class="nav-link p-2" href="@WebsiteOption.Value.GiteeRepositoryUrl" target="_blank">
<img alt="gitee" src="@WebsiteOption.Value.GetAssetUrl("images/gitee.svg")" />
</a>
</li>
<li class="nav-item">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public partial class Header
{
[Inject]
[NotNull]
private IOptionsMonitor<WebsiteOptions>? WebsiteOption { get; set; }
private IOptions<WebsiteOptions>? WebsiteOption { get; set; }

[Inject]
[NotNull]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@using Microsoft.Extensions.DependencyInjection
@inject PackageVersionService VersionManager
@inject IStringLocalizer<InstallContent> Localizer
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<h3>@Title</h3>

Expand All @@ -14,17 +14,17 @@
<p class="code-label">1. @Localizer["P11"]</p>
<p class="code-label">2. @Localizer["P12"]</p>
<p class="code-label">3. @Localizer["P13"] <b>Blazor App</b> @Localizer["P14"] <b>@Localizer["P15"]</b>, @Localizer["P16"] <b>Create</b></p>
<img alt="install" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/create-new-application.png")" style="border-radius: 6px;" class="d-none d-sm-block" />
<img alt="install" src="@WebsiteOption.Value.GetAssetUrl("images/create-new-application.png")" style="border-radius: 6px;" class="d-none d-sm-block" />
@ChooseTemplate

<h5>@Localizer["P17"]</h5>
<p class="code-label">1. @Localizer["P18"] <b>nuget.org</b> @Localizer["P19"] <code>BootstrapBlazor</code></p>
<p>@Localizer["P20"] <b>Manage Nuget Packages</b></p>
<Pre @key="@Version" class="no-highlight">dotnet add package BootstrapBlazor --version @Version</Pre>
<img alt="install" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/manage-nuget-packages-for-server-app.png")" style="border-radius: 6px;" class="d-none d-sm-block" />
<img alt="install" src="@WebsiteOption.Value.GetAssetUrl("images/manage-nuget-packages-for-server-app.png")" style="border-radius: 6px;" class="d-none d-sm-block" />

<p class="code-label">2. @Localizer["P21"]</p>
<img alt="install" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/nuget_install.png")" style="width: 1000px; border-radius: 6px;" class="d-none d-sm-block" />
<img alt="install" src="@WebsiteOption.Value.GetAssetUrl("images/nuget_install.png")" style="width: 1000px; border-radius: 6px;" class="d-none d-sm-block" />

<p class="code-label">3. @Localizer["P22"]</p>
<p>@Localizer["P23"]</p>
Expand Down Expand Up @@ -69,4 +69,4 @@
<p class="code-label">1. @Localizer["P39"] <code>Button</code> @Localizer["P40"]</p>
<Pre>&lt;Button Color="Color.Primary" Icon="fa-solid fa-font-awesome" Text="@Localizer["P41"]" /&gt;</Pre>
<p class="code-label">2. @Localizer["P42"] <b>Visual studio</b> @Localizer["P43"] <kbd>F5</kbd> @Localizer["P44"]</p>
<img alt="install" src="@WebsiteOption.CurrentValue.GetAssetUrl("images/preview.png")" style="border-radius: 6px;" class="d-none d-sm-block" />
<img alt="install" src="@WebsiteOption.Value.GetAssetUrl("images/preview.png")" style="border-radius: 6px;" class="d-none d-sm-block" />
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Components/Components/Pre.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits WebSiteModuleComponentBase
@attribute [JSModuleAutoLoader("Components/Pre.razor.js")]
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<div @attributes="@AdditionalAttributes" class="@ClassString" id="@Id" data-bb-title="@CopiedText">
<p class="loading">@LoadingText</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
/// <inheritdoc/>
/// </summary>
/// <returns></returns>
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, CopiedText, WebsiteOption.CurrentValue.AssetRootPath);
protected override Task InvokeInitAsync() => InvokeVoidAsync("init", Id, CopiedText, WebsiteOption.Value.AssetRootPath);

private async Task GetCodeAsync()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption
@inject IStringLocalizer<QQGroup> Localzier

<div>
@Localzier["Group"]:BootstrapAdmin & Blazor
<a class="mx-1" target="_blank" href="@WebsiteOption.CurrentValue.QQGroup1Link">
<a class="mx-1" target="_blank" href="@WebsiteOption.Value.QQGroup1Link">
<span class="text-success fa-brands fa-qq">
<span class="ms-1"><b>795206915</b></span>
</span>
</a>
<a class="mx-1" target="_blank" href="@WebsiteOption.CurrentValue.QQGroup2Link">
<a class="mx-1" target="_blank" href="@WebsiteOption.Value.QQGroup2Link">
<span class="text-success fa-brands fa-qq">
<span class="ms-1"><b>675147445</b></span>
</span>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits WebSiteModuleComponentBase
@attribute [JSModuleAutoLoader("Components/ThemeChooser.razor.js")]
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<HeadContent>
@foreach (var css in _currentTheme)
Expand All @@ -10,7 +10,7 @@
</HeadContent>

<div id="@Id" class="theme" @onclick:stopPropagation>
<PulseButton TooltipPlacement="Placement.Left" TooltipText="@Title" Color="Color.None" ImageUrl="@WebsiteOption.CurrentValue.GetAssetUrl("images/m.svg")" class="btn-fade btn-theme" />
<PulseButton TooltipPlacement="Placement.Left" TooltipText="@Title" Color="Color.None" ImageUrl="@WebsiteOption.Value.GetAssetUrl("images/m.svg")" class="btn-fade btn-theme" />
</div>

<BootstrapBlazorRootContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,22 +34,22 @@ protected override void OnInitialized()

Title ??= Localizer[nameof(Title)];
HeaderText ??= Localizer[nameof(HeaderText)];
Themes = WebsiteOption.CurrentValue.Themes.Select(i => new SelectedItem { Text = i.Name, Value = i.Key });
WebsiteOption.CurrentValue.CurrentTheme = "bootstrap";
Themes = WebsiteOption.Value.Themes.Select(i => new SelectedItem { Text = i.Name, Value = i.Key });
WebsiteOption.Value.CurrentTheme = "bootstrap";
}

private void OnClickTheme(SelectedItem item)
{
_currentTheme.Clear();
WebsiteOption.CurrentValue.CurrentTheme = item.Value;
var theme = WebsiteOption.CurrentValue.Themes.FirstOrDefault(i => i.Key == item.Value);
WebsiteOption.Value.CurrentTheme = item.Value;
var theme = WebsiteOption.Value.Themes.FirstOrDefault(i => i.Key == item.Value);
if (theme is { Files: not null })
{
_currentTheme.AddRange(theme.Files);
}
}

private string? GetThemeItemClass(SelectedItem item) => CssBuilder.Default("theme-item")
.AddClass("active", WebsiteOption.CurrentValue.CurrentTheme == item.Value)
.AddClass("active", WebsiteOption.Value.CurrentTheme == item.Value)
.Build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@
<h5><b>Bootstrap Blazor</b> @Localizer["H1"] <span class="version">@PackageVersionService.Version</span></h5>
<div class="d-flex">
<div class="blazor-intro-body">
<p>@Localizer["B1"] <b>Bootstrap</b> <b>Blazor</b> @Localizer["B2"] <a href="@WebsiteOption.CurrentValue.AdminUrl" target="_blank"><b>@Localizer["B3"]</b></a> @Localizer["B4"]。<b>Bootstrap Blazor</b> @((MarkupString)Localizer["B5"].Value)</p>
<p>@Localizer["B1"] <b>Bootstrap</b> <b>Blazor</b> @Localizer["B2"] <a href="@WebsiteOption.Value.AdminUrl" target="_blank"><b>@Localizer["B3"]</b></a> @Localizer["B4"]。<b>Bootstrap Blazor</b> @((MarkupString)Localizer["B5"].Value)</p>
<p>
@Localizer["P1"] <span class="version">@PackageVersionService.Version</span> @Localizer["P2"] <a target="_blank" href="@UpdateLogUrl"><b>[@Localizer["P3"]]</b></a> @Localizer["P4"] <b>Star</b>
<a class="px-2" href="@WebsiteOption.CurrentValue.GithubRepositoryUrl" target="_blank">
<img src="@WebsiteOption.CurrentValue.GetAssetUrl("images/git.svg")" alt="github" />
<a class="px-2" href="@WebsiteOption.Value.GithubRepositoryUrl" target="_blank">
<img src="@WebsiteOption.Value.GetAssetUrl("images/git.svg")" alt="github" />
</a>
<a href="@WebsiteOption.CurrentValue.GiteeRepositoryUrl" target="_blank">
<img src="@WebsiteOption.CurrentValue.GetAssetUrl("images/gitee.svg")" alt="gitee" />
<a href="@WebsiteOption.Value.GiteeRepositoryUrl" target="_blank">
<img src="@WebsiteOption.Value.GetAssetUrl("images/gitee.svg")" alt="gitee" />
</a>
</p>
</div>
<div class="blazor-intro-barcode">
<img src="@WebsiteOption.CurrentValue.GetAssetUrl("images/[email protected]")" alt="QQGroup" />
<img src="@WebsiteOption.Value.GetAssetUrl("images/[email protected]")" alt="QQGroup" />
<div>QQ 795206915</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public partial class UpdateIntro
{
[Inject]
[NotNull]
private IOptionsMonitor<WebsiteOptions>? WebsiteOption { get; set; }
private IOptions<WebsiteOptions>? WebsiteOption { get; set; }

[Inject]
[NotNull]
private PackageVersionService? PackageVersionService { get; set; }

private string UpdateLogUrl => $"{WebsiteOption.CurrentValue.GiteeRepositoryUrl}/wikis/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97?sort_id=4062034";
private string UpdateLogUrl => $"{WebsiteOption.Value.GiteeRepositoryUrl}/wikis/%E6%9B%B4%E6%96%B0%E6%97%A5%E5%BF%97?sort_id=4062034";

/// <summary>
/// <inheritdoc/>
Expand Down
6 changes: 3 additions & 3 deletions src/BootstrapBlazor.Server/Components/Components/Video.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption
@inject IStringLocalizer<Video> Localizer

<p><b>@Localizer["H1"]</b></p>
Expand Down Expand Up @@ -44,11 +44,11 @@ else
Name = comNameWithHash.Split('?').First();
}

if (!string.IsNullOrEmpty(Name) && WebsiteOption.CurrentValue.Videos.TryGetValue(Name, out var url))
if (!string.IsNullOrEmpty(Name) && WebsiteOption.Value.Videos.TryGetValue(Name, out var url))
{
if (!string.IsNullOrEmpty(url))
{
VideoUrl.AddRange(url.Split(';').Select(a => $"{WebsiteOption.CurrentValue.VideoUrl}{a}"));
VideoUrl.AddRange(url.Split(';').Select(a => $"{WebsiteOption.Value.VideoUrl}{a}"));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Components/Components/Widget.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<DropdownWidget class="px-3 d-none d-sm-block">
<DropdownWidgetItem Icon="fa-regular fa-envelope" BadgeNumber="4">
Expand All @@ -10,7 +10,7 @@
{
<a class="dropdown-item d-flex align-items-center" href="#" @onclick:preventDefault>
<div style="width: 40px; height: 40px;">
<Avatar Url="@WebsiteOption.CurrentValue.GetAssetUrl("images/Argo-C.png")" IsCircle="true" Size="Size.Small" />
<Avatar Url="@WebsiteOption.Value.GetAssetUrl("images/Argo-C.png")" IsCircle="true" Size="Size.Small" />
</div>
<div class="ms-2">
<div class="d-flex position-relative">
Expand Down
4 changes: 2 additions & 2 deletions src/BootstrapBlazor.Server/Components/Components/Wwads.razor
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@inherits WebSiteModuleComponentBase
@attribute [JSModuleAutoLoader("Components/Wwads.razor.js", AutoInvokeDispose = false)]
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<HeadContent>
<link rel="stylesheet" href="@Assets[$"{WebsiteOption.CurrentValue.AssetRootPath}css/wwads.css"]" />
<link rel="stylesheet" href="@Assets[$"{WebsiteOption.Value.AssetRootPath}css/wwads.css"]" />
</HeadContent>

<div @attributes="AdditionalAttributes" id="@Id" class="@ClassString"></div>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@inherits LayoutComponentBase
@layout MainLayout
@inject IOptionsMonitor<WebsiteOptions> WebsiteOption
@inject IOptions<WebsiteOptions> WebsiteOption

<div class="tabs-coms-header">
<div class="bb-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public partial class ComponentLayout : IAsyncDisposable
[NotNull]
private IOptions<IconThemeOptions>? IconThemeOptions { get; set; }

private string GVPUrl => $"{WebsiteOption.CurrentValue.GiteeRepositoryUrl}/badge/star.svg?theme=gvp";
private string GVPUrl => $"{WebsiteOption.Value.GiteeRepositoryUrl}/badge/star.svg?theme=gvp";

private List<SelectedItem> IconThemes { get; } = [];

Expand Down Expand Up @@ -104,7 +104,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Module = await JSRuntime.LoadModule($"{WebsiteOption.CurrentValue.AssetRootPath}Components/Layout/ComponentLayout.razor.js");
Module = await JSRuntime.LoadModule($"{WebsiteOption.Value.AssetRootPath}Components/Layout/ComponentLayout.razor.js");
}
if (Module != null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public partial class DockLayout : IAsyncDisposable

[Inject]
[NotNull]
private IOptionsMonitor<WebsiteOptions>? WebsiteOption { get; set; }
private IOptions<WebsiteOptions>? WebsiteOption { get; set; }

/// <summary>
/// <inheritdoc/>
Expand All @@ -38,7 +38,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
Module = await JSRuntime.LoadModule($"{WebsiteOption.CurrentValue.AssetRootPath}Components/Layout/DockLayout.razor.js");
Module = await JSRuntime.LoadModule($"{WebsiteOption.Value.AssetRootPath}Components/Layout/DockLayout.razor.js");
await Module.InvokeVoidAsync("init");
}
}
Expand Down
Loading
Loading