Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e920f49
refactor: 增加 ImportMap
ArgoZhang Dec 2, 2024
cdc9eaa
refactor: 更新依赖工程
ArgoZhang Dec 3, 2024
cab0326
Merge branch 'main' into dev-auto-mode
ArgoZhang Dec 4, 2024
5f1ec80
refactor: 重构服务注册
ArgoZhang Dec 4, 2024
4ba3bdf
refactor: 同步服务
ArgoZhang Dec 4, 2024
1b235de
refactor: 重构代码
ArgoZhang Dec 4, 2024
70c6342
refactor: 复用服务端服务
ArgoZhang Dec 4, 2024
3a04733
chore: 删除不使用的资源文件
ArgoZhang Dec 4, 2024
ce69087
chore: 删除 StaticFileResponseContextExtensions 扩展
ArgoZhang Dec 4, 2024
e221620
chore: 删除配置文件
ArgoZhang Dec 4, 2024
df71dc4
chore: 增加同步脚本
ArgoZhang Dec 4, 2024
4ed07a5
chore: 精简配置文件
ArgoZhang Dec 4, 2024
139a125
chore: 增加忽略文件
ArgoZhang Dec 4, 2024
ad0d76a
chore: 移除网站图标
ArgoZhang Dec 4, 2024
c3f18ef
chore: 增加同步网站图标脚本
ArgoZhang Dec 4, 2024
49ecc49
chore: 更新全局命名空间
ArgoZhang Dec 4, 2024
9ecf6fa
chore: 更新忽略文件
ArgoZhang Dec 4, 2024
f130bd5
chore: 更新配置文件
ArgoZhang Dec 4, 2024
eb72e00
chore: api 接口复用
ArgoZhang Dec 4, 2024
42f3c35
chore: 增加配置文件
ArgoZhang Dec 4, 2024
080fb32
chore: 移除指定版本号配置
ArgoZhang Dec 4, 2024
3d87707
refactor: 删除 JSRuntime 扩展
ArgoZhang Dec 4, 2024
064722e
refactor: 重构本地化下拉框
ArgoZhang Dec 4, 2024
3888d0e
chore: Client 模式支持本地化
ArgoZhang Dec 4, 2024
6bf65e2
chore: 增加脚本
ArgoZhang Dec 4, 2024
fd0aeff
revert: 撤销配置更改
ArgoZhang Dec 4, 2024
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
14 changes: 14 additions & 0 deletions BootstrapBlazor.sln
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{02EA681E-C
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazor.Shared", "src\BootstrapBlazor.Shared\BootstrapBlazor.Shared.csproj", "{A6E8F478-213E-44EC-BF4D-7C9342C3DEED}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazorAuto", "src\BootstrapBlazorAuto\BootstrapBlazorAuto\BootstrapBlazorAuto.csproj", "{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BootstrapBlazorAuto.Client", "src\BootstrapBlazorAuto\BootstrapBlazorAuto.Client\BootstrapBlazorAuto.Client.csproj", "{7D3FFBD8-A43C-490F-92D1-4F669E7E550F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -107,6 +111,14 @@ Global
{A6E8F478-213E-44EC-BF4D-7C9342C3DEED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A6E8F478-213E-44EC-BF4D-7C9342C3DEED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A6E8F478-213E-44EC-BF4D-7C9342C3DEED}.Release|Any CPU.Build.0 = Release|Any CPU
{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E}.Release|Any CPU.Build.0 = Release|Any CPU
{7D3FFBD8-A43C-490F-92D1-4F669E7E550F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D3FFBD8-A43C-490F-92D1-4F669E7E550F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D3FFBD8-A43C-490F-92D1-4F669E7E550F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D3FFBD8-A43C-490F-92D1-4F669E7E550F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -123,6 +135,8 @@ Global
{D8AEAFE7-10AF-4A5B-BC67-FE740A2CA1DF} = {7C1D79F1-87BC-42C1-BD5A-CDE4044AC1BD}
{01DA4687-0973-4CA6-97F5-04E0B8DD1B13} = {7C1D79F1-87BC-42C1-BD5A-CDE4044AC1BD}
{A6E8F478-213E-44EC-BF4D-7C9342C3DEED} = {A2182155-43ED-44C1-BF6F-1B70EBD2DFFE}
{2A69B4F8-7C7D-4AC3-BE13-B862DE078F6E} = {A2182155-43ED-44C1-BF6F-1B70EBD2DFFE}
{7D3FFBD8-A43C-490F-92D1-4F669E7E550F} = {A2182155-43ED-44C1-BF6F-1B70EBD2DFFE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0DCB0756-34FA-4FD0-AE1D-D3F08B5B3A6B}
Expand Down
1 change: 0 additions & 1 deletion src/BootstrapBlazor.Server/Components/_Imports.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
@using BootstrapBlazor.Components

@using BootstrapBlazor.Server.Extensions
@using BootstrapBlazor.Shared.Components.Components
@using BootstrapBlazor.Shared.Components.Layout

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Net;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;

namespace BootstrapBlazor.Server.Controllers.Api;
namespace BootstrapBlazor.Controllers.Api;

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;

namespace BootstrapBlazor.Server.Controllers.Api;
namespace BootstrapBlazor.Controllers.Api;

/// <summary>
/// Dispatch 接口
Expand Down Expand Up @@ -36,7 +36,7 @@ public IActionResult Get([FromServices] IDispatchService<bool> dispatchService,
Name = "Reboot"
});
}
else if(data == "57D2EADDEC65BE22E104ADB97778E6B0")
else if (data == "57D2EADDEC65BE22E104ADB97778E6B0")
{
dispatchService.Dispatch(new DispatchEntry<bool>()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Mvc;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;

namespace BootstrapBlazor.Server.Controllers.Api;
namespace BootstrapBlazor.Controllers.Api;

/// <summary>
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.AspNetCore.Mvc;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;

namespace BootstrapBlazor.Server.Controllers.Api;
namespace BootstrapBlazor.Controllers.Api;

/// <summary>
/// 登录控制器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using Microsoft.AspNetCore.Mvc;
using RouteAttribute = Microsoft.AspNetCore.Mvc.RouteAttribute;

namespace BootstrapBlazor.Server.Controllers;
namespace BootstrapBlazor.Controllers;

/// <summary>
/// 文化 Controller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;

namespace BootstrapBlazor.Server.Controllers;
namespace BootstrapBlazor.Controllers;

/// <summary>
/// 瀑布流控制器
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

using BootstrapBlazor.Service.Services;
using Longbow.Tasks.Services;
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Options;
using System.Text.Encodings.Web;
Expand All @@ -19,10 +19,7 @@ public static IServiceCollection AddBootstrapBlazorServerService(this IServiceCo
services.AddSingleton(HtmlEncoder.Create(UnicodeRanges.All));

// 增加错误日志
services.AddLogging(logBuilder => logBuilder.AddFileLogger());

// 增加跨域服务
services.AddCors();
services.AddLogging(logging => logging.AddFileLogger());

// 增加多语言支持配置信息
services.AddRequestLocalization<IOptionsMonitor<BootstrapBlazorOptions>>((localizerOption, blazorOption) =>
Expand All @@ -48,18 +45,15 @@ void Invoke(BootstrapBlazorOptions option)
#endif

services.AddControllers();
services.AddRazorComponents().AddInteractiveServerComponents();

// 增加 SignalR 服务数据传输大小限制配置
services.Configure<HubOptions>(option => option.MaximumReceiveMessageSize = null);

// 增加授权服务
services.AddAuthorization();

// 增加后台任务服务
services.AddTaskServices();
services.AddHostedService<ClearTempFilesService>();

// 增加通用服务
services.AddBootstrapBlazorServices();

return services;
Expand Down

This file was deleted.

17 changes: 9 additions & 8 deletions src/BootstrapBlazor.Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

builder.Services.AddBootstrapBlazorServerService();

var app = builder.Build();
Expand All @@ -34,11 +37,10 @@
app.UseResponseCompression();
}

#if NET9_0_OR_GREATER
app.UseAntiforgery();
app.UseBootstrapBlazor();

app.MapStaticAssets();
#else
app.UseStaticFiles();
#endif

var cors = app.Configuration["AllowOrigins"]?.Split(',', StringSplitOptions.RemoveEmptyEntries);
if (cors?.Length > 0)
Expand All @@ -49,10 +51,9 @@
.AllowCredentials());
}

app.UseBootstrapBlazor();
app.UseAntiforgery();

app.MapDefaultControllerRoute();
app.MapRazorComponents<App>().AddInteractiveServerRenderMode().AddAdditionalAssemblies(typeof(MainLayout).Assembly);
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(typeof(MainLayout).Assembly);

app.Run();
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// See the LICENSE file in the project root for more information.
// Maintainer: Argo Zhang(argo@live.ca) Website: https://www.blazor.zone

using Longbow.Tasks;

namespace BootstrapBlazor.Service.Services;
namespace Longbow.Tasks.Services;

/// <summary>
/// 后台任务服务类
Expand Down
31 changes: 1 addition & 30 deletions src/BootstrapBlazor.Server/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,8 @@
"Microsoft.AspNetCore": "Warning"
}
},
"AllowOrigins": "http://localhost:5000",
"SassCompiler": {
"SourceFolder": "Styles",
"TargetFolder": "wwwroot/css",
"Arguments": "--style=compressed",
"GenerateScopedCss": true,
"ScopedCssFolders": [ "Views", "Pages", "Shared", "Components" ],
"IncludePaths": [],

// You can override specific options based on the build configuration
"Configurations": {
"Debug": { // These options apply only to Debug builds
"Arguments": "--style=expanded"
}
}
},
"WebsiteOptions": {
"ServerUrl": "http://localhost:5053",
"WasmUrl": "http://localhost:5055"
"ServerUrl": "http://localhost:5053"
},
"BootstrapBlazorOptions": {
"ToastDelay": 4000,
Expand Down Expand Up @@ -52,17 +35,5 @@
"OnTouchDelay": 600
}
},
"GiteeOptions": {
"ClientId": "<ClientId>",
"ClientSecret": "<ClientSecret>",
"CallbackPath": "/",
"Scope": "<Scope>"
},
"GitHubOptions": {
"ClientId": "<ClientId>",
"ClientSecret": "<ClientSecret>",
"CallbackPath": "/",
"Scope": "<Scope>"
},
"SupportedLanguages": [ "zh-CN", "ru-RU" ]
}
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
},
"AllowedHosts": "*",
"AllowOrigins": "http://localhost:50855,http://wasm.blazor.zone,https://wasm.blazor.zone",
"AllowOrigins": "",
"ConnectionStrings": {
"bb": "Data Source=bb.db;"
},
Expand Down
4 changes: 0 additions & 4 deletions src/BootstrapBlazor.Shared/BootstrapBlazor.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
<EmbeddedResource Include="topology.json" />
</ItemGroup>

<ItemGroup>
<SupportedPlatform Include="browser" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="BootstrapBlazor.AntDesignIcon" Version="9.0.0" />
<PackageReference Include="BootstrapBlazor.AzureOpenAI" Version="9.0.0" />
Expand Down
Loading
Loading