Browse Source

Improved

pull/4/head
liangshiwei 4 years ago
parent
commit
b297932fd4
  1. 11
      lsw.Abp.AntDesignUI.sln
  2. 2
      modules/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme.csproj
  3. 11
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs
  4. 5
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs
  5. 3
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/FodyWeavers.xml
  6. 25
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Layout/AbpPageHeader.razor
  7. 1
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.csproj
  8. 4
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/App.razor
  9. 16
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/AppWithoutAuth.razor
  10. 10
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/Branding.razor
  11. 49
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor
  12. 11
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor.cs
  13. 0
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenu.razor
  14. 7
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenu.razor.cs
  15. 18
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor
  16. 23
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor.cs
  17. 0
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/_Imports.razor
  18. 14
      modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/wwwroot/libs/abp/css/theme.css
  19. 3
      modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/ComponentsComponentsBundleContributor.cs
  20. 3
      modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/FodyWeavers.xml
  21. 9
      modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.csproj
  22. 1
      src/Lsw.Abp.AntDesignUI/AbpAntDesignUIModule.cs
  23. 25
      src/Lsw.Abp.AntDesignUI/Components/UiPageProgress.razor
  24. 19
      test/AntDesignUIApp/AntDesignUIApp.csproj
  25. 44
      test/AntDesignUIApp/AntDesignUIAppModule.cs
  26. 29
      test/AntDesignUIApp/FakeAbpApplicationConfigurationAppService.cs
  27. 13
      test/AntDesignUIApp/FakeAuthStateProvider.cs
  28. 5
      test/AntDesignUIApp/Pages/Index.razor
  29. 17
      test/AntDesignUIApp/Pages/Index.razor.cs
  30. 16
      test/AntDesignUIApp/Program.cs
  31. 30
      test/AntDesignUIApp/Properties/launchSettings.json
  32. 13
      test/AntDesignUIApp/_Imports.razor
  33. 3
      test/AntDesignUIApp/wwwroot/appsettings.json
  34. BIN
      test/AntDesignUIApp/wwwroot/favicon.ico
  35. 2
      test/AntDesignUIApp/wwwroot/global.css
  36. 10
      test/AntDesignUIApp/wwwroot/global.js
  37. BIN
      test/AntDesignUIApp/wwwroot/icon-192.png
  38. 27
      test/AntDesignUIApp/wwwroot/index.html
  39. 27
      test/AntDesignUIApp/wwwroot/sample-data/weather.json

11
lsw.Abp.AntDesignUI.sln

