Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Blazor Serverside #8074

Merged
merged 79 commits into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
35bf8be
WIP blazor server
stsrki Jan 13, 2021
08e42ed
Merge branch 'dev' into stsrki/dev-blazor-server
stsrki Jan 14, 2021
84e65b7
Merged dev branch
stsrki Feb 9, 2021
d3257d7
Refactorings
stsrki Feb 24, 2021
4a39ac7
Created initial demo blazor server side solution
hikalkan Feb 24, 2021
b26b5b4
Integrated ABP framework and MVC.
hikalkan Feb 24, 2021
980bc3c
Added basic theme for the mvc / razor pages.
hikalkan Feb 24, 2021
aa7d9c1
Installed abp blazorise package for test purpose.
hikalkan Feb 24, 2021
bf9b054
Made blazor server side basic theme (initially) working
hikalkan Feb 24, 2021
2cc3898
Update _Host.cshtml
hikalkan Feb 24, 2021
68f2747
Running blazor WebAssenbly and server project
stsrki Mar 4, 2021
e9f8cee
Delete copy files.
hikalkan Mar 4, 2021
36fd83c
Revisit project dependencies
hikalkan Mar 4, 2021
3e1e0a7
Fix references and remove error UI
hikalkan Mar 4, 2021
767af36
Fixed sorting problem
stsrki Mar 5, 2021
d18ece1
Fixed Blazor rendering errors
stsrki Mar 5, 2021
3aa250b
InvokeAsync for UiMessageAlert
stsrki Mar 5, 2021
a5fd5f7
Fixed confirmation dialog
stsrki Mar 8, 2021
1e1aed7
Added serilog logging to blazor server side.
hikalkan Mar 8, 2021
27937be
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 8, 2021
0496292
Fix EmailSettingGroupViewComponent.razor
hikalkan Mar 8, 2021
d959a74
Fixed build error
stsrki Mar 8, 2021
24446ae
Startup solution should not add BasicThemeToolbarContributor.
hikalkan Mar 8, 2021
c36a347
Fix database name
hikalkan Mar 8, 2021
f58579f
Fix connstring
hikalkan Mar 8, 2021
64c9d2a
Reduce menu duplication and made login/logout works.
hikalkan Mar 8, 2021
af390f6
Remove unused package.
hikalkan Mar 9, 2021
e707d1f
Rename or cancel some blazor packages (rearranging packages).
hikalkan Mar 9, 2021
f2281b2
Rename UI to Web in module names.
hikalkan Mar 9, 2021
b7a75a0
Add AbpAspNetCoreComponentsWebAssemblyModule dependency to AbpHttpCli…
hikalkan Mar 9, 2021
1976661
Remove code duplication in the Volo.Abp.AspNetCore.Components.WebAsse…
hikalkan Mar 9, 2021
f59c7c8
Fix modules and template for blazor package changes.
hikalkan Mar 9, 2021
8b1dddc
Fix AbpBlazorServerDemo compile errors
hikalkan Mar 9, 2021
04272af
Update bundles.
hikalkan Mar 9, 2021
7e8a056
Remove UseAbpSecurityHeaders usages.
hikalkan Mar 9, 2021
b682d3c
Remove unnecessary dependency
hikalkan Mar 9, 2021
4400ba3
Create Volo.Abp.AspNetCore.Components.Server package.
hikalkan Mar 9, 2021
a7eb4fb
Add new packages.
hikalkan Mar 9, 2021
28ceab4
renamed Volo.Abp.AspNetCore.Components.Web.BasicTheme.Server to Volo.…
hikalkan Mar 9, 2021
7b60299
Delete MyProjectNameBundleContributor.cs
hikalkan Mar 9, 2021
73e700a
Resolved #8006: Virtual File Middleware should be compatible with IWe…
hikalkan Mar 9, 2021
4425ac2
Implemented blazor server side bundling.
hikalkan Mar 9, 2021
0026831
Update Index.razor
hikalkan Mar 9, 2021
c0cb11c
Rearrange bundle files for bazor UI.
hikalkan Mar 9, 2021
e1ef010
Created bundles for the basic theme.
hikalkan Mar 9, 2021
3dd275b
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 9, 2021
bb05dac
create npm packages for blazor server
hikalkan Mar 9, 2021
ab7f78e
Re-installed dependencies
hikalkan Mar 9, 2021
acfca93
Make language switch working for blazor server side.
hikalkan Mar 9, 2021
21abc1c
Made menu fully working for the blazor server.
hikalkan Mar 10, 2021
4d8fc0e
UseStaticFiles and also fix swagger schema problem.
hikalkan Mar 10, 2021
ae4550c
Change port numbers for Blazor server project
stsrki Mar 10, 2021
0acd1b2
Formating
stsrki Mar 10, 2021
0573680
Fixed permissions save
stsrki Mar 10, 2021
804d5f2
Ignore _blazor endpoint for blazor server side applications (temp sol…
hikalkan Mar 10, 2021
0f51151
Added experimental try-catch logic.
hikalkan Mar 10, 2021
b17eb8e
Made error handling work (initial)
hikalkan Mar 10, 2021
e377bea
Error handling in blazor UI
hikalkan Mar 11, 2021
c06e4ed
Fix setting management dependency problem and top menu items.
hikalkan Mar 11, 2021
d427241
Fix module\aspnet-core build
hikalkan Mar 11, 2021
09b0e2c
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 11, 2021
19854a5
Fallback to default sorting if not provided.
hikalkan Mar 11, 2021
0b50e1d
Better handle default sorting.
hikalkan Mar 11, 2021
5e6b7b6
Migrate to Blazorise 0.9.3
stsrki Mar 12, 2021
63f4553
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 12, 2021
63aaeed
Cascade ParentEntityActionsColumn
stsrki Mar 12, 2021
f6ef4be
Explicitely define EntityActions Type
stsrki Mar 12, 2021
c322308
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 12, 2021
a2ff51d
Better exception message.
hikalkan Mar 12, 2021
0d65fde
Rename blazor server side basic theme namespace and remove unnecessar…
hikalkan Mar 15, 2021
02e1a77
Should not add BasicTheme css in the theming package..
hikalkan Mar 15, 2021
05d680a
Remove Autofocus parameter for TextEdit
stsrki Mar 15, 2021
9c4e87f
Improve the exception message.
hikalkan Mar 15, 2021
3badaaf
Made EntityAction.IsVisible public.
hikalkan Mar 15, 2021
0daf72b
Resolved #8065: Mark EntityAction.RequiredPolicy obsolete for the Bla…
hikalkan Mar 15, 2021
726d91f
Improve default sorting fallback expressions
hikalkan Mar 15, 2021
f690ec9
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 16, 2021
b161477
Merge branch 'dev' into stsrki/dev-blazor-server
hikalkan Mar 16, 2021
6c9540e
Remove unnecessary injection.
hikalkan Mar 16, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions delete-bin-obj-folders.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@ECHO off
cls

ECHO Deleting all BIN and OBJ folders...
ECHO.

FOR /d /r . %%d in (bin,obj) DO (
IF EXIST "%%d" (
ECHO %%d | FIND /I "\node_modules\" > Nul && (
ECHO.Skipping: %%d
) || (
ECHO.Deleting: %%d
rd /s/q "%%d"
)
)
)

