Browse Source

Support `Blazor Full-Stack Web App`.

pull/18876/head
maliming 2 years ago
parent
commit
cb37ba63a0
No known key found for this signature in database GPG Key ID: A646B9CB645ECEA4
  1. 1
      Directory.Packages.props
  2. 26
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/AbpScripts.razor
  3. 26
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/AbpStyles.razor
  4. 7
      framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorGlobalScriptContributor.cs
  5. 17
      framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs
  6. 7
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs
  7. 11
      framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebOptions.cs
  8. 23
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/Extensions/DependencyInjection/AbpBlazorWebAppServiceCollectionExtensions.cs
  9. 12
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/CookieBasedWebAssemblyAbpAccessTokenProvider.cs
  10. 30
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/RemoteAuthenticationStateProvider.cs
  11. 89
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/RemoteCurrentPrincipalAccessor.cs
  12. 18
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/WebAppAdditionalAssembliesHelper.cs
  13. 7
      framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs
  14. 2
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Middleware/AbpMiddlewareBase.cs
  15. 15
      framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs
  16. 7
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundleConfig.cs
  17. 47
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs
  18. 14
      framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModuleHelper.cs
  19. 21
      templates/app/aspnet-core/MyCompanyName.MyProjectName.sln
  20. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Menus/MyProjectNameMenuContributor.cs
  21. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Menus/MyProjectNameMenus.cs
  22. 50
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyCompanyName.MyProjectName.Blazor.Client.csproj
  23. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorAutoMapperProfile.cs
  24. 26
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorClientModule.cs
  25. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBrandingProvider.cs
  26. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBundleContributor.cs
  27. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameComponentBase.cs
  28. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor
  29. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor.cs
  30. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor.css
  31. 22
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Program.cs
  32. 12
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Routes.razor
  33. 15
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/_Imports.razor
  34. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/appsettings.Development.json
  35. 1
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/appsettings.json
  36. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/favicon.ico
  37. 40
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/global.css
  38. 38
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/global.js
  39. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/icon-192.png
  40. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/icon-512.png
  41. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png
  42. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-dark.png
  43. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-light-thumbnail.png
  44. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-light.png
  45. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/main.css
  46. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/manifest.json
  47. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/service-worker.js
  48. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/service-worker.published.js
  49. 45
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/App.razor
  50. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor
  51. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor.cs
  52. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor.css
  53. 14
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Routes.razor
  54. 20
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs
  55. 39
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml
  56. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_ViewImports.cshtml
  57. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/_Imports.razor
  58. 83
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Menus/MyProjectNameMenuContributor.cs
  59. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Menus/MyProjectNameMenus.cs
  60. 50
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.csproj
  61. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBlazorAutoMapperProfile.cs
  62. 106
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBlazorClientModule.cs
  63. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBrandingProvider.cs
  64. 19
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBundleContributor.cs
  65. 12
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameComponentBase.cs
  66. 176
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor
  67. 6
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor.cs
  68. 0
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor.css
  69. 22
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Program.cs
  70. 14
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Routes.razor
  71. 14
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/_Imports.razor
  72. 3
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/appsettings.Development.json
  73. 25
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/appsettings.json
  74. 28
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/global.css
  75. 35
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/global.js
  76. BIN
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/icon-192.png
  77. BIN
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/icon-512.png
  78. 57
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/main.css
  79. 21
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/manifest.json
  80. 4
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/service-worker.js
  81. 48
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/service-worker.published.js
  82. 46
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Components/App.razor
  83. 51
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Menus/MyProjectNameMenuContributor.cs
  84. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Menus/MyProjectNameMenus.cs
  85. 78
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyCompanyName.MyProjectName.Blazor.Server.WebApp.csproj
  86. 305
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameBlazorModule.cs
  87. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameBrandingProvider.cs
  88. 12
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameComponentBase.cs
  89. 56
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Program.cs
  90. 28
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Properties/launchSettings.json
  91. 14
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/_Imports.razor
  92. 11
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/abp.resourcemapping.js
  93. 2
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/appsettings.Development.json
  94. 16
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/appsettings.json
  95. 9
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/package.json
  96. 18
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/web.config
  97. 18
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/blazor-global-styles.css
  98. BIN
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/favicon.ico
  99. 10
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/global-styles.css
  100. BIN
      templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png

1
Directory.Packages.props

@ -55,6 +55,7 @@
<PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" /> <PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="8.0.0" />

26
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/AbpScripts.razor

@ -0,0 +1,26 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Bundling
@inject IBundleManager BundleManager
@if (ScriptBundleFiles != null)
{
foreach (var bundleFile in ScriptBundleFiles)
{
<script src="@bundleFile.FileName"></script>
}
}
@code {
private IReadOnlyList<BundleFile>? ScriptBundleFiles { get; set; }
[Parameter]
public string? BundleName { get; set; }
protected override async Task OnInitializedAsync()
{
if (BundleName == null)
{
throw new AbpException("The BundleName parameter of the AbpScripts component can not be null!");
}
ScriptBundleFiles = await BundleManager.GetScriptBundleFilesAsync(BundleName!);
}
}

26
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/AbpStyles.razor

@ -0,0 +1,26 @@
@using Volo.Abp.AspNetCore.Mvc.UI.Bundling
@inject IBundleManager BundleManager
@if (StyleBundleFiles != null)
{
foreach (var bundleFile in StyleBundleFiles)
{
<link rel="stylesheet" href="@bundleFile.FileName" />
}
}
@code {
private IReadOnlyList<BundleFile>? StyleBundleFiles { get; set; }
[Parameter]
public string? BundleName { get; set; }
protected override async Task OnInitializedAsync()
{
if (BundleName == null)
{
throw new AbpException("The BundleName parameter of the AbpStyles component can not be null!");
}
StyleBundleFiles = await BundleManager.GetStyleBundleFilesAsync(BundleName!);
}
}

7
framework/src/Volo.Abp.AspNetCore.Components.Server.Theming/Bundling/BlazorGlobalScriptContributor.cs

@ -1,4 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling; namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling;
@ -7,7 +9,10 @@ public class BlazorGlobalScriptContributor : BundleContributor
{ {
public override void ConfigureBundle(BundleConfigurationContext context) public override void ConfigureBundle(BundleConfigurationContext context)
{ {
context.Files.AddIfNotContains("/_framework/blazor.server.js"); var options = context.ServiceProvider.GetRequiredService<IOptions<AbpAspNetCoreComponentsWebOptions>>().Value;
context.Files.AddIfNotContains(options.IsBlazorWebApp
? "/_framework/blazor.web.js"
: "/_framework/blazor.server.js");
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js");
} }
} }

17
framework/src/Volo.Abp.AspNetCore.Components.Server/Volo/Abp/AspNetCore/Components/Server/AbpAspNetCoreComponentsServerModule.cs

@ -57,18 +57,21 @@ public class AbpAspNetCoreComponentsServerModule : AbpModule
options.IgnoredUrls.AddIfNotContains("/_blazor"); options.IgnoredUrls.AddIfNotContains("/_blazor");
}); });
var preConfigureActions = context.Services.GetPreConfigureActions<HttpConnectionDispatcherOptions>(); if (!context.Services.ExecutePreConfiguredActions<AbpAspNetCoreComponentsWebOptions>().IsBlazorWebApp)
Configure<AbpEndpointRouterOptions>(options =>
{ {
options.EndpointConfigureActions.Add(endpointContext => var preConfigureActions = context.Services.GetPreConfigureActions<HttpConnectionDispatcherOptions>();
Configure<AbpEndpointRouterOptions>(options =>
{ {
endpointContext.Endpoints.MapBlazorHub(httpConnectionDispatcherOptions => options.EndpointConfigureActions.Add(endpointContext =>
{ {
preConfigureActions.Configure(httpConnectionDispatcherOptions); endpointContext.Endpoints.MapBlazorHub(httpConnectionDispatcherOptions =>
{
preConfigureActions.Configure(httpConnectionDispatcherOptions);
});
endpointContext.Endpoints.MapFallbackToPage("/_Host");
}); });
endpointContext.Endpoints.MapFallbackToPage("/_Host");
}); });
}); }
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context) public override void OnApplicationInitialization(ApplicationInitializationContext context)

7
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebModule.cs

@ -2,6 +2,7 @@
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp.AspNetCore.Components.DependencyInjection; using Volo.Abp.AspNetCore.Components.DependencyInjection;
using Volo.Abp.AspNetCore.Components.Server;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.UI; using Volo.Abp.UI;
@ -16,5 +17,11 @@ public class AbpAspNetCoreComponentsWebModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>()); context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>());
var preActions = context.Services.GetPreConfigureActions<AbpAspNetCoreComponentsWebOptions>();
Configure<AbpAspNetCoreComponentsWebOptions>(options =>
{
preActions.Configure(options);
});
} }
} }

11
framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/AbpAspNetCoreComponentsWebOptions.cs

@ -0,0 +1,11 @@
namespace Volo.Abp.AspNetCore.Components.Server;
public class AbpAspNetCoreComponentsWebOptions
{
public bool IsBlazorWebApp { get; set; }
public AbpAspNetCoreComponentsWebOptions()
{
IsBlazorWebApp = false;
}
}

23
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Microsoft/Extensions/DependencyInjection/AbpBlazorWebAppServiceCollectionExtensions.cs

@ -0,0 +1,23 @@
using JetBrains.Annotations;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Volo.Abp;
using Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.Security.Claims;
namespace Microsoft.Extensions.DependencyInjection;
public static class AbpBlazorWebAppServiceCollectionExtensions
{
public static IServiceCollection AddBlazorWebAppServices([NotNull] this IServiceCollection services)
{
Check.NotNull(services, nameof(services));
services.AddSingleton<AuthenticationStateProvider, RemoteAuthenticationStateProvider>();
services.Replace(ServiceDescriptor.Transient<IAbpAccessTokenProvider, CookieBasedWebAssemblyAbpAccessTokenProvider>());
services.Replace(ServiceDescriptor.Transient<ICurrentPrincipalAccessor, RemoteCurrentPrincipalAccessor>());
return services;
}
}

12
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/CookieBasedWebAssemblyAbpAccessTokenProvider.cs

@ -0,0 +1,12 @@
using System.Threading.Tasks;
using Volo.Abp.Http.Client.Authentication;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
public class CookieBasedWebAssemblyAbpAccessTokenProvider : IAbpAccessTokenProvider
{
public virtual Task<string?> GetTokenAsync()
{
return Task.FromResult<string?>(null);
}
}

30
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/RemoteAuthenticationStateProvider.cs