@ -12,6 +12,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lsw.Abp.AspnetCore.Componen
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme", "modules\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.csproj", "{84F26612-0056-4CD1-849B-B0B8F046350D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{E36D7268-C7A6-4A7F-81DB-57070F4B049C}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{DA09D6FA-2DA0-4C76-AF49-BF24A015FF49}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AntDesignUIApp", "test\AntDesignUIApp\AntDesignUIApp.csproj", "{62B99860-4CED-404F-A378-37B40043F10C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -22,6 +28,7 @@ Global
{75753009-1BE9-4994-8D2E-890829844C46} = {0C432416-770F-4331-84E6-5835408A9BD8}
{7C86BBAF-609E-4651-B1AF-FBF3EA669E3A} = {0C432416-770F-4331-84E6-5835408A9BD8}
{84F26612-0056-4CD1-849B-B0B8F046350D} = {0C432416-770F-4331-84E6-5835408A9BD8}
{62B99860-4CED-404F-A378-37B40043F10C} = {DA09D6FA-2DA0-4C76-AF49-BF24A015FF49}
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9EA4AA35-DEFC-4C25-8333-78137853EC5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@ -40,5 +47,9 @@ Global
{84F26612-0056-4CD1-849B-B0B8F046350D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{84F26612-0056-4CD1-849B-B0B8F046350D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{84F26612-0056-4CD1-849B-B0B8F046350D}.Release|Any CPU.Build.0 = Release|Any CPU
{62B99860-4CED-404F-A378-37B40043F10C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62B99860-4CED-404F-A378-37B40043F10C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62B99860-4CED-404F-A378-37B40043F10C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62B99860-4CED-404F-A378-37B40043F10C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

2
modules/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme.csproj

@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project=".\..\configureawait.props" />
<Import Project="..\..\configureawait.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>

11
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAntDesignThemeOptions.cs

@ -5,6 +5,11 @@ namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme;
public class AbpAntDesignThemeOptions
{
public MenuOptions Menu { get; set; }
public AbpAntDesignThemeOptions()
{
Menu = new MenuOptions();
}
}
public class MenuOptions
@ -13,6 +18,12 @@ public class MenuOptions
public MenuPlace Place { get; set; }
public MenuOptions()
{
Theme = MenuTheme.Light;
Place = MenuPlace.Top;
}
public MenuMode GetMode()
{
return Place == MenuPlace.Left ? MenuMode.Inline : MenuMode.Horizontal;

5
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/AbpAspNetCoreComponentsWebAntDesignThemeModule.cs

@ -1,4 +1,5 @@
using Lsw.Abp.AntDesignUI;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
@ -10,5 +11,7 @@ namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme;
)]
public class AbpAspNetCoreComponentsWebAntDesignThemeModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
}
}

3
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

25
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Layout/AbpPageHeader.razor

@ -1,16 +1,15 @@
@using AntDesign
@using Microsoft.Extensions.Options
@using Microsoft.Extensions.Options
@inject IOptions<PageHeaderOptions> Options
<Row>
@if (Options.Value.RenderPageTitle)
{
<PageHeader Class="site-page-header" Title="@PageLayout.Title"></PageHeader>
}
<Row Style="margin-left: 15px">
<Breadcrumb>
@if (Options.Value.RenderPageTitle)
{
<b>@PageLayout.Title</b>
}
@if (Options.Value.RenderBreadcrumbs && PageLayout.BreadcrumbItems.Any())
{
<Breadcrumb>
@if (Options.Value.RenderBreadcrumbs && PageLayout.BreadcrumbItems.Any())
{
@if (BreadcrumbShowHome)
{
<BreadcrumbItem Href="">
@ -27,8 +26,8 @@
@item.Text
</BreadcrumbItem>
}
</Breadcrumb>
}
}
</Breadcrumb>
@if (Options.Value.RenderToolbar)
{
@ -38,7 +37,7 @@
{
@ChildContent
}
@foreach (var toolbarItemRender in ToolbarItemRenders)
{
<div class="px-1 pt-2">

1
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.csproj

@ -13,5 +13,6 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Lsw.Abp.AntDesignUI\Lsw.Abp.AntDesignUI.csproj" />
</ItemGroup>
</Project>

4
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesign/App.razor → modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/App.razor

@ -5,7 +5,7 @@
<Router AppAssembly="RouterOptions.Value.AppAssembly"
AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
<Found Context="routeData">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)">
<AuthorizeRouteView RouteData="@routeData" DefaultLayout="@typeof(DefaultLayout)">
<NotAuthorized>
@if (!context.User.Identity.IsAuthenticated)
{
@ -19,7 +19,7 @@
</AuthorizeRouteView>
</Found>
<NotFound>
<LayoutView Layout="@typeof(MainLayout)">
<LayoutView Layout="@typeof(DefaultLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>

16
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/AppWithoutAuth.razor

@ -0,0 +1,16 @@
@using Microsoft.Extensions.Options
@using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing
@inject IOptions<AbpRouterOptions> RouterOptions
<Router AppAssembly="RouterOptions.Value.AppAssembly"
AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(DefaultLayout)"/>
</Found>
<NotFound>
<LayoutView Layout="@typeof(DefaultLayout)">
<p>Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
<AntContainer/>

10
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/Branding.razor

@ -0,0 +1,10 @@
@using Volo.Abp.Ui.Branding
@inject IBrandingProvider BrandingProvider
<a class="ant-design-brand" href="">
@if (!BrandingProvider.LogoUrl.IsNullOrWhiteSpace())
{
<img src="@BrandingProvider.LogoUrl.TrimStart('/','~')" alt="@BrandingProvider.AppName"/>
}
@BrandingProvider.AppName
</a>

49
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor

@ -0,0 +1,49 @@
@inherits LayoutComponentBase
@using Microsoft.Extensions.Options
@inject IOptions<AbpAntDesignThemeOptions> Options
@if (Options.Value.Menu.Place == MenuOptions.MenuPlace.Top)
{
<Layout Class="ant-design-layout">
<Header Class="ant-design-header">
<Branding/>
<MainMenu/>
</Header>
<Content Class="ant-design-content">
<PageAlert/>
@Body
<UiPageProgress/>
</Content>
<Footer Class="ant-design-footer">Footer</Footer>
</Layout>
}
else
{
<Layout Class="ant-design-layout">
<Sider
Class="ant-design-side"
Collapsible
Collapsed=Collapsed>
<Branding/>
<MainMenu/>
</Sider>
<Layout Class="ant-design-layout">
<Header Class="ant-design-header">
@if (Collapsed)
{
<Icon Type="menu-unfold" Theme="outline" Class="trigger" OnClick="OnCollapse" />
}
else
{
<Icon Type="menu-fold" Theme="outline" Class="trigger" OnClick="OnCollapse" />
}
</Header>
<Content Class="ant-design-content">
<PageAlert/>
@Body
<UiPageProgress/>
</Content>
<Footer Class="ant-design-footer"></Footer>
</Layout>
</Layout>
}

11
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor.cs

@ -0,0 +1,11 @@
namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Themes.AntDesignTheme;
public partial class DefaultLayout
{
protected bool Collapsed { get; set; }
protected void OnCollapse()
{
Collapsed = !Collapsed;
}
}

0
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesign/MainMenu.razor → modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenu.razor

7
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesign/MainMenu.razor.cs → modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenu.razor.cs

@ -5,10 +5,12 @@ using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.Extensions.Options;
using Volo.Abp.UI.Navigation;
namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Themes.AntDesign;
namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Themes.AntDesignTheme;
public partial class MainMenu : IDisposable
{
protected ApplicationMenu Menu { get; set; }
[Inject]
protected IMenuManager MenuManager { get; set; }
@ -17,9 +19,6 @@ public partial class MainMenu : IDisposable
[Inject]
protected AuthenticationStateProvider AuthenticationStateProvider { get; set; }
protected ApplicationMenu Menu { get; set; }
protected override async Task OnInitializedAsync()
{

18
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesign/MainMenuItem.razor → modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor

@ -25,21 +25,3 @@
</SubMenu>
}
}
@code {
[Parameter]
public ApplicationMenuItem Menu { get; set; }
private RenderFragment GetSubMenuTemplate()
{
return @<span>
@if (Menu.Icon != null)
{
<Icon Type="@Menu.Icon" Theme="outline"></Icon>
}
<span>@Menu.Name</span>
</span>;
}
}

23
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor.cs

@ -0,0 +1,23 @@
using AntDesign;
using Microsoft.AspNetCore.Components;
using Volo.Abp.UI.Navigation;
namespace Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Themes.AntDesignTheme;
public partial class MainMenuItem : ComponentBase
{
[Parameter]
public ApplicationMenuItem Menu { get; set; }
private RenderFragment GetSubMenuTemplate()
{
return null;
// return @<span>
// @if (Menu.Icon != null)
// {
// <Icon Type="@Menu.Icon" Theme="outline"></Icon>
// }
// <span>@Menu.Name</span>
// </span>;
}
}

0
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesign/_Imports.razor → modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/_Imports.razor

14
modules/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/wwwroot/libs/abp/css/theme.css

@ -0,0 +1,14 @@
html,
body,
#root,
#app,
#ApplicationContainer,
app {
height: 100%;
}
.colorWeak {
filter: invert(80%);
}
.ant-layout {
min-height: 100vh;
}

3
modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/ComponentsComponentsBundleContributor.cs

@ -6,7 +6,7 @@ public class ComponentsComponentsBundleContributor : IBundleContributor
{
public void AddScripts(BundleContext context)
{
context.Add("_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js");
//context.Add("_content/Microsoft.AspNetCore.Components.WebAssembly.Authentication/AuthenticationService.js");
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js");
context.Add("_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/lang-utils.js");
context.Add("_content/AntDesign/js/ant-design-blazor.js");
@ -15,5 +15,6 @@ public class ComponentsComponentsBundleContributor : IBundleContributor
public void AddStyles(BundleContext context)
{
context.Add("_content/AntDesign/css/ant-design-blazor.css");
context.Add("_content/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/libs/abp/css/theme.css");
}
}

3
modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait />
</Weavers>

9
modules/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme/Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.csproj

@ -1,17 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\configureawait.props"/>
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme\Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.csproj" />
<ProjectReference Include="..\Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme\Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.csproj"/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly" Version="5.1.3" />
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly" Version="5.1.3"/>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="6.0.1"/>
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0"/>
</ItemGroup>
</Project>

1
src/Lsw.Abp.AntDesignUI/AbpAntDesignUIModule.cs

@ -16,5 +16,6 @@ public class AbpAntDesignUIModule : AbpModule
public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.AddAntDesign();
context.Services.AddSingleton(typeof(AbpBlazorMessageLocalizerHelper<>));
}
}

25
src/Lsw.Abp.AntDesignUI/Components/UiPageProgress.razor

@ -1,12 +1,23 @@
@if (_percent is >= 0 and <= 100)
{
if (_progressStatus == ProgressStatus.Active)
{
<div Class="uiPageProgress">
if (_progressStatus == ProgressStatus.Active)
{
<Progress StrokeColor="_gradients" Percent=_percent.Value></Progress>
}
else
{
}
else
{
<Progress Percent=_percent.Value></Progress>
}
}
</div>
}
<style>
.uiPageProgress{
top: 0 !important;
left: 0 !important;
width: 100% !important;
z-index: 9999 !important;
position: fixed !important;
}
</style>

19
test/AntDesignUIApp/AntDesignUIApp.csproj

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="6.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="6.0.1" PrivateAssets="all" />
<PackageReference Include="Volo.Abp.Autofac.WebAssembly" Version="5.1.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\modules\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme\Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme.csproj" />
</ItemGroup>
</Project>

44
test/AntDesignUIApp/AntDesignUIAppModule.cs

@ -0,0 +1,44 @@
using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Routing;
using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Themes.AntDesignTheme;
using Lsw.Abp.AspnetCore.Components.WebAssembly.AntDesignTheme;
using Microsoft.AspNetCore.Components.Authorization;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies;
using Volo.Abp.Autofac.WebAssembly;
using Volo.Abp.Modularity;
namespace AntDesignUIApp;
[DependsOn(
typeof(AbpAutofacWebAssemblyModule),
typeof(AbpAspNetCoreComponentsWebAssemblyAntDesignThemeModule))]
public class AntDesignUIAppModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var environment = context.Services.GetSingletonInstance<IWebAssemblyHostEnvironment>();
var builder = context.Services.GetSingletonInstance<WebAssemblyHostBuilder>();
Configure<AbpRouterOptions>(options =>
{
options.AppAssembly = typeof(AntDesignUIAppModule).Assembly;
});
context.Services.AddTransient(sp => new HttpClient
{
BaseAddress = new Uri(environment.BaseAddress)
});
context.Services.AddAuthorizationCore();
context.Services.AddAlwaysAllowAuthorization();
context.Services.AddScoped<AuthenticationStateProvider, FakeAuthStateProvider>();
builder.RootComponents.Add<AppWithoutAuth>("#ApplicationContainer");
context.Services.RemoveAll(x => x.ImplementationType == typeof(AbpApplicationConfigurationClientProxy));
context.Services.AddTransient<AbpApplicationConfigurationClientProxy, FakeAbpApplicationConfigurationAppService>();
}
}

29
test/AntDesignUIApp/FakeAbpApplicationConfigurationAppService.cs

@ -0,0 +1,29 @@
using Volo.Abp.AspNetCore.Components.WebAssembly;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ObjectExtending;
using Volo.Abp.AspNetCore.Mvc.MultiTenancy;
using Volo.Abp.DependencyInjection;
namespace AntDesignUIApp;
public class FakeAbpApplicationConfigurationAppService : AbpApplicationConfigurationClientProxy
{
public override Task<ApplicationConfigurationDto> GetAsync()
{
var result = new ApplicationConfigurationDto()
{
Setting =new ApplicationSettingConfigurationDto(),
Auth = new ApplicationAuthConfigurationDto(),
Clock = new ClockDto(),
CurrentTenant = new CurrentTenantDto(),
CurrentUser = new CurrentUserDto(),
Features = new ApplicationFeatureConfigurationDto(),
Localization = new ApplicationLocalizationConfigurationDto(),
MultiTenancy = new MultiTenancyInfoDto(),
ObjectExtensions = new ObjectExtensionsDto(),
Timing = new TimingDto()
};
return Task.FromResult(result);
}
}

13
test/AntDesignUIApp/FakeAuthStateProvider.cs

@ -0,0 +1,13 @@
using System.Security.Claims;
using Microsoft.AspNetCore.Components.Authorization;
namespace AntDesignUIApp;
public class FakeAuthStateProvider : AuthenticationStateProvider
{
public override async Task<AuthenticationState> GetAuthenticationStateAsync()
{
var anonymous = new ClaimsIdentity();
return await Task.FromResult(new AuthenticationState(new ClaimsPrincipal(anonymous)));
}
}

5
test/AntDesignUIApp/Pages/Index.razor

@ -0,0 +1,5 @@
@page "/"
<AbpPageHeader Title="Index" BreadcrumbItems="@BreadcrumbItems"/>
<p>hello world</p>

17
test/AntDesignUIApp/Pages/Index.razor.cs

@ -0,0 +1,17 @@
using Lsw.Abp.AntDesignUI;
using Microsoft.AspNetCore.Components;
namespace AntDesignUIApp.Pages;
public partial class Index : ComponentBase
{
public List<BreadcrumbItem> BreadcrumbItems { get; set; } = new();
protected override void OnInitialized()
{
BreadcrumbItems = new List<BreadcrumbItem>()
{
new("Index")
};
}
}

16
test/AntDesignUIApp/Program.cs

@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Components.Web;
using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
using AntDesignUIApp;
var builder = WebAssemblyHostBuilder.CreateDefault(args);
var application = await builder.AddApplicationAsync<AntDesignUIAppModule>(options =>
{
options.UseAutofac();
});
var host = builder.Build();
await application.InitializeApplicationAsync(host.Services);
await host.RunAsync();

30
test/AntDesignUIApp/Properties/launchSettings.json

@ -0,0 +1,30 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:35665",
"sslPort": 44353
}
},
"profiles": {
"AntDesignUIApp": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"applicationUrl": "https://localhost:7161;http://localhost:5161",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

13
test/AntDesignUIApp/_Imports.razor

@ -0,0 +1,13 @@
@using System.Net.Http
@using System.Net.Http.Json
@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 Microsoft.JSInterop
@using AntDesignUIApp
@using Lsw.Abp.AntDesignUI
@using Lsw.Abp.AntDesignUI.Components
@using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Layout;

3
test/AntDesignUIApp/wwwroot/appsettings.json

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

BIN
test/AntDesignUIApp/wwwroot/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

2
test/AntDesignUIApp/wwwroot/global.css

File diff suppressed because one or more lines are too long

10
test/AntDesignUIApp/wwwroot/global.js

File diff suppressed because one or more lines are too long

BIN
test/AntDesignUIApp/wwwroot/icon-192.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

27
test/AntDesignUIApp/wwwroot/index.html

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>AntDesignUIApp</title>
<base href="/" />
<!--ABP:Styles-->
<link href="global.css?_v=637816878164034163" rel="stylesheet"/>
<!--/ABP:Styles-->
</head>
<body class="abp-application-layout bg-light">
<div id="ApplicationContainer">
<div class="spinner">
<div class="double-bounce1"></div>
<div class="double-bounce2"></div>
</div>
</div>
<!--ABP:Scripts-->
<script src="global.js?_v=637816878165418374"></script>
<!--/ABP:Scripts-->
</body>
</html>

27
test/AntDesignUIApp/wwwroot/sample-data/weather.json

@ -0,0 +1,27 @@
[
{
"date": "2018-05-06",
"temperatureC": 1,
"summary": "Freezing"
},
{
"date": "2018-05-07",
"temperatureC": 14,
"summary": "Bracing"
},
{
"date": "2018-05-08",
"temperatureC": -13,
"summary": "Freezing"
},
{
"date": "2018-05-09",
"temperatureC": -16,
"summary": "Balmy"
},
{
"date": "2018-05-10",
"temperatureC": -2,
"summary": "Chilly"
}
]
Loading…
Cancel
Save