ECHO.
ECHO.BIN and OBJ folders have been successfully deleted. Press any key to exit.
pause > nul
50 changes: 46 additions & 4 deletions framework/Volo.Abp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,30 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.ExceptionHandling"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components", "src\Volo.Abp.AspNetCore.Components\Volo.Abp.AspNetCore.Components.csproj", "{89840441-5A3A-4FD7-9CB4-E5B52FAEF72A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Swashbuckle", "src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj", "{DD9519E0-5A68-48DC-A051-7BF2AC922F3E}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Swashbuckle", "src\Volo.Abp.Swashbuckle\Volo.Abp.Swashbuckle.csproj", "{DD9519E0-5A68-48DC-A051-7BF2AC922F3E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Json.Tests", "test\Volo.Abp.Json.Tests\Volo.Abp.Json.Tests.csproj", "{00D07595-993C-40FC-BD90-0DD6331414D3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Json.Tests", "test\Volo.Abp.Json.Tests\Volo.Abp.Json.Tests.csproj", "{00D07595-993C-40FC-BD90-0DD6331414D3}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Http.Tests", "test\Volo.Abp.Http.Tests\Volo.Abp.Http.Tests.csproj", "{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Http.Tests", "test\Volo.Abp.Http.Tests\Volo.Abp.Http.Tests.csproj", "{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.EventBus.Abstractions", "src\Volo.Abp.EventBus.Abstractions\Volo.Abp.EventBus.Abstractions.csproj", "{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.Web", "src\Volo.Abp.AspNetCore.Components.Web\Volo.Abp.AspNetCore.Components.Web.csproj", "{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.Web.BasicTheme", "src\Volo.Abp.AspNetCore.Components.Web.BasicTheme\Volo.Abp.AspNetCore.Components.Web.BasicTheme.csproj", "{5AD34048-5DAA-4067-9C7D-09295617A057}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.AspNetCore.Components.Web.Theming", "src\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj", "{B9133C38-AC24-4E2F-B581-D124CF410CDF}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.EventBus.Abstractions", "src\Volo.Abp.EventBus.Abstractions\Volo.Abp.EventBus.Abstractions.csproj", "{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.Server.BasicTheme", "src\Volo.Abp.AspNetCore.Components.Server.BasicTheme\Volo.Abp.AspNetCore.Components.Server.BasicTheme.csproj", "{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.Aliyun", "src\Volo.Abp.Sms.Aliyun\Volo.Abp.Sms.Aliyun.csproj", "{ACFBA3FB-18CE-4655-9D14-1F1F5C3DFC30}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.Sms.Aliyun.Tests", "test\Volo.Abp.Sms.Aliyun.Tests\Volo.Abp.Sms.Aliyun.Tests.csproj", "{DADEA538-3CA1-4ADE-A7E6-EF77A0CE4401}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.Server", "src\Volo.Abp.AspNetCore.Components.Server\Volo.Abp.AspNetCore.Components.Server.csproj", "{863C18F9-2407-49F9-9ADC-F6229AF3B385}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.AspNetCore.Components.Server.Theming", "src\Volo.Abp.AspNetCore.Components.Server.Theming\Volo.Abp.AspNetCore.Components.Server.Theming.csproj", "{B4B6B7DE-9798-4007-B1DF-7EE7929E392A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1075,10 +1087,26 @@ Global
{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1}.Release|Any CPU.Build.0 = Release|Any CPU
{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2}.Release|Any CPU.Build.0 = Release|Any CPU
{5AD34048-5DAA-4067-9C7D-09295617A057}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5AD34048-5DAA-4067-9C7D-09295617A057}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5AD34048-5DAA-4067-9C7D-09295617A057}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5AD34048-5DAA-4067-9C7D-09295617A057}.Release|Any CPU.Build.0 = Release|Any CPU
{B9133C38-AC24-4E2F-B581-D124CF410CDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B9133C38-AC24-4E2F-B581-D124CF410CDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B9133C38-AC24-4E2F-B581-D124CF410CDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B9133C38-AC24-4E2F-B581-D124CF410CDF}.Release|Any CPU.Build.0 = Release|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE}.Release|Any CPU.Build.0 = Release|Any CPU
{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A}.Release|Any CPU.Build.0 = Release|Any CPU
{ACFBA3FB-18CE-4655-9D14-1F1F5C3DFC30}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACFBA3FB-18CE-4655-9D14-1F1F5C3DFC30}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACFBA3FB-18CE-4655-9D14-1F1F5C3DFC30}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -1087,6 +1115,14 @@ Global
{DADEA538-3CA1-4ADE-A7E6-EF77A0CE4401}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DADEA538-3CA1-4ADE-A7E6-EF77A0CE4401}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DADEA538-3CA1-4ADE-A7E6-EF77A0CE4401}.Release|Any CPU.Build.0 = Release|Any CPU
{863C18F9-2407-49F9-9ADC-F6229AF3B385}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{863C18F9-2407-49F9-9ADC-F6229AF3B385}.Debug|Any CPU.Build.0 = Debug|Any CPU
{863C18F9-2407-49F9-9ADC-F6229AF3B385}.Release|Any CPU.ActiveCfg = Release|Any CPU
{863C18F9-2407-49F9-9ADC-F6229AF3B385}.Release|Any CPU.Build.0 = Release|Any CPU
{B4B6B7DE-9798-4007-B1DF-7EE7929E392A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4B6B7DE-9798-4007-B1DF-7EE7929E392A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4B6B7DE-9798-4007-B1DF-7EE7929E392A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4B6B7DE-9798-4007-B1DF-7EE7929E392A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1268,9 +1304,15 @@ Global
{DD9519E0-5A68-48DC-A051-7BF2AC922F3E} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{00D07595-993C-40FC-BD90-0DD6331414D3} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{A37BFEB5-7C57-4CDC-93B8-B5CE4BB9ACE1} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{F03A1CEA-FA44-4F30-BFC2-00BC2EAAB4E2} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{5AD34048-5DAA-4067-9C7D-09295617A057} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{B9133C38-AC24-4E2F-B581-D124CF410CDF} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{8FDB3BF7-AD89-43F6-8DEB-C3E29B8801FE} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{F35E5CFC-569F-4D7D-A30F-DD8AE97FEC5A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{ACFBA3FB-18CE-4655-9D14-1F1F5C3DFC30} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{DADEA538-3CA1-4ADE-A7E6-EF77A0CE4401} = {447C8A77-E5F0-4538-8687-7383196D04EA}
{863C18F9-2407-49F9-9ADC-F6229AF3B385} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
{B4B6B7DE-9798-4007-B1DF-7EE7929E392A} = {5DF0E140-0513-4D0D-BE2E-3D4D85CD70E6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling;
using Volo.Abp.AspNetCore.Components.Server.Theming;
using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling;
using Volo.Abp.AspNetCore.Components.Web.BasicTheme;
using Volo.Abp.AspNetCore.Components.Web.Theming.Routing;
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;
using Volo.Abp.Modularity;

namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme
{
[DependsOn(
typeof(AbpAspNetCoreComponentsWebBasicThemeModule),
typeof(AbpAspNetCoreComponentsServerThemingModule)
)]
public class AbpAspNetCoreComponentsServerBasicThemeModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpToolbarOptions>(options =>
{
options.Contributors.Add(new BasicThemeToolbarContributor());
});

Configure<AbpBundlingOptions>(options =>
{
options
.StyleBundles
.Add(BlazorBasicThemeBundles.Styles.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Styles.Global)
.AddContributors(typeof(BlazorBasicThemeStyleContributor));
});

options
.ScriptBundles
.Add(BlazorBasicThemeBundles.Scripts.Global, bundle =>
{
bundle
.AddBaseBundles(BlazorStandardBundles.Scripts.Global)
.AddContributors(typeof(BlazorBasicThemeScriptContributor));
});
});
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic;
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars;

namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme
{
public class BasicThemeToolbarContributor : IToolbarContributor
{
public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
{
if (context.Toolbar.Name == StandardToolbars.Main)
{
context.Toolbar.Items.Add(new ToolbarItem(typeof(LanguageSwitch)));
context.Toolbar.Items.Add(new ToolbarItem(typeof(LoginDisplay)));
}

return Task.CompletedTask;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
{
public class BlazorBasicThemeBundles
{
public static class Styles
{
public static string Global = "Blazor.BasicTheme.Global";
}

public static class Scripts
{
public static string Global = "Blazor.BasicTheme.Global";
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;

namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
{
public class BlazorBasicThemeScriptContributor : BundleContributor
{

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using System.Collections.Generic;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling;

namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling
{
public class BlazorBasicThemeStyleContributor : BundleContributor
{
public override void ConfigureBundle(BundleConfigurationContext context)
{
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web.BasicTheme/libs/abp/css/theme.css");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
@using Volo.Abp.Localization
@using System.Globalization
@using System.Collections.Immutable
@using Microsoft.AspNetCore.RequestLocalization
@inject ILanguageProvider LanguageProvider
@inject NavigationManager NavigationManager
@inject IAbpRequestLocalizationOptionsProvider RequestLocalizationOptionsProvider
@if (_otherLanguages != null && _otherLanguages.Any())
{
<BarDropdown>
<BarDropdownToggle>
@_currentLanguage.DisplayName
</BarDropdownToggle>
<BarDropdownMenu RightAligned="true">
@foreach (var language in _otherLanguages)
{
<BarDropdownItem Clicked="() => ChangeLanguage(language)">@language.DisplayName</BarDropdownItem>
}
</BarDropdownMenu>
</BarDropdown>
}
@code {
private IReadOnlyList<LanguageInfo> _otherLanguages;
private LanguageInfo _currentLanguage;

protected override async Task OnInitializedAsync()
{
var languages = await LanguageProvider.GetLanguagesAsync();
var currentLanguage = languages.FindByCulture(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name
);

if (currentLanguage == null)
{
var localizationOptions = await RequestLocalizationOptionsProvider.GetLocalizationOptionsAsync();
if (localizationOptions.DefaultRequestCulture != null)
{
currentLanguage = new LanguageInfo(
localizationOptions.DefaultRequestCulture.Culture.Name,
localizationOptions.DefaultRequestCulture.UICulture.Name,
localizationOptions.DefaultRequestCulture.UICulture.DisplayName);
}
else
{
currentLanguage = new LanguageInfo(
CultureInfo.CurrentCulture.Name,
CultureInfo.CurrentUICulture.Name,
CultureInfo.CurrentUICulture.DisplayName);
}
}

_currentLanguage = currentLanguage;
_otherLanguages = languages.Where(l => l != _currentLanguage).ToImmutableList();
}

private void ChangeLanguage(LanguageInfo language)
{
var relativeUrl = NavigationManager.Uri.RemovePreFix(NavigationManager.BaseUri).EnsureStartsWith('/');

NavigationManager.NavigateTo(
$"/Abp/Languages/Switch?culture={language.CultureName}&uiCulture={language.UiCultureName}&returnUrl={relativeUrl}",
forceLoad: true
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic
@using Volo.Abp.Users
@using Volo.Abp.MultiTenancy
@using Microsoft.Extensions.Localization
@using global::Localization.Resources.AbpUi
@inject ICurrentUser CurrentUser
@inject ICurrentTenant CurrentTenant
@inject IJSRuntime JsRuntime
@inject NavigationManager Navigation
@inject IStringLocalizer<AbpUiResource> L
<AuthorizeView>
<Authorized>
<Dropdown>
<DropdownToggle Color="Color.None">
@if (CurrentTenant.Name != null)
{
<span><i>@CurrentTenant.Name</i>\@CurrentUser.UserName</span>
}
else
{
<span>@CurrentUser.UserName</span>
}
</DropdownToggle>
<DropdownMenu>
@if (Menu != null)
{
@foreach (var menuItem in Menu.Items)
{
<a class="dropdown-item" href="@menuItem.Url?.TrimStart('~')" target="@menuItem.Target">@menuItem.DisplayName</a>
}
}
</DropdownMenu>
</Dropdown>
</Authorized>
<NotAuthorized>
<a class="nav-link" href="/Account/Login">@L["Login"]</a>
</NotAuthorized>
</AuthorizeView>
Loading