@ -0,0 +1,30 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Authorization;
using Volo.Abp.Security.Claims;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
public class RemoteAuthenticationStateProvider : AuthenticationStateProvider
{
protected ICurrentPrincipalAccessor CurrentPrincipalAccessor { get; }
protected WebAssemblyCachedApplicationConfigurationClient WebAssemblyCachedApplicationConfigurationClient { get; }
public RemoteAuthenticationStateProvider(
ICurrentPrincipalAccessor currentPrincipalAccessor,
WebAssemblyCachedApplicationConfigurationClient webAssemblyCachedApplicationConfigurationClient)
{
CurrentPrincipalAccessor = currentPrincipalAccessor;
WebAssemblyCachedApplicationConfigurationClient = webAssemblyCachedApplicationConfigurationClient;
}
public async override Task<AuthenticationState> GetAuthenticationStateAsync()
{
if (CurrentPrincipalAccessor.Principal.Identity == null ||
!CurrentPrincipalAccessor.Principal.Identity.IsAuthenticated)
{
await WebAssemblyCachedApplicationConfigurationClient.InitializeAsync();
}
return new AuthenticationState(CurrentPrincipalAccessor.Principal);
}
}

89
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/RemoteCurrentPrincipalAccessor.cs

@ -0,0 +1,89 @@
using System.Collections.Generic;
using System.Security.Claims;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Security.Claims;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
public class RemoteCurrentPrincipalAccessor : CurrentPrincipalAccessorBase, ITransientDependency
{
protected ApplicationConfigurationCache ApplicationConfigurationCache { get; }
public RemoteCurrentPrincipalAccessor(ApplicationConfigurationCache applicationConfigurationCache)
{
ApplicationConfigurationCache = applicationConfigurationCache;
}
protected override ClaimsPrincipal GetClaimsPrincipal()
{
var applicationConfiguration = ApplicationConfigurationCache.Get();
if (applicationConfiguration == null || !applicationConfiguration.CurrentUser.IsAuthenticated)
{
return new ClaimsPrincipal(new ClaimsIdentity());
}
var claims = new List<Claim>()
{
new Claim(AbpClaimTypes.UserId, applicationConfiguration.CurrentUser.Id.ToString()!),
};
if (applicationConfiguration.CurrentUser.TenantId != null)
{
claims.Add(new Claim(AbpClaimTypes.TenantId, applicationConfiguration.CurrentUser.TenantId.ToString()!));
}
if (applicationConfiguration.CurrentUser.ImpersonatorUserId != null)
{
claims.Add(new Claim(AbpClaimTypes.ImpersonatorUserId, applicationConfiguration.CurrentUser.ImpersonatorUserId.ToString()!));
}
if (applicationConfiguration.CurrentUser.ImpersonatorTenantId != null)
{
claims.Add(new Claim(AbpClaimTypes.ImpersonatorTenantId, applicationConfiguration.CurrentUser.ImpersonatorTenantId.ToString()!));
}
if (applicationConfiguration.CurrentUser.ImpersonatorUserName != null)
{
claims.Add(new Claim(AbpClaimTypes.ImpersonatorUserName, applicationConfiguration.CurrentUser.ImpersonatorUserName));
}
if (applicationConfiguration.CurrentUser.ImpersonatorTenantName != null)
{
claims.Add(new Claim(AbpClaimTypes.ImpersonatorTenantName, applicationConfiguration.CurrentUser.ImpersonatorTenantName));
}
if (applicationConfiguration.CurrentUser.UserName != null)
{
claims.Add(new Claim(AbpClaimTypes.UserName, applicationConfiguration.CurrentUser.UserName));
}
if (applicationConfiguration.CurrentUser.Name != null)
{
claims.Add(new Claim(AbpClaimTypes.Name, applicationConfiguration.CurrentUser.Name));
}
if (applicationConfiguration.CurrentUser.SurName != null)
{
claims.Add(new Claim(AbpClaimTypes.SurName, applicationConfiguration.CurrentUser.SurName));
}
if (applicationConfiguration.CurrentUser.Email != null)
{
claims.Add(new Claim(AbpClaimTypes.Email, applicationConfiguration.CurrentUser.Email));
}
if (applicationConfiguration.CurrentUser.EmailVerified)
{
claims.Add(new Claim(AbpClaimTypes.EmailVerified, applicationConfiguration.CurrentUser.EmailVerified.ToString()));
}
if (applicationConfiguration.CurrentUser.PhoneNumber != null)
{
claims.Add(new Claim(AbpClaimTypes.PhoneNumber, applicationConfiguration.CurrentUser.PhoneNumber));
}
if (applicationConfiguration.CurrentUser.PhoneNumberVerified)
{
claims.Add(new Claim(AbpClaimTypes.PhoneNumberVerified, applicationConfiguration.CurrentUser.PhoneNumberVerified.ToString()));
}
if (!applicationConfiguration.CurrentUser.Roles.IsNullOrEmpty())
{
foreach (var role in applicationConfiguration.CurrentUser.Roles)
{
claims.Add(new Claim(AbpClaimTypes.Role, role));
}
}
return new ClaimsPrincipal(new ClaimsIdentity(claims, authenticationType: nameof(RemoteCurrentPrincipalAccessor)));
}
}

18
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebApp/WebAppAdditionalAssembliesHelper.cs

@ -0,0 +1,18 @@
using System.Linq;
using System.Reflection;
using Volo.Abp.Modularity;
namespace Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
public static class WebAppAdditionalAssembliesHelper
{
public static Assembly[] GetAssemblies<TModule>()
where TModule : IAbpModule
{
return AbpModuleHelper.FindAllModuleTypes(typeof(TModule), null)
.Where(t => t.Name.Contains("Blazor") || t.Name.Contains("WebAssembly"))
.Select(t => t.Assembly)
.Distinct()
.ToArray();
}
}

7
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/WebAssemblyCachedApplicationConfigurationClient.cs

@ -1,5 +1,4 @@
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Authorization;
using Volo.Abp.AspNetCore.Components.Web.Security; using Volo.Abp.AspNetCore.Components.Web.Security;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies; using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies;
@ -21,22 +20,18 @@ public class WebAssemblyCachedApplicationConfigurationClient : ICachedApplicatio
protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; } protected ApplicationConfigurationChangedService ApplicationConfigurationChangedService { get; }
protected AuthenticationStateProvider AuthenticationStateProvider { get; }
public WebAssemblyCachedApplicationConfigurationClient( public WebAssemblyCachedApplicationConfigurationClient(
AbpApplicationConfigurationClientProxy applicationConfigurationClientProxy, AbpApplicationConfigurationClientProxy applicationConfigurationClientProxy,
ApplicationConfigurationCache cache, ApplicationConfigurationCache cache,
ICurrentTenantAccessor currentTenantAccessor, ICurrentTenantAccessor currentTenantAccessor,
AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy, AbpApplicationLocalizationClientProxy applicationLocalizationClientProxy,
ApplicationConfigurationChangedService applicationConfigurationChangedService, ApplicationConfigurationChangedService applicationConfigurationChangedService)
AuthenticationStateProvider authenticationStateProvider)
{ {
ApplicationConfigurationClientProxy = applicationConfigurationClientProxy; ApplicationConfigurationClientProxy = applicationConfigurationClientProxy;
Cache = cache; Cache = cache;
CurrentTenantAccessor = currentTenantAccessor; CurrentTenantAccessor = currentTenantAccessor;
ApplicationLocalizationClientProxy = applicationLocalizationClientProxy; ApplicationLocalizationClientProxy = applicationLocalizationClientProxy;
ApplicationConfigurationChangedService = applicationConfigurationChangedService; ApplicationConfigurationChangedService = applicationConfigurationChangedService;
AuthenticationStateProvider = authenticationStateProvider;
} }
public virtual async Task InitializeAsync() public virtual async Task InitializeAsync()

2
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Middleware/AbpMiddlewareBase.cs

@ -7,7 +7,7 @@ namespace Volo.Abp.AspNetCore.Middleware;
public abstract class AbpMiddlewareBase : IMiddleware public abstract class AbpMiddlewareBase : IMiddleware
{ {
protected Task<bool> ShouldSkipAsync(HttpContext context, RequestDelegate next) protected virtual Task<bool> ShouldSkipAsync(HttpContext context, RequestDelegate next)
{ {
var endpoint = context.GetEndpoint(); var endpoint = context.GetEndpoint();
var controllerActionDescriptor = endpoint?.Metadata.GetMetadata<ControllerActionDescriptor>(); var controllerActionDescriptor = endpoint?.Metadata.GetMetadata<ControllerActionDescriptor>();

15
framework/src/Volo.Abp.AspNetCore/Volo/Abp/AspNetCore/Uow/AbpUnitOfWorkMiddleware.cs

@ -1,6 +1,7 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.Endpoints;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.Middleware; using Volo.Abp.AspNetCore.Middleware;
@ -42,4 +43,18 @@ public class AbpUnitOfWorkMiddleware : AbpMiddlewareBase, ITransientDependency
return context.Request.Path.Value != null && return context.Request.Path.Value != null &&
_options.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x, StringComparison.OrdinalIgnoreCase)); _options.IgnoredUrls.Any(x => context.Request.Path.Value.StartsWith(x, StringComparison.OrdinalIgnoreCase));
} }
protected async override Task<bool> ShouldSkipAsync(HttpContext context, RequestDelegate next)
{
// Blazor components will render concurrently, so we need to skip the middleware for them.
// Otherwise, We will get the following exception:
// A second operation started on this context before a previous operation completed.
// This is usually caused by different threads using the same instance of DbContext.
if (context.GetEndpoint()?.Metadata?.GetMetadata<RootComponentMetadata>() != null)
{
return true;
}
return await base.ShouldSkipAsync(context, next);
}
} }

7
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundleConfig.cs

@ -1,11 +1,14 @@
using System.Collections.Generic; using Volo.Abp.Bundling;
using Volo.Abp.Bundling;
namespace Volo.Abp.Cli.Bundling; namespace Volo.Abp.Cli.Bundling;
public class BundleConfig public class BundleConfig
{ {
public bool IsBlazorWebApp { get; set; } = false;
public BundlingMode Mode { get; set; } = BundlingMode.BundleAndMinify; public BundlingMode Mode { get; set; } = BundlingMode.BundleAndMinify;
public string Name { get; set; } = "global"; public string Name { get; set; } = "global";
public BundleParameterDictionary Parameters { get; set; } = new(); public BundleParameterDictionary Parameters { get; set; } = new();
} }

47
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Bundling/BundlingService.cs

@ -32,7 +32,7 @@ public class BundlingService : IBundlingService, ITransientDependency
public async Task BundleAsync(string directory, bool forceBuild, string projectType = BundlingConsts.WebAssembly) public async Task BundleAsync(string directory, bool forceBuild, string projectType = BundlingConsts.WebAssembly)
{ {
if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && projectType == BundlingConsts.MauiBlazor) if(RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && projectType == BundlingConsts.MauiBlazor)
{ {
Logger.LogWarning("ABP bundle command does not support OSX for MAUI Blazor"); Logger.LogWarning("ABP bundle command does not support OSX for MAUI Blazor");
return; return;
@ -59,7 +59,7 @@ public class BundlingService : IBundlingService, ITransientDependency
new DotNetProjectInfo(string.Empty, projectFilePath, true) new DotNetProjectInfo(string.Empty, projectFilePath, true)
}; };
DotNetProjectBuilder.BuildProjects(projects, string.Empty); DotNetProjectBuilder.BuildProjects(projects, string.Empty);
} }
var frameworkVersion = GetTargetFrameworkVersion(projectFilePath, projectType); var frameworkVersion = GetTargetFrameworkVersion(projectFilePath, projectType);
@ -71,8 +71,8 @@ public class BundlingService : IBundlingService, ITransientDependency
FindBundleContributorsRecursively(startupModule, 0, bundleDefinitions); FindBundleContributorsRecursively(startupModule, 0, bundleDefinitions);
bundleDefinitions = bundleDefinitions.OrderByDescending(t => t.Level).ToList(); bundleDefinitions = bundleDefinitions.OrderByDescending(t => t.Level).ToList();
var styleContext = GetStyleContext(bundleDefinitions, bundleConfig.Parameters); var styleContext = GetStyleContext(bundleDefinitions, bundleConfig);
var scriptContext = GetScriptContext(bundleDefinitions, bundleConfig.Parameters, projectType); var scriptContext = GetScriptContext(bundleDefinitions, bundleConfig, projectType);
string styleDefinitions; string styleDefinitions;
string scriptDefinitions; string scriptDefinitions;
@ -104,25 +104,29 @@ public class BundlingService : IBundlingService, ITransientDependency
scriptDefinitions = GenerateScriptDefinitions(scriptContext); scriptDefinitions = GenerateScriptDefinitions(scriptContext);
} }
await UpdateDependenciesInHtmlFileAsync(directory, styleDefinitions, scriptDefinitions); var fileName = bundleConfig.IsBlazorWebApp
Logger.LogInformation("Script and style references in the index.html file have been updated."); ? Path.Combine(directory.RemovePostFix(".Client")!, "Components", "App.razor")
: Path.Combine(PathHelper.GetWwwRootPath(directory), "index.html");
await UpdateDependenciesInBlazorFileAsync(fileName, styleDefinitions, scriptDefinitions);
Logger.LogInformation($"Script and style references in the {fileName} file have been updated.");
} }
private BundleContext GetScriptContext(List<BundleTypeDefinition> bundleDefinitions, private BundleContext GetScriptContext(List<BundleTypeDefinition> bundleDefinitions, BundleConfig bundleConfig, string projectType)
BundleParameterDictionary parameters, string projectType)
{ {
var scriptContext = new BundleContext var scriptContext = new BundleContext
{ {
Parameters = parameters Parameters = bundleConfig.Parameters
}; };
if (projectType == BundlingConsts.WebAssembly) if (projectType == BundlingConsts.WebAssembly && !bundleConfig.IsBlazorWebApp)
{ {
scriptContext.BundleDefinitions.AddIfNotContains( scriptContext.BundleDefinitions.AddIfNotContains(
x => x.Source == "_framework/blazor.webassembly.js", x => x.Source == "_framework/blazor.webassembly.js",
() => new BundleDefinition { Source = "_framework/blazor.webassembly.js" }); () => new BundleDefinition { Source = "_framework/blazor.webassembly.js" });
} }
foreach (var bundleDefinition in bundleDefinitions) foreach (var bundleDefinition in bundleDefinitions)
{ {
var contributor = CreateContributorInstance(bundleDefinition.BundleContributorType); var contributor = CreateContributorInstance(bundleDefinition.BundleContributorType);
@ -132,12 +136,11 @@ public class BundlingService : IBundlingService, ITransientDependency
return scriptContext; return scriptContext;
} }
private BundleContext GetStyleContext(List<BundleTypeDefinition> bundleDefinitions, private BundleContext GetStyleContext(List<BundleTypeDefinition> bundleDefinitions, BundleConfig bundleConfig)
BundleParameterDictionary parameters)
{ {
var styleContext = new BundleContext var styleContext = new BundleContext
{ {
Parameters = parameters Parameters = bundleConfig.Parameters
}; };
foreach (var bundleDefinition in bundleDefinitions) foreach (var bundleDefinition in bundleDefinitions)
@ -149,18 +152,16 @@ public class BundlingService : IBundlingService, ITransientDependency
return styleContext; return styleContext;
} }
private async Task UpdateDependenciesInHtmlFileAsync(string directory, string styleDefinitions, private async Task UpdateDependenciesInBlazorFileAsync(string fileName, string styleDefinitions, string scriptDefinitions)
string scriptDefinitions)
{ {
var htmlFilePath = Path.Combine(PathHelper.GetWwwRootPath(directory), "index.html"); if (!File.Exists(fileName))
if (!File.Exists(htmlFilePath))
{ {
throw new BundlingException($"index.html file could not be found in the following path:{htmlFilePath}"); throw new BundlingException($"{fileName} file could not be found.");
} }
Encoding fileEncoding; Encoding fileEncoding;
string content; string content;
using (var reader = new StreamReader(htmlFilePath, true)) using (var reader = new StreamReader(fileName, true))
{ {
fileEncoding = reader.CurrentEncoding; fileEncoding = reader.CurrentEncoding;
content = await reader.ReadToEndAsync(); content = await reader.ReadToEndAsync();
@ -171,7 +172,7 @@ public class BundlingService : IBundlingService, ITransientDependency
content = UpdatePlaceholders(content, BundlingConsts.ScriptPlaceholderStart, content = UpdatePlaceholders(content, BundlingConsts.ScriptPlaceholderStart,
BundlingConsts.ScriptPlaceholderEnd, scriptDefinitions); BundlingConsts.ScriptPlaceholderEnd, scriptDefinitions);
using (var writer = new StreamWriter(htmlFilePath, false, fileEncoding)) using (var writer = new StreamWriter(fileName, false, fileEncoding))
{ {
await writer.WriteAsync(content); await writer.WriteAsync(content);
await writer.FlushAsync(); await writer.FlushAsync();
@ -312,7 +313,7 @@ public class BundlingService : IBundlingService, ITransientDependency
document.Load(projectFilePath); document.Load(projectFilePath);
var sdk = document.DocumentElement.GetAttribute("Sdk"); var sdk = document.DocumentElement.GetAttribute("Sdk");
switch (projectType) switch (projectType)
{ {
case BundlingConsts.WebAssembly: case BundlingConsts.WebAssembly:

14
framework/src/Volo.Abp.Core/Volo/Abp/Modularity/AbpModuleHelper.cs

@ -6,12 +6,12 @@ using Microsoft.Extensions.Logging;
namespace Volo.Abp.Modularity; namespace Volo.Abp.Modularity;
internal static class AbpModuleHelper public static class AbpModuleHelper
{ {
public static List<Type> FindAllModuleTypes(Type startupModuleType, ILogger logger) public static List<Type> FindAllModuleTypes(Type startupModuleType, ILogger? logger)
{ {
var moduleTypes = new List<Type>(); var moduleTypes = new List<Type>();
logger.Log(LogLevel.Information, "Loaded ABP modules:"); logger?.Log(LogLevel.Information, "Loaded ABP modules:");
AddModuleAndDependenciesRecursively(moduleTypes, startupModuleType, logger); AddModuleAndDependenciesRecursively(moduleTypes, startupModuleType, logger);
return moduleTypes; return moduleTypes;
} }
@ -36,7 +36,7 @@ internal static class AbpModuleHelper
return dependencies; return dependencies;
} }
public static Assembly[] GetAllAssemblies(Type moduleType) public static Assembly[] GetAllAssemblies(Type moduleType)
{ {
var assemblies = new List<Assembly>(); var assemblies = new List<Assembly>();
@ -52,7 +52,7 @@ internal static class AbpModuleHelper
assemblies.AddIfNotContains(assembly); assemblies.AddIfNotContains(assembly);
} }
} }
assemblies.Add(moduleType.Assembly); assemblies.Add(moduleType.Assembly);
return assemblies.ToArray(); return assemblies.ToArray();
@ -61,7 +61,7 @@ internal static class AbpModuleHelper
private static void AddModuleAndDependenciesRecursively( private static void AddModuleAndDependenciesRecursively(
List<Type> moduleTypes, List<Type> moduleTypes,
Type moduleType, Type moduleType,
ILogger logger, ILogger? logger,
int depth = 0) int depth = 0)
{ {
AbpModule.CheckAbpModuleType(moduleType); AbpModule.CheckAbpModuleType(moduleType);
@ -72,7 +72,7 @@ internal static class AbpModuleHelper
} }
moduleTypes.Add(moduleType); moduleTypes.Add(moduleType);
logger.Log(LogLevel.Information, $"{new string(' ', depth * 2)}- {moduleType.FullName}"); logger?.Log(LogLevel.Information, $"{new string(' ', depth * 2)}- {moduleType.FullName}");
foreach (var dependedModuleType in FindDependedModuleTypes(moduleType)) foreach (var dependedModuleType in FindDependedModuleTypes(moduleType))
{ {

21
templates/app/aspnet-core/MyCompanyName.MyProjectName.sln

@ -55,6 +55,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.Blazor.Server.Tiered", "src\MyCompanyName.MyProjectName.Blazor.Server.Tiered\MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj", "{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.Blazor.Server.Tiered", "src\MyCompanyName.MyProjectName.Blazor.Server.Tiered\MyCompanyName.MyProjectName.Blazor.Server.Tiered.csproj", "{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.Blazor.Client", "src\MyCompanyName.MyProjectName.Blazor.Client\MyCompanyName.MyProjectName.Blazor.Client.csproj", "{188A64AD-A1A7-4F95-85D1-C935594611B7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.Blazor.Server.WebApp", "src\MyCompanyName.MyProjectName.Blazor.Server.WebApp\MyCompanyName.MyProjectName.Blazor.Server.WebApp.csproj", "{14882ABF-1EEF-430C-8E72-812B3EE810C4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client", "src\MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client\MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.csproj", "{648460F4-3ECC-4751-9D87-EE25D0B8B2BF}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -157,6 +163,18 @@ Global
{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Debug|Any CPU.Build.0 = Debug|Any CPU {C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Release|Any CPU.ActiveCfg = Release|Any CPU {C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Release|Any CPU.Build.0 = Release|Any CPU {C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA}.Release|Any CPU.Build.0 = Release|Any CPU
{188A64AD-A1A7-4F95-85D1-C935594611B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{188A64AD-A1A7-4F95-85D1-C935594611B7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{188A64AD-A1A7-4F95-85D1-C935594611B7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{188A64AD-A1A7-4F95-85D1-C935594611B7}.Release|Any CPU.Build.0 = Release|Any CPU
{14882ABF-1EEF-430C-8E72-812B3EE810C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{14882ABF-1EEF-430C-8E72-812B3EE810C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{14882ABF-1EEF-430C-8E72-812B3EE810C4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{14882ABF-1EEF-430C-8E72-812B3EE810C4}.Release|Any CPU.Build.0 = Release|Any CPU
{648460F4-3ECC-4751-9D87-EE25D0B8B2BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{648460F4-3ECC-4751-9D87-EE25D0B8B2BF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{648460F4-3ECC-4751-9D87-EE25D0B8B2BF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{648460F4-3ECC-4751-9D87-EE25D0B8B2BF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -186,6 +204,9 @@ Global
{27B2DDC7-8B75-4322-A312-25419C15D9D8} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} {27B2DDC7-8B75-4322-A312-25419C15D9D8} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{16F0BF4E-7D73-4278-8D9A-7CDE37105C6B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} {16F0BF4E-7D73-4278-8D9A-7CDE37105C6B} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0} {C9F40C93-3DD0-4D6E-B98E-45A6F50FACDA} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{188A64AD-A1A7-4F95-85D1-C935594611B7} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{14882ABF-1EEF-430C-8E72-812B3EE810C4} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{648460F4-3ECC-4751-9D87-EE25D0B8B2BF} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenuContributor.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Menus/MyProjectNameMenuContributor.cs

@ -1,7 +1,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Localization; using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy; using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Account.Localization; using Volo.Abp.Account.Localization;
@ -10,9 +9,8 @@ using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus; using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation; using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation; using Volo.Abp.UI.Navigation;
using Volo.Abp.Users;
namespace MyCompanyName.MyProjectName.Blazor.Menus; namespace MyCompanyName.MyProjectName.Blazor.Client.Menus;
public class MyProjectNameMenuContributor : IMenuContributor public class MyProjectNameMenuContributor : IMenuContributor
{ {

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Menus/MyProjectNameMenus.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Menus/MyProjectNameMenus.cs

@ -1,4 +1,4 @@
namespace MyCompanyName.MyProjectName.Blazor.Menus; namespace MyCompanyName.MyProjectName.Blazor.Client.Menus;
public class MyProjectNameMenus public class MyProjectNameMenus
{ {

50
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyCompanyName.MyProjectName.Blazor.Client.csproj

@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<!-- <TEMPLATE-REMOVE IF-NOT='PWA'> -->
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<!-- </TEMPLATE-REMOVE> -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap5" Version="1.4.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<!-- <TEMPLATE-REMOVE> -->
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel.WebAssembly\Volo.Abp.Http.Client.IdentityModel.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" />
<!-- </TEMPLATE-REMOVE> -->
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme" Version="3.0.*-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.WebAssembly\Volo.Abp.Identity.Blazor.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.WebAssembly\Volo.Abp.TenantManagement.Blazor.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Blazor.WebAssembly\Volo.Abp.SettingManagement.Blazor.WebAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" />
</ItemGroup>
<!-- <TEMPLATE-REMOVE IF-NOT='PWA'> -->
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
<!-- </TEMPLATE-REMOVE> -->
</Project>

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorAutoMapperProfile.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorAutoMapperProfile.cs

@ -1,6 +1,6 @@
using AutoMapper; using AutoMapper;
namespace MyCompanyName.MyProjectName.Blazor; namespace MyCompanyName.MyProjectName.Blazor.Client;
public class MyProjectNameBlazorAutoMapperProfile : Profile public class MyProjectNameBlazorAutoMapperProfile : Profile
{ {

26
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBlazorClientModule.cs

@ -5,21 +5,19 @@ using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using MyCompanyName.MyProjectName.Blazor.Menus; using MyCompanyName.MyProjectName.Blazor.Client.Menus;
using OpenIddict.Abstractions; using OpenIddict.Abstractions;
using Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing; using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme;
using Volo.Abp.Autofac.WebAssembly; using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.Identity.Blazor.WebAssembly; using Volo.Abp.Identity.Blazor.WebAssembly;
using Volo.Abp.Security.Claims; using Volo.Abp.Modularity;
using Volo.Abp.SettingManagement.Blazor.WebAssembly; using Volo.Abp.SettingManagement.Blazor.WebAssembly;
using Volo.Abp.TenantManagement.Blazor.WebAssembly; using Volo.Abp.TenantManagement.Blazor.WebAssembly;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor; namespace MyCompanyName.MyProjectName.Blazor.Client;
[DependsOn( [DependsOn(
typeof(AbpAutofacWebAssemblyModule), typeof(AbpAutofacWebAssemblyModule),
@ -29,7 +27,7 @@ namespace MyCompanyName.MyProjectName.Blazor;
typeof(AbpTenantManagementBlazorWebAssemblyModule), typeof(AbpTenantManagementBlazorWebAssemblyModule),
typeof(AbpSettingManagementBlazorWebAssemblyModule) typeof(AbpSettingManagementBlazorWebAssemblyModule)
)] )]
public class MyProjectNameBlazorModule : AbpModule public class MyProjectNameBlazorClientModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
{ {
@ -40,7 +38,6 @@ public class MyProjectNameBlazorModule : AbpModule
ConfigureHttpClient(context, environment); ConfigureHttpClient(context, environment);
ConfigureBlazorise(context); ConfigureBlazorise(context);
ConfigureRouter(context); ConfigureRouter(context);
ConfigureUI(builder);
ConfigureMenu(context); ConfigureMenu(context);
ConfigureAutoMapper(context); ConfigureAutoMapper(context);
} }
@ -49,7 +46,7 @@ public class MyProjectNameBlazorModule : AbpModule
{ {
Configure<AbpRouterOptions>(options => Configure<AbpRouterOptions>(options =>
{ {
options.AppAssembly = typeof(MyProjectNameBlazorModule).Assembly; options.AppAssembly = typeof(MyProjectNameBlazorClientModule).Assembly;
}); });
} }
@ -70,6 +67,7 @@ public class MyProjectNameBlazorModule : AbpModule
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) private static void ConfigureAuthentication(WebAssemblyHostBuilder builder)
{ {
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddOidcAuthentication(options => builder.Services.AddOidcAuthentication(options =>
{ {
builder.Configuration.Bind("AuthServer", options.ProviderOptions); builder.Configuration.Bind("AuthServer", options.ProviderOptions);
@ -83,12 +81,6 @@ public class MyProjectNameBlazorModule : AbpModule
}); });
} }
private static void ConfigureUI(WebAssemblyHostBuilder builder)
{
builder.RootComponents.Add<App>("#ApplicationContainer");
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment) private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)
{ {
context.Services.AddTransient(sp => new HttpClient context.Services.AddTransient(sp => new HttpClient
@ -101,7 +93,7 @@ public class MyProjectNameBlazorModule : AbpModule
{ {
Configure<AbpAutoMapperOptions>(options => Configure<AbpAutoMapperOptions>(options =>
{ {
options.AddMaps<MyProjectNameBlazorModule>(); options.AddMaps<MyProjectNameBlazorClientModule>();
}); });
} }
} }

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBrandingProvider.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBrandingProvider.cs

@ -1,7 +1,7 @@
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding; using Volo.Abp.Ui.Branding;
namespace MyCompanyName.MyProjectName.Blazor; namespace MyCompanyName.MyProjectName.Blazor.Client;
[Dependency(ReplaceServices = true)] [Dependency(ReplaceServices = true)]
public class MyProjectNameBrandingProvider : DefaultBrandingProvider public class MyProjectNameBrandingProvider : DefaultBrandingProvider

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBundleContributor.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameBundleContributor.cs

@ -1,6 +1,6 @@
using Volo.Abp.Bundling; using Volo.Abp.Bundling;
namespace MyCompanyName.MyProjectName.Blazor; namespace MyCompanyName.MyProjectName.Blazor.Client;
/* Add your global styles/scripts here. /* Add your global styles/scripts here.
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it * See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameComponentBase.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/MyProjectNameComponentBase.cs

@ -1,7 +1,7 @@
using MyCompanyName.MyProjectName.Localization; using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.AspNetCore.Components; using Volo.Abp.AspNetCore.Components;
namespace MyCompanyName.MyProjectName.Blazor; namespace MyCompanyName.MyProjectName.Blazor.Client;
public abstract class MyProjectNameComponentBase : AbpComponentBase public abstract class MyProjectNameComponentBase : AbpComponentBase
{ {

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor

@ -1,7 +1,6 @@
@page "/" @page "/"
@using Volo.Abp.MultiTenancy @using Volo.Abp.MultiTenancy
@inherits MyProjectNameComponentBase @inherits MyProjectNameComponentBase
@inject AuthenticationStateProvider AuthenticationStateProvider
<div class="container"> <div class="container">
<div class="p-5 text-center"> <div class="p-5 text-center">
<Badge Color="Color.Success" class="mb-4"> <Badge Color="Color.Success" class="mb-4">

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor.cs

@ -0,0 +1,6 @@
namespace MyCompanyName.MyProjectName.Blazor.Client.Pages;
public partial class Index
{
}

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor.css → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Pages/Index.razor.css

22
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Program.cs

@ -0,0 +1,22 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
namespace MyCompanyName.MyProjectName.Blazor.Client;
public class Program
{
public async static Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
var application = await builder.AddApplicationAsync<MyProjectNameBlazorClientModule>(options =>
{
options.UseAutofac();
});
var host = builder.Build();
await application.InitializeApplicationAsync(host.Services);
await host.RunAsync();
}
}

12
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/Routes.razor

@ -0,0 +1,12 @@
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.WebAssembly.WebApp
<Router AppAssembly="typeof(Program).Assembly" AdditionalAssemblies="WebAppAdditionalAssembliesHelper.GetAssemblies<MyProjectNameBlazorClientModule>()">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>

15
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/_Imports.razor

@ -0,0 +1,15 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop
@using Volo.Abp.AspNetCore.Components.Web
@using MyCompanyName.MyProjectName.Blazor
@using Blazorise
@using Blazorise.DataGrid
@using Volo.Abp.BlazoriseUI
@using Volo.Abp.BlazoriseUI.Components

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/appsettings.Development.json → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/appsettings.Development.json

1
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/appsettings.json → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/appsettings.json

@ -16,6 +16,7 @@
"Bundle": { "Bundle": {
"Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */ "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */
"Name": "global", "Name": "global",
"IsBlazorWebApp": true,
"Parameters": { "Parameters": {
} }

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/favicon.ico → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/favicon.ico

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

40
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.css → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/global.css

File diff suppressed because one or more lines are too long

38
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/global.js → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/global.js

File diff suppressed because one or more lines are too long

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-192.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/icon-192.png

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/icon-512.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/icon-512.png

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/images/logo/leptonx/logo-dark.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-dark.png

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/images/logo/leptonx/logo-light-thumbnail.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-light-thumbnail.png

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/images/logo/leptonx/logo-light.png → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/images/logo/leptonx/logo-light.png

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/main.css → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/main.css

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/manifest.json → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/manifest.json

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.js → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/service-worker.js

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/wwwroot/service-worker.published.js → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Client/wwwroot/service-worker.published.js

45
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/App.razor

@ -0,0 +1,45 @@
@using Volo.Abp.Localization
@using System.Globalization
@using Microsoft.Extensions.Hosting
@using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@inject IHostEnvironment Env
@{
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="/" />
<AbpStyles BundleName="@BlazorLeptonXLiteThemeBundles.Styles.Global" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveServer" />
<AbpScripts BundleName="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
<div id="blazor-error-ui">
@if (Env.IsDevelopment())
{
<text>An unhandled exception has occurred. See browser dev tools for details.</text>
}
else if (Env.IsStaging() || Env.IsProduction())
{
<text>An error has occurred. This application may no longer respond until reloaded.</text>
}
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
</body>
</html>

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor.cs → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor.cs

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor.css → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Pages/Index.razor.css

14
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Components/Routes.razor

@ -0,0 +1,14 @@
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Web.Theming.Routing
@using Microsoft.Extensions.Options
@inject IOptions<AbpRouterOptions> RouterOptions
<Router AppAssembly="typeof(Program).Assembly" AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>

20
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/MyProjectNameBlazorModule.cs

@ -12,14 +12,17 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.IdentityModel.Protocols.OpenIdConnect; using Microsoft.IdentityModel.Protocols.OpenIdConnect;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using MyCompanyName.MyProjectName.Blazor.Server.Tiered.Components;
using MyCompanyName.MyProjectName.Blazor.Server.Tiered.Menus; using MyCompanyName.MyProjectName.Blazor.Server.Tiered.Menus;
using MyCompanyName.MyProjectName.Localization; using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy; using MyCompanyName.MyProjectName.MultiTenancy;
using StackExchange.Redis; using StackExchange.Redis;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect; using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
using Volo.Abp.AspNetCore.Components.Server;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme; using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling; using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite; using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
@ -84,6 +87,11 @@ public class MyProjectNameBlazorModule : AbpModule
typeof(MyProjectNameBlazorModule).Assembly typeof(MyProjectNameBlazorModule).Assembly
); );
}); });
PreConfigure<AbpAspNetCoreComponentsWebOptions>(options =>
{
options.IsBlazorWebApp = true;
});
} }
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
@ -91,6 +99,10 @@ public class MyProjectNameBlazorModule : AbpModule
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
// Add services to the container.
context.Services.AddRazorComponents()
.AddInteractiveServerComponents();
ConfigureUrls(configuration); ConfigureUrls(configuration);
ConfigureCache(); ConfigureCache();
ConfigureBundles(); ConfigureBundles();
@ -358,6 +370,7 @@ public class MyProjectNameBlazorModule : AbpModule
app.UseMultiTenancy(); app.UseMultiTenancy();
} }
app.UseDynamicClaims(); app.UseDynamicClaims();
app.UseAntiforgery();
app.UseAuthorization(); app.UseAuthorization();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseAbpSwaggerUI(options =>
@ -365,6 +378,11 @@ public class MyProjectNameBlazorModule : AbpModule
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API"); options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API");
}); });
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints(); app.UseConfiguredEndpoints(builder =>
{
builder.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(builder.ServiceProvider.GetRequiredService<IOptions<AbpRouterOptions>>().Value.AdditionalAssemblies.ToArray());
});
} }
} }

39
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml

@ -1,39 +0,0 @@
@page "/"
@namespace MyCompanyName.MyProjectName.Blazor.Server.Tiered.Pages
@using System.Globalization
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.Localization
@{
Layout = null;
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="~/" />
<abp-style-bundle name="@BlazorLeptonXLiteThemeBundles.Styles.Global"/>
</head>
<body class="abp-application-layout bg-light @rtl">
<component type="typeof(App)" render-mode="Server" />
<div id="blazor-error-ui">
<environment include="Staging,Production">
An error has occurred. This application may no longer respond until reloaded.
</environment>
<environment include="Development">
An unhandled exception has occurred. See browser dev tools for details.
</environment>
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
<abp-script-bundle name="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
</body>
</html>

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_ViewImports.cshtml

@ -1,4 +0,0 @@
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap
@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/_Imports.razor

@ -5,9 +5,10 @@
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web @using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization @using Microsoft.AspNetCore.Components.Web.Virtualization
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop @using Microsoft.JSInterop
@using MyCompanyName.MyProjectName.Blazor.Server.Tiered @using MyCompanyName.MyProjectName.Blazor.Server.Tiered
@using Blazorise @using Blazorise
@using Blazorise.DataGrid @using Blazorise.DataGrid
@using Volo.Abp.BlazoriseUI @using Volo.Abp.BlazoriseUI
@using Volo.Abp.BlazoriseUI.Components @using Volo.Abp.BlazoriseUI.Components

83
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Menus/MyProjectNameMenuContributor.cs

@ -0,0 +1,83 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Account.Localization;
using Volo.Abp.Authorization.Permissions;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.Menus;
public class MyProjectNameMenuContributor : IMenuContributor
{
private readonly IConfiguration _configuration;
public MyProjectNameMenuContributor(IConfiguration configuration)
{
_configuration = configuration;
}
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
else if (context.Menu.Name == StandardMenus.User)
{
await ConfigureUserMenuAsync(context);
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(
0,
new ApplicationMenuItem(
MyProjectNameMenus.Home,
l["Menu:Home"],
"/",
icon: "fas fa-home"
)
);
var administration = context.Menu.GetAdministration();
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3);
return Task.CompletedTask;
}
private Task ConfigureUserMenuAsync(MenuConfigurationContext context)
{
var accountStringLocalizer = context.GetLocalizer<AccountResource>();
var authServerUrl = _configuration["AuthServer:Authority"] ?? "";
context.Menu.AddItem(new ApplicationMenuItem(
"Account.Manage",
accountStringLocalizer["MyAccount"],
$"{authServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}",
icon: "fa fa-cog",
order: 1000,
null).RequireAuthenticated());
return Task.CompletedTask;
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Menus/MyProjectNameMenus.cs

@ -0,0 +1,10 @@
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.Menus;
public class MyProjectNameMenus
{
private const string Prefix = "MyProjectName";
public const string Home = Prefix + ".Home";
//Add your menu items here...
}

50
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.csproj

@ -0,0 +1,50 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData>
<!-- <TEMPLATE-REMOVE IF-NOT='PWA'> -->
<ServiceWorkerAssetsManifest>service-worker-assets.js</ServiceWorkerAssetsManifest>
<!-- </TEMPLATE-REMOVE> -->
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Blazorise.Bootstrap5" Version="1.4.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.1" />
</ItemGroup>
<ItemGroup>
<!-- <TEMPLATE-REMOVE> -->
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.WebAssembly.Theming\Volo.Abp.AspNetCore.Components.WebAssembly.Theming.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Http.Client.IdentityModel.WebAssembly\Volo.Abp.Http.Client.IdentityModel.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" />
<!-- </TEMPLATE-REMOVE> -->
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme" Version="3.0.*-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac.WebAssembly\Volo.Abp.Autofac.WebAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.WebAssembly\Volo.Abp.Identity.Blazor.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.WebAssembly\Volo.Abp.TenantManagement.Blazor.WebAssembly.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Blazor.WebAssembly\Volo.Abp.SettingManagement.Blazor.WebAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\MyCompanyName.MyProjectName.HttpApi.Client\MyCompanyName.MyProjectName.HttpApi.Client.csproj" />
</ItemGroup>
<!-- <TEMPLATE-REMOVE IF-NOT='PWA'> -->
<ItemGroup>
<ServiceWorker Include="wwwroot\service-worker.js" PublishedContent="wwwroot\service-worker.published.js" />
</ItemGroup>
<!-- </TEMPLATE-REMOVE> -->
</Project>

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBlazorAutoMapperProfile.cs

@ -0,0 +1,11 @@
using AutoMapper;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
public class MyProjectNameBlazorAutoMapperProfile : Profile
{
public MyProjectNameBlazorAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Blazor project.
}
}

106
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBlazorClientModule.cs

@ -0,0 +1,106 @@
using System;
using System.Net.Http;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.Menus;
using OpenIddict.Abstractions;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Components.WebAssembly.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.WebAssembly.WebApp;
using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.AutoMapper;
using Volo.Abp.Http.Client.Authentication;
using Volo.Abp.Identity.Blazor.WebAssembly;
using Volo.Abp.Modularity;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement.Blazor.WebAssembly;
using Volo.Abp.TenantManagement.Blazor.WebAssembly;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
[DependsOn(
typeof(AbpAutofacWebAssemblyModule),
typeof(MyProjectNameHttpApiClientModule),
typeof(AbpAspNetCoreComponentsWebAssemblyLeptonXLiteThemeModule),
typeof(AbpIdentityBlazorWebAssemblyModule),
typeof(AbpTenantManagementBlazorWebAssemblyModule),
typeof(AbpSettingManagementBlazorWebAssemblyModule)
)]
public class MyProjectNameBlazorClientModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var environment = context.Services.GetSingletonInstance<IWebAssemblyHostEnvironment>();
var builder = context.Services.GetSingletonInstance<WebAssemblyHostBuilder>();
ConfigureAuthentication(builder);
ConfigureHttpClient(context, environment);
ConfigureBlazorise(context);
ConfigureRouter(context);
ConfigureMenu(context);
ConfigureAutoMapper(context);
}
private void ConfigureRouter(ServiceConfigurationContext context)
{
Configure<AbpRouterOptions>(options =>
{
options.AppAssembly = typeof(MyProjectNameBlazorClientModule).Assembly;
options.AdditionalAssemblies.Add(typeof(MyProjectNameBlazorClientModule).Assembly);
});
}
private void ConfigureMenu(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new MyProjectNameMenuContributor(context.Services.GetConfiguration()));
});
}
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBootstrap5Providers()
.AddFontAwesomeIcons();
}
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder)
{
builder.Services.AddBlazorWebAppServices();
builder.Services.AddCascadingAuthenticationState();
builder.Services.AddOidcAuthentication(options =>
{
builder.Configuration.Bind("AuthServer", options.ProviderOptions);
options.UserOptions.NameClaim = OpenIddictConstants.Claims.Name;
options.UserOptions.RoleClaim = OpenIddictConstants.Claims.Role;
options.ProviderOptions.DefaultScopes.Add("MyProjectName");
options.ProviderOptions.DefaultScopes.Add("roles");
options.ProviderOptions.DefaultScopes.Add("email");
options.ProviderOptions.DefaultScopes.Add("phone");
});
}
private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment)
{
context.Services.AddTransient(sp => new HttpClient
{
BaseAddress = new Uri(environment.BaseAddress)
});
}
private void ConfigureAutoMapper(ServiceConfigurationContext context)
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<MyProjectNameBlazorClientModule>();
});
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBrandingProvider.cs

@ -0,0 +1,10 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
[Dependency(ReplaceServices = true)]
public class MyProjectNameBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "MyProjectName";
}

19
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameBundleContributor.cs

@ -0,0 +1,19 @@
using Volo.Abp.Bundling;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
/* Add your global styles/scripts here.
* See https://docs.abp.io/en/abp/latest/UI/Blazor/Global-Scripts-Styles to learn how to use it
*/
public class MyProjectNameBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{
}
public void AddStyles(BundleContext context)
{
context.Add("main.css", true);
}
}

12
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/MyProjectNameComponentBase.cs

@ -0,0 +1,12 @@
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.AspNetCore.Components;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
public abstract class MyProjectNameComponentBase : AbpComponentBase
{
protected MyProjectNameComponentBase()
{
LocalizationResource = typeof(MyProjectNameResource);
}
}

176
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor

@ -0,0 +1,176 @@
@page "/"
@inherits MyProjectNameComponentBase
@inject AuthenticationStateProvider AuthenticationStateProvider
<div class="container">
<div class="p-5 text-center">
<Badge Color="Color.Success" class="mb-4">
<h5 class="m-1"> <i class="fas fa-rocket"></i> Congratulations, <strong>MyProjectName</strong> is successfully running!</h5>
</Badge>
<h1>Welcome to the Application</h1>
<p class="lead px-lg-5 mx-lg-5">@L["LongWelcomeMessage"]</p>
@if (!CurrentUser.IsAuthenticated)
{
<a class="btn btn-primary" href="Account/Login"><i class="fa fa-sign-in"></i> @L["Login"]</a>
}
</div>
<div class="card">
<div class="card-body">
<div class="row">
<div class="col-md-auto text-center">
<img src="https://abp.io/assets/png/mastering-abp-framework.webp" style="max-width: 400px;" class="w-100 mb-5 my-md-3">
</div>
<div class="col-md d-flex align-items-center">
<div class="pe-0 pe-md-4">
<small class="text-uppercase text-muted">THE OFFICIAL GUIDE</small>
<h2 class="mb-4">Mastering ABP Framework</h2>
<p class="mb-4">Written by the creator of the ABP Framework, this book will help you gain a complete understanding of the framework and modern web application development techniques.</p>
<div class="mb-4">
<a href="https://www.amazon.com/gp/product/B097Z2DM8Q/ref=dbs_a_def_rwt_hsch_vapi_tkin_p1_i0" class="btn btn-success mb-1">
Buy on Amazon US
</a>
<a href="https://www.packtpub.com/product/mastering-abp-framework/9781801079242" class="btn btn-primary mb-1">
Buy on PACKT
</a>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="my-3 text-center">
<h3>Let's improve your application!</h3>
<p>Here are some links to help you get started:</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<div class="row text-center justify-content-md-center">
<div class="col-lg-4">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-book text-secondary d-block my-3 fa-2x"></i> Learn the ABP Framework</h5>
<p>Explore the compherensive documentation to learn how to build a modern web application.</p>
<a href="https://docs.abp.io/en/abp/latest?ref=tmpl" target="_blank" class="btn btn-link px-1">See Documents <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-cubes text-secondary d-block my-3 fa-2x"></i> Samples</h5>
<p>See the example projects built with the ABP Framework.</p>
<a href="https://docs.abp.io/en/abp/latest/Samples/Index?ref=tmpl" target="_blank" class="btn btn-link px-1">All samples <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-users text-secondary d-block my-3 fa-2x"></i> ABP Community</h5>
<p>Get involved with a vibrant community and become a contributor.</p>
<a href="https://community.abp.io/" target="_blank" class="btn btn-link px-1">Community <i class="fas fa-chevron-right"></i></a>
<a href="https://docs.abp.io/en/abp/latest/Contribution/Index?ref=tmpl" target="_blank" class="btn btn-link px-1">Contribute <i class="fas fa-chevron-right"></i></a>
</div>
</div>
</div>
<div class="row text-center mt-lg-3 justify-content-md-center">
<div class="col-lg-4">
<div class="p-4">
<h5 class="mb-3"><i class="fas fa-pen-nib text-secondary d-block my-3 fa-2x"></i> ABP Blog</h5>
<p>Take a look at our recently published articles.</p>
<a href="https://blog.abp.io/abp?ref=tmpl" target="_blank" class="btn btn-link px-1">See Blog <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fab fa-github text-secondary d-block my-3 fa-2x"></i> Github</h5>
<p>Do you love the ABP Framework? Please <strong>give a star</strong> to support it!</p>
<a href="https://github.com/abpframework/abp/" target="_blank" class="btn btn-link px-1">See Open Source Framework <i class="fas fa-chevron-right"></i></a>
</div>
</div>
<div class="col-lg-4 border-start">
<div class="p-4">
<h5 class="mb-3"><i class="fab fa-stack-overflow text-secondary d-block my-3 fa-2x"></i> Stackoverflow</h5>
<p>See answers to previously asked questions or ask a new one.</p>
<a href="https://stackoverflow.com/questions/tagged/abp" target="_blank" class="btn btn-link px-1">Questions <i class="fas fa-chevron-right"></i></a>
<a href="https://stackoverflow.com/questions/ask" target="_blank" class="btn btn-link px-1">Ask a Question <i class="fas fa-chevron-right"></i></a>
</div>
</div>
</div>
</div>
</div>
<div class="mt-5 my-3 text-center">
<h3>Meet the ABP Commercial</h3>
<p>A Complete Web Application Platform Built on the ABP Framework</p>
</div>
<div class="card mt-4 mb-5">
<div class="card-body">
<p class="px-lg-5 mx-lg-5 py-3 text-center">
<a href="https://commercial.abp.io/" target="_blank">ABP Commercial</a> is a platform based on the open source ABP framework. It provides pre-built application modules,
rapid application development tooling, professional UI themes, premium support and more.
</p>
<div class="row text-center justify-content-md-center">
<div class="col-lg-2">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Startup Templates
<a href="https://commercial.abp.io/startup-templates?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Application Modules
<a href="https://commercial.abp.io/modules?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Developer<br />Tools
<a href="https://commercial.abp.io/tools?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> UI<br /> Themes
<a href="https://commercial.abp.io/themes?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Premium Support
<a href="https://support.abp.io/QA/Questions?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
<div class="col-lg-2 border-start">
<div class="p-3">
<h6>
<i class="fas fa-plus d-block mb-3 fa- 2x text-secondary"></i> Additional Services
<a href="https://commercial.abp.io/additional-services?ref=tmpl" target="_blank" class="d-block mt-2 btn btn-sm btn-link">Details <i class="fas fa-chevron-right"></i></a>
</h6>
</div>
</div>
</div>
</div>
</div>
<div class="mb-5 text-center">
<p class="align-middle">
<a href="https://twitter.com/abpframework" target="_blank" class="mx-2"><i class="fab fa-twitter"></i><span class="text-secondary"> Abp Framework</span></a>
<a href="https://twitter.com/abpcommercial" target="_blank" class="mx-2"><i class="fab fa-twitter"></i><span class="text-secondary"> Abp Commercial</span></a>
<a href="https://github.com/abpframework/abp" target="_blank" class="mx-2"><i class="fab fa-github"></i><span class="text-secondary"> abpframework</span></a>
</p>
</div>
</div>

6
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor.cs

@ -0,0 +1,6 @@
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Components.Pages;
public partial class Index
{
}

0
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor.css → templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Pages/Index.razor.css

22
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Program.cs

@ -0,0 +1,22 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
public class Program
{
public async static Task Main(string[] args)
{
var builder = WebAssemblyHostBuilder.CreateDefault(args);
var application = await builder.AddApplicationAsync<MyProjectNameBlazorClientModule>(options =>
{
options.UseAutofac();
});
var host = builder.Build();
await application.InitializeApplicationAsync(host.Services);
await host.RunAsync();
}
}

14
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/Routes.razor

@ -0,0 +1,14 @@
@using Volo.Abp.AspNetCore.Components.Web.LeptonXLiteTheme.Themes.LeptonXLite
@using Volo.Abp.AspNetCore.Components.Web.Theming.Routing
@using Microsoft.Extensions.Options
@inject IOptions<AbpRouterOptions> RouterOptions
<Router AppAssembly="typeof(Program).Assembly" AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<NotAuthorized>
<RedirectToLogin />
</NotAuthorized>
</AuthorizeRouteView>
<FocusOnNavigate RouteData="routeData" Selector="h1" />
</Found>
</Router>

14
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/_Imports.razor

@ -0,0 +1,14 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.WebAssembly.Http
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop
@using Volo.Abp.AspNetCore.Components.Web
@using Blazorise
@using Blazorise.DataGrid
@using Volo.Abp.BlazoriseUI
@using Volo.Abp.BlazoriseUI.Components

3
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/appsettings.Development.json

@ -0,0 +1,3 @@
{
}

25
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/appsettings.json

@ -0,0 +1,25 @@
{
"App": {
"SelfUrl": "https://localhost:44307"
},
"AuthServer": {
"Authority": "https://localhost:44308",
"ClientId": "MyProjectName_Blazor",
"ResponseType": "code"
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44308"
}
},
"AbpCli": {
"Bundle": {
"Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */
"Name": "global",
"IsBlazorWebApp": true,
"Parameters": {
}
}
}
}

28
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/global.css

File diff suppressed because one or more lines are too long

35
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/global.js

File diff suppressed because one or more lines are too long

BIN
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/icon-192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

BIN
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/icon-512.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

57
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/main.css

@ -0,0 +1,57 @@
/* Global styles for the MyProjectName application */
/* <TEMPLATE-REMOVE IF-NOT='LEPTONX'> */
:root .lpx-brand-logo {
--lpx-logo: url('/images/logo/leptonx/logo-light.png');
--lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png');
}
/* </TEMPLATE-REMOVE> */
.spinner {
width: 40px;
height: 40px;
display: block;
position: fixed;
top: calc( 50% - ( 40px / 2) );
right: calc( 50% - ( 40px / 2) );
}
.double-bounce1, .double-bounce2 {
width: 100%;
height: 100%;
border-radius: 50%;
background-color: #333;
opacity: 0.6;
position: absolute;
top: 0;
left: 0;
-webkit-animation: sk-bounce 2.0s infinite ease-in-out;
animation: sk-bounce 2.0s infinite ease-in-out;
}
.double-bounce2 {
-webkit-animation-delay: -1.0s;
animation-delay: -1.0s;
}
@-webkit-keyframes sk-bounce {
0%, 100% {
-webkit-transform: scale(0.0)
}
50% {
-webkit-transform: scale(1.0)
}
}
@keyframes sk-bounce {
0%, 100% {
transform: scale(0.0);
-webkit-transform: scale(0.0);
}
50% {
transform: scale(1.0);
-webkit-transform: scale(1.0);
}
}

21
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/manifest.json

@ -0,0 +1,21 @@
{
"name": "MyProjectName",
"short_name": "MyCompanyName.MyProjectName",
"start_url": "./",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#03173d",
"prefer_related_applications": false,
"icons": [
{
"src": "icon-512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "icon-192.png",
"type": "image/png",
"sizes": "192x192"
}
]
}

4
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/service-worker.js

@ -0,0 +1,4 @@
// In development, always fetch from the network and do not enable offline support.
// This is because caching would make development more difficult (changes would not
// be reflected on the first load after each change).
self.addEventListener('fetch', () => { });

48
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client/wwwroot/service-worker.published.js

@ -0,0 +1,48 @@
// Caution! Be sure you understand the caveats before publishing an application with
// offline support. See https://aka.ms/blazor-offline-considerations
self.importScripts('./service-worker-assets.js');
self.addEventListener('install', event => event.waitUntil(onInstall(event)));
self.addEventListener('activate', event => event.waitUntil(onActivate(event)));
self.addEventListener('fetch', event => event.respondWith(onFetch(event)));
const cacheNamePrefix = 'offline-cache-';
const cacheName = `${cacheNamePrefix}${self.assetsManifest.version}`;
const offlineAssetsInclude = [ /\.dll$/, /\.pdb$/, /\.wasm/, /\.html/, /\.js$/, /\.json$/, /\.css$/, /\.woff$/, /\.png$/, /\.jpe?g$/, /\.gif$/, /\.ico$/, /\.blat$/, /\.dat$/ ];
const offlineAssetsExclude = [ /^service-worker\.js$/ ];
async function onInstall(event) {
console.info('Service worker: Install');
// Fetch and cache all matching items from the assets manifest
const assetsRequests = self.assetsManifest.assets
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
.filter(asset => !offlineAssetsExclude.some(pattern => pattern.test(asset.url)))
.map(asset => new Request(asset.url, { integrity: asset.hash, cache: 'no-cache' }));
await caches.open(cacheName).then(cache => cache.addAll(assetsRequests));
}
async function onActivate(event) {
console.info('Service worker: Activate');
// Delete unused caches
const cacheKeys = await caches.keys();
await Promise.all(cacheKeys
.filter(key => key.startsWith(cacheNamePrefix) && key !== cacheName)
.map(key => caches.delete(key)));
}
async function onFetch(event) {
let cachedResponse = null;
if (event.request.method === 'GET') {
// For all navigation requests, try to serve index.html from cache
// If you need some URLs to be server-rendered, edit the following check to exclude those URLs
const shouldServeIndexHtml = event.request.mode === 'navigate';
const request = shouldServeIndexHtml ? 'index.html' : event.request;
const cache = await caches.open(cacheName);
cachedResponse = await cache.match(request);
}
return cachedResponse || fetch(event.request);
}

46
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Components/App.razor

@ -0,0 +1,46 @@
@using Volo.Abp.Localization
@using System.Globalization
@using Microsoft.Extensions.Hosting
@using MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client
@using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling
@inject IHostEnvironment Env
@{
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MyCompanyName.MyProjectName.Blazor.Server</title>
<base href="/" />
<AbpStyles BundleName="@BlazorLeptonXLiteThemeBundles.Styles.Global" />
<HeadOutlet @rendermode="InteractiveAuto" />
</head>
<body>
<Routes @rendermode="InteractiveAuto" />
<AbpScripts BundleName="@BlazorLeptonXLiteThemeBundles.Scripts.Global" />
<div id="blazor-error-ui">
@if (Env.IsDevelopment())
{
<text>An unhandled exception has occurred. See browser dev tools for details.</text>
}
else if (Env.IsStaging() || Env.IsProduction())
{
<text>An error has occurred. This application may no longer respond until reloaded.</text>
}
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
</body>
</html>

51
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Menus/MyProjectNameMenuContributor.cs

@ -0,0 +1,51 @@
using System.Threading.Tasks;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using Volo.Abp.Identity.Blazor;
using Volo.Abp.SettingManagement.Blazor.Menus;
using Volo.Abp.TenantManagement.Blazor.Navigation;
using Volo.Abp.UI.Navigation;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Menus;
public class MyProjectNameMenuContributor : IMenuContributor
{
public async Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
await ConfigureMainMenuAsync(context);
}
}
private Task ConfigureMainMenuAsync(MenuConfigurationContext context)
{
var administration = context.Menu.GetAdministration();
var l = context.GetLocalizer<MyProjectNameResource>();
context.Menu.Items.Insert(
0,
new ApplicationMenuItem(
MyProjectNameMenus.Home,
l["Menu:Home"],
"/",
icon: "fas fa-home",
order: 0
)
);
if (MultiTenancyConsts.IsEnabled)
{
administration.SetSubItemOrder(TenantManagementMenuNames.GroupName, 1);
}
else
{
administration.TryRemoveMenuItem(TenantManagementMenuNames.GroupName);
}
administration.SetSubItemOrder(IdentityMenuNames.GroupName, 2);
administration.SetSubItemOrder(SettingManagementMenus.GroupName, 3);
return Task.CompletedTask;
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Menus/MyProjectNameMenus.cs

@ -0,0 +1,10 @@
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp.Menus;
public class MyProjectNameMenus
{
private const string Prefix = "MyProjectName";
public const string Home = Prefix + ".Home";
//Add your menu items here...
}

78
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyCompanyName.MyProjectName.Blazor.Server.WebApp.csproj

@ -0,0 +1,78 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<GenerateBindingRedirectsOutputType>true</GenerateBindingRedirectsOutputType>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<MvcRazorExcludeRefAssembliesFromPublish>false</MvcRazorExcludeRefAssembliesFromPublish>
<PreserveCompilationReferences>true</PreserveCompilationReferences>
<UserSecretsId>MyCompanyName.MyProjectName-4681b4fd-151f-4221-84a4-929d86723e4c</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.1" />
<PackageReference Include="Blazorise.Bootstrap5" Version="1.4.1" />
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="1.4.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
</ItemGroup>
<ItemGroup>
<!-- <TEMPLATE-REMOVE> -->
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy\Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared\Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AutoMapper\Volo.Abp.AutoMapper.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Server.Theming\Volo.Abp.AspNetCore.Components.Server.Theming.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" />
<!-- </TEMPLATE-REMOVE> -->
<PackageReference Include="Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme" Version="3.0.*-*" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="3.0.*-*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MyCompanyName.MyProjectName.Application\MyCompanyName.MyProjectName.Application.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client\MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.HttpApi\MyCompanyName.MyProjectName.HttpApi.csproj" />
<ProjectReference Include="..\MyCompanyName.MyProjectName.EntityFrameworkCore\MyCompanyName.MyProjectName.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Autofac\Volo.Abp.Autofac.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj" />
<ProjectReference Include="..\..\..\..\..\framework\src\Volo.Abp.AspNetCore.Serilog\Volo.Abp.AspNetCore.Serilog.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\account\src\Volo.Abp.Account.Web.OpenIddict\Volo.Abp.Account.Web.OpenIddict.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\identity\src\Volo.Abp.Identity.Blazor.Server\Volo.Abp.Identity.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\tenant-management\src\Volo.Abp.TenantManagement.Blazor.Server\Volo.Abp.TenantManagement.Blazor.Server.csproj" />
<ProjectReference Include="..\..\..\..\..\modules\setting-management\src\Volo.Abp.SettingManagement.Blazor.Server\Volo.Abp.SettingManagement.Blazor.Server.csproj" />
</ItemGroup>
<ItemGroup Condition="Exists('./openiddict.pfx')">
<None Remove="openiddict.pfx" />
<EmbeddedResource Include="openiddict.pfx">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Compile Remove="Logs\**" />
<Content Remove="Logs\**" />
<EmbeddedResource Remove="Logs\**" />
<None Remove="Logs\**" />
</ItemGroup>
<ItemGroup>
<None Update="Pages\**\*.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Pages\**\*.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<_ContentIncludedByDefault Remove="Components\Pages\_ViewImports.cshtml" />
<_ContentIncludedByDefault Remove="Components\Pages\Index.razor" />
</ItemGroup>
</Project>

305
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameBlazorModule.cs

@ -0,0 +1,305 @@
using System;
using System.IO;
using Blazorise.Bootstrap5;
using Blazorise.Icons.FontAwesome;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client;
using MyCompanyName.MyProjectName.Blazor.Server.WebApp.Components;
using MyCompanyName.MyProjectName.Blazor.Server.WebApp.Menus;
using MyCompanyName.MyProjectName.EntityFrameworkCore;
using MyCompanyName.MyProjectName.Localization;
using MyCompanyName.MyProjectName.MultiTenancy;
using OpenIddict.Validation.AspNetCore;
using Volo.Abp;
using Volo.Abp.Account.Web;
using Volo.Abp.AspNetCore.Components.Server;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme;
using Volo.Abp.AspNetCore.Components.Server.LeptonXLiteTheme.Bundling;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.Localization;
using Volo.Abp.AspNetCore.Mvc.UI;
using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite;
using Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite.Bundling;
using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac;
using Volo.Abp.AutoMapper;
using Volo.Abp.Identity.Blazor.Server;
using Volo.Abp.Modularity;
using Volo.Abp.OpenIddict;
using Volo.Abp.Security.Claims;
using Volo.Abp.SettingManagement.Blazor.Server;
using Volo.Abp.Swashbuckle;
using Volo.Abp.TenantManagement.Blazor.Server;
using Volo.Abp.UI;
using Volo.Abp.UI.Navigation;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp;
[DependsOn(
typeof(MyProjectNameApplicationModule),
typeof(MyProjectNameEntityFrameworkCoreModule),
typeof(MyProjectNameHttpApiModule),
typeof(AbpAutofacModule),
typeof(AbpSwashbuckleModule),
typeof(AbpAspNetCoreSerilogModule),
typeof(AbpAccountWebOpenIddictModule),
typeof(AbpAspNetCoreComponentsServerLeptonXLiteThemeModule),
typeof(AbpAspNetCoreMvcUiLeptonXLiteThemeModule),
typeof(AbpIdentityBlazorServerModule),
typeof(AbpTenantManagementBlazorServerModule),
typeof(AbpSettingManagementBlazorServerModule)
)]
public class MyProjectNameBlazorModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
context.Services.PreConfigure<AbpMvcDataAnnotationsLocalizationOptions>(options =>
{
options.AddAssemblyResource(
typeof(MyProjectNameResource),
typeof(MyProjectNameDomainModule).Assembly,
typeof(MyProjectNameDomainSharedModule).Assembly,
typeof(MyProjectNameApplicationModule).Assembly,
typeof(MyProjectNameApplicationContractsModule).Assembly,
typeof(MyProjectNameBlazorModule).Assembly
);
});
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddValidation(options =>
{
options.AddAudiences("MyProjectName");
options.UseLocalServer();
options.UseAspNetCore();
});
});
if (!hostingEnvironment.IsDevelopment())
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
PreConfigure<OpenIddictServerBuilder>(serverBuilder =>
{
serverBuilder.AddProductionEncryptionAndSigningCertificate("openiddict.pfx", "00000000-0000-0000-0000-000000000000");
});
}
PreConfigure<AbpAspNetCoreComponentsWebOptions>(options =>
{
options.IsBlazorWebApp = true;
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration();
// Add services to the container.
context.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddInteractiveWebAssemblyComponents();
ConfigureAuthentication(context);
ConfigureUrls(configuration);
ConfigureBundles();
ConfigureAutoMapper();
ConfigureVirtualFileSystem(hostingEnvironment);
ConfigureSwaggerServices(context.Services);
ConfigureAutoApiControllers();
ConfigureBlazorise(context);
ConfigureRouter(context);
ConfigureMenu(context);
}
private void ConfigureAuthentication(ServiceConfigurationContext context)
{
context.Services.ForwardIdentityAuthenticationForBearer(OpenIddictValidationAspNetCoreDefaults.AuthenticationScheme);
context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options =>
{
options.IsDynamicClaimsEnabled = true;
});
}
private void ConfigureUrls(IConfiguration configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty<string>());
});
}
private void ConfigureBundles()
{
Configure<AbpBundlingOptions>(options =>
{
// MVC UI
options.StyleBundles.Configure(
LeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/global-styles.css");
}
);
//BLAZOR UI
options.StyleBundles.Configure(
BlazorLeptonXLiteThemeBundles.Styles.Global,
bundle =>
{
bundle.AddFiles("/blazor-global-styles.css");
//You can remove the following line if you don't use Blazor CSS isolation for components
bundle.AddFiles("/MyCompanyName.MyProjectName.Blazor.Server.WebApp.Client.styles.css");
}
);
});
}
private void ConfigureVirtualFileSystem(IWebHostEnvironment hostingEnvironment)
{
if (hostingEnvironment.IsDevelopment())
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
//<TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<AbpUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiBootstrapModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Bootstrap", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiThemeSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAspNetCoreMvcUiMultiTenancyModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}framework{0}src{0}Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpPermissionManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}permission-management{0}src{0}Volo.Abp.PermissionManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpFeatureManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}feature-management{0}src{0}Volo.Abp.FeatureManagement.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpIdentityWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}identity{0}src{0}Volo.Abp.Identity.Web", Path.DirectorySeparatorChar)));
options.FileSets.ReplaceEmbeddedByPhysical<AbpAccountWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}account{0}src{0}Volo.Abp.Account.Web", Path.DirectorySeparatorChar)));
//options.FileSets.ReplaceEmbeddedByPhysical<AbpTenantManagementWebModule>(Path.Combine(hostingEnvironment.ContentRootPath, string.Format("..{0}..{0}..{0}..{0}..{0}modules{0}tenant-management{0}src{0}Volo.Abp.TenantManagement.Web", Path.DirectorySeparatorChar)));
//</TEMPLATE-REMOVE>
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainSharedModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain.Shared"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameDomainModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Domain"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationContractsModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application.Contracts"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameApplicationModule>(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}MyCompanyName.MyProjectName.Application"));
options.FileSets.ReplaceEmbeddedByPhysical<MyProjectNameBlazorModule>(hostingEnvironment.ContentRootPath);
});
}
}
private void ConfigureSwaggerServices(IServiceCollection services)
{
services.AddAbpSwaggerGen(
options =>
{
options.SwaggerDoc("v1", new OpenApiInfo { Title = "MyProjectName API", Version = "v1" });
options.DocInclusionPredicate((docName, description) => true);
options.CustomSchemaIds(type => type.FullName);
}
);
}
private void ConfigureBlazorise(ServiceConfigurationContext context)
{
context.Services
.AddBootstrap5Providers()
.AddFontAwesomeIcons();
}
private void ConfigureMenu(ServiceConfigurationContext context)
{
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new MyProjectNameMenuContributor());
});
}
private void ConfigureRouter(ServiceConfigurationContext context)
{
Configure<AbpRouterOptions>(options =>
{
options.AppAssembly = typeof(MyProjectNameBlazorModule).Assembly;
options.AdditionalAssemblies.Add(typeof(MyProjectNameBlazorClientModule).Assembly);
});
}
private void ConfigureAutoApiControllers()
{
Configure<AbpAspNetCoreMvcOptions>(options =>
{
options.ConventionalControllers.Create(typeof(MyProjectNameApplicationModule).Assembly);
});
}
private void ConfigureAutoMapper()
{
Configure<AbpAutoMapperOptions>(options =>
{
options.AddMaps<MyProjectNameBlazorModule>();
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var env = context.GetEnvironment();
var app = context.GetApplicationBuilder();
app.UseAbpRequestLocalization();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCorrelationId();
app.UseStaticFiles();
app.UseRouting();
app.UseAuthentication();
app.UseAbpOpenIddictValidation();
if (MultiTenancyConsts.IsEnabled)
{
app.UseMultiTenancy();
}
app.UseUnitOfWork();
app.UseDynamicClaims();
app.UseAntiforgery();
app.UseAuthorization();
app.UseSwagger();
app.UseAbpSwaggerUI(options =>
{
options.SwaggerEndpoint("/swagger/v1/swagger.json", "MyProjectName API");
});
app.UseConfiguredEndpoints(builder =>
{
builder.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddInteractiveWebAssemblyRenderMode()
.AddAdditionalAssemblies(builder.ServiceProvider.GetRequiredService<IOptions<AbpRouterOptions>>().Value.AdditionalAssemblies.ToArray());
});
}
}

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameBrandingProvider.cs

@ -0,0 +1,10 @@
using Volo.Abp.DependencyInjection;
using Volo.Abp.Ui.Branding;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp;
[Dependency(ReplaceServices = true)]
public class MyProjectNameBrandingProvider : DefaultBrandingProvider
{
public override string AppName => "MyProjectName";
}

12
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/MyProjectNameComponentBase.cs

@ -0,0 +1,12 @@
using MyCompanyName.MyProjectName.Localization;
using Volo.Abp.AspNetCore.Components;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp;
public abstract class MyProjectNameComponentBase : AbpComponentBase
{
protected MyProjectNameComponentBase()
{
LocalizationResource = typeof(MyProjectNameResource);
}
}

56
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Program.cs

@ -0,0 +1,56 @@
using System;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Serilog;
using Serilog.Events;
namespace MyCompanyName.MyProjectName.Blazor.Server.WebApp;
public class Program
{
public async static Task<int> Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
#if DEBUG
.MinimumLevel.Debug()
#else
.MinimumLevel.Information()
#endif
.MinimumLevel.Override("Microsoft", LogEventLevel.Information)
.MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning)
.Enrich.FromLogContext()
.WriteTo.Async(c => c.File("Logs/logs.txt"))
.WriteTo.Async(c => c.Console())
.CreateLogger();
try
{
Log.Information("Starting web host.");
var builder = WebApplication.CreateBuilder(args);
builder.Host.AddAppSettingsSecretsJson()
.UseAutofac()
.UseSerilog();
await builder.AddApplicationAsync<MyProjectNameBlazorModule>();
var app = builder.Build();
await app.InitializeApplicationAsync();
await app.RunAsync();
return 0;
}
catch (Exception ex)
{
if (ex is HostAbortedException)
{
throw;
}
Log.Fatal(ex, "Host terminated unexpectedly!");
return 1;
}
finally
{
Log.CloseAndFlush();
}
}
}

28
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/Properties/launchSettings.json

@ -0,0 +1,28 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "https://localhost:44308/",
"sslPort": 44308
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"MyCompanyName.MyProjectName.Blazor.Server": {
"commandName": "Project",
"dotnetRunMessages": "true",
"launchBrowser": true,
"applicationUrl": "https://localhost:44308/",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

14
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/_Imports.razor

@ -0,0 +1,14 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop
@using MyCompanyName.MyProjectName.Blazor.Server.WebApp
@using Blazorise
@using Blazorise.DataGrid
@using Volo.Abp.BlazoriseUI
@using Volo.Abp.BlazoriseUI.Components

11
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/abp.resourcemapping.js

@ -0,0 +1,11 @@
module.exports = {
aliases: {
},
clean: [
],
mappings: {
}
};

2
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/appsettings.Development.json

@ -0,0 +1,2 @@
{
}

16
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/appsettings.json

@ -0,0 +1,16 @@
{
"App": {
"SelfUrl": "https://localhost:44308",
"RedirectAllowedUrls": "https://localhost:44308"
},
"ConnectionStrings": {
"Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=MyProjectName;Trusted_Connection=True;TrustServerCertificate=True"
},
"AuthServer": {
"Authority": "https://localhost:44308",
"RequireHttpsMetadata": false
},
"StringEncryption": {
"DefaultPassPhrase": "gsKnGZ041HLL4IM8"
}
}

9
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/package.json

@ -0,0 +1,9 @@
{
"version": "1.0.0",
"name": "my-app",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "~3.0.1",
"@abp/aspnetcore.components.server.leptonxlitetheme": "~3.0.1"
}
}

18
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/web.config

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\MyCompanyName.MyProjectName.Blazor.Server.dll" stdoutLogEnabled="false" stdoutLogFile=".\Logs\stdout" hostingModel="inprocess" />
</system.webServer>
</location>
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="x-powered-by" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>

18
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/blazor-global-styles.css

@ -0,0 +1,18 @@
#blazor-error-ui {
background: lightyellow;
bottom: 0;
box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
display: none;
left: 0;
padding: 0.6rem 1.25rem 0.7rem 1.25rem;
position: fixed;
width: 100%;
z-index: 1000;
}
#blazor-error-ui .dismiss {
cursor: pointer;
position: absolute;
right: 0.75rem;
top: 0.5rem;
}

BIN
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

10
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/global-styles.css

@ -0,0 +1,10 @@
body {
}
/* <TEMPLATE-REMOVE IF-NOT='LEPTONX'> */
:root .lpx-brand-logo {
--lpx-logo: url('/images/logo/leptonx/logo-light.png');
--lpx-logo-icon: url('/images/logo/leptonx/logo-light-thumbnail.png');
}
/* </TEMPLATE-REMOVE> */

BIN
templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.WebApp/wwwroot/images/logo/leptonx/logo-dark-thumbnail.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save