mirror of https://github.com/abpframework/abp.git
1085 changed files with 202533 additions and 1452 deletions
@ -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 |
|||
@ -0,0 +1,90 @@ |
|||
# Angular UI v4.3 Migration Guide |
|||
|
|||
## Breaking Changes |
|||
|
|||
### Manage Profile Page |
|||
|
|||
Before v4.3, the "Manage Your Profile" link in the current user dropdown on the top bar redirected the user to MVC's profile management page. As of v4.3, the same link will land on a page in the Angular UI account module instead. So you have to install and implement the account module to your Angular project when you update the ABP to v4.3. |
|||
|
|||
#### Account Module Implementation |
|||
|
|||
Install the `@abp/ng.account` NPM package by running the below command: |
|||
|
|||
```bash |
|||
npm install @abp/ng.account@next |
|||
``` |
|||
|
|||
> Make sure v4.3-rc or higher version is installed. |
|||
|
|||
Open the `app.module.ts` and add `AccountConfigModule.forRoot()` to the imports array as shown below: |
|||
|
|||
```js |
|||
// app.module.ts |
|||
|
|||
import { AccountConfigModule } from '@abp/ng.account/config'; |
|||
//... |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
//... |
|||
AccountConfigModule.forRoot() |
|||
], |
|||
//... |
|||
}) |
|||
export class AppModule {} |
|||
``` |
|||
|
|||
Open the `app-routing.module.ts` and add the `account` route to `routes` array as follows: |
|||
|
|||
```js |
|||
// app-routing.module.ts |
|||
const routes: Routes = [ |
|||
//... |
|||
{ |
|||
path: 'account', |
|||
loadChildren: () => import('@abp/ng.account').then(m => m.AccountModule.forLazy()), |
|||
}, |
|||
//... |
|||
export class AppRoutingModule {} |
|||
``` |
|||
|
|||
#### Account Module Implementation for Commercial Templates |
|||
|
|||
The pro startup template comes with `@volo/abp.ng.account` package. You should update the package version to v4.3-rc or higher version. The package can be updated by running the following command: |
|||
|
|||
```bash |
|||
npm install @volo/abp.ng.account@next |
|||
``` |
|||
> Make sure v4.3-rc or higher version is installed. |
|||
|
|||
`AccountConfigModule` is already imported to `app.module.ts` in the startup template. So no need to import the module to the `AppModule`. If you removed the `AccountConfigModule` from the `AppModule`, you can import it as shown below: |
|||
|
|||
```js |
|||
// app.module.ts |
|||
|
|||
import { AccountConfigModule } from '@volo/abp.ng.account/config'; |
|||
//... |
|||
|
|||
@NgModule({ |
|||
imports: [ |
|||
//... |
|||
AccountConfigModule.forRoot() |
|||
], |
|||
//... |
|||
}) |
|||
export class AppModule {} |
|||
``` |
|||
|
|||
Open the `app-routing.module.ts` and add the `account` route to `routes` array as follows: |
|||
|
|||
```js |
|||
// app-routing.module.ts |
|||
const routes: Routes = [ |
|||
//... |
|||
{ |
|||
path: 'account', |
|||
loadChildren: () => import('@volo/abp.ng.account').then(m => m.AccountPublicModule.forLazy()), |
|||
}, |
|||
//... |
|||
export class AppRoutingModule {} |
|||
``` |
|||
@ -0,0 +1,5 @@ |
|||
# ABP v4.3 Migration Guide |
|||
|
|||
## Angular UI |
|||
|
|||
See the [Angular UI Migration Guide](Abp-4_3-Angular.md). |
|||
@ -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)); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -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; |
|||
} |
|||
} |
|||
} |
|||
@ -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"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Bundling |
|||
{ |
|||
public class BlazorBasicThemeScriptContributor : BundleContributor |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -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"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -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 |
|||
); |
|||
} |
|||
} |
|||
@ -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> |
|||
@ -0,0 +1,33 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Components; |
|||
using Microsoft.AspNetCore.Components.Routing; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server.BasicTheme.Themes.Basic |
|||
{ |
|||
public partial class LoginDisplay : IDisposable |
|||
{ |
|||
[Inject] |
|||
protected IMenuManager MenuManager { get; set; } |
|||
|
|||
protected ApplicationMenu Menu { get; set; } |
|||
|
|||
protected override async Task OnInitializedAsync() |
|||
{ |
|||
Menu = await MenuManager.GetAsync(StandardMenus.User); |
|||
|
|||
Navigation.LocationChanged += OnLocationChanged; |
|||
} |
|||
|
|||
protected virtual void OnLocationChanged(object sender, LocationChangedEventArgs e) |
|||
{ |
|||
InvokeAsync(StateHasChanged); |
|||
} |
|||
|
|||
public void Dispose() |
|||
{ |
|||
Navigation.LocationChanged -= OnLocationChanged; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
@using System.Net.Http |
|||
@using Microsoft.AspNetCore.Components.Authorization |
|||
@using Microsoft.AspNetCore.Components.Forms |
|||
@using Microsoft.AspNetCore.Components.Routing |
|||
@using Microsoft.AspNetCore.Components.Web |
|||
@using Microsoft.JSInterop |
|||
@using Blazorise |
|||
@using Blazorise.DataGrid |
|||
@using Volo.Abp.BlazoriseUI; |
|||
@using Volo.Abp.BlazoriseUI.Components; |
|||
@ -0,0 +1,19 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.AspNetCore.WebUtilities" Version="2.2.0" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Server.Theming\Volo.Abp.AspNetCore.Components.Server.Theming.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.BasicTheme\Volo.Abp.AspNetCore.Components.Web.BasicTheme.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,36 @@ |
|||
using Volo.Abp.AspNetCore.Components.Server.Theming.Bundling; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server.Theming |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreComponentsServerModule), |
|||
typeof(AbpAspNetCoreMvcUiPackagesModule), |
|||
typeof(AbpAspNetCoreComponentsWebThemingModule) |
|||
)] |
|||
public class AbpAspNetCoreComponentsServerThemingModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpBundlingOptions>(options => |
|||
{ |
|||
options |
|||
.StyleBundles |
|||
.Add(BlazorStandardBundles.Styles.Global, bundle => |
|||
{ |
|||
bundle.AddContributors(typeof(BlazorGlobalStyleContributor)); |
|||
}); |
|||
|
|||
options |
|||
.ScriptBundles |
|||
.Add(BlazorStandardBundles.Scripts.Global, bundle => |
|||
{ |
|||
bundle.AddContributors(typeof(BlazorGlobalScriptContributor)); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
|||
{ |
|||
public class BlazorStandardBundles |
|||
{ |
|||
public static class Styles |
|||
{ |
|||
public static string Global = "Blazor.Global"; |
|||
} |
|||
|
|||
public static class Scripts |
|||
{ |
|||
public static string Global = "Blazor.Global"; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
|||
{ |
|||
public class BlazorGlobalScriptContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/_framework/blazor.server.js"); |
|||
context.Files.AddIfNotContains("/_content/Blazorise/blazorise.js"); |
|||
context.Files.AddIfNotContains("/_content/Blazorise.Bootstrap/blazorise.bootstrap.js"); |
|||
context.Files.AddIfNotContains("/_content/Volo.Abp.AspNetCore.Components.Web/libs/abp/js/abp.js"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.Bootstrap; |
|||
using Volo.Abp.AspNetCore.Mvc.UI.Packages.FontAwesome; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server.Theming.Bundling |
|||
{ |
|||
[DependsOn( |
|||
typeof(BootstrapStyleContributor), |
|||
typeof(FontAwesomeStyleContributor) |
|||
)] |
|||
public class BlazorGlobalStyleContributor : BundleContributor |
|||
{ |
|||
public override void ConfigureBundle(BundleConfigurationContext context) |
|||
{ |
|||
context.Files.AddIfNotContains("/_content/Blazorise/blazorise.css"); |
|||
context.Files.AddIfNotContains("/_content/Blazorise.Bootstrap/blazorise.bootstrap.css"); |
|||
context.Files.AddIfNotContains("/_content/Blazorise.Snackbar/blazorise.snackbar.css"); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,18 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<IsPackable>true</IsPackable> |
|||
<OutputType>Library</OutputType> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Server\Volo.Abp.AspNetCore.Components.Server.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Mvc.UI.Packages\Volo.Abp.AspNetCore.Mvc.UI.Packages.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,17 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<IsPackable>true</IsPackable> |
|||
<OutputType>Library</OutputType> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore\Volo.Abp.AspNetCore.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,26 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.FileProviders; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Server |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreModule) |
|||
)] |
|||
public class AbpAspNetCoreComponentsServerModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddServerSideBlazor(); |
|||
} |
|||
|
|||
public override void OnApplicationInitialization(ApplicationInitializationContext context) |
|||
{ |
|||
context.GetEnvironment().WebRootFileProvider = |
|||
new CompositeFileProvider( |
|||
new ManifestEmbeddedFileProvider(typeof(IServerSideBlazorBuilder).Assembly), |
|||
context.GetEnvironment().WebRootFileProvider |
|||
); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAspNetCoreComponentsWebThemingModule) |
|||
)] |
|||
public class AbpAspNetCoreComponentsWebBasicThemeModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -1,5 +1,5 @@ |
|||
@using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing |
|||
@using Microsoft.Extensions.Options |
|||
@using Volo.Abp.AspNetCore.Components.Web.Theming.Routing |
|||
@inject IOptions<AbpRouterOptions> RouterOptions |
|||
<CascadingAuthenticationState> |
|||
<Router AppAssembly="RouterOptions.Value.AppAssembly" |
|||
@ -1,9 +1,9 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Components; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars; |
|||
using Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic |
|||
namespace Volo.Abp.AspNetCore.Components.Web.BasicTheme.Themes.Basic |
|||
{ |
|||
public partial class NavToolbar |
|||
{ |
|||
@ -1,5 +1,4 @@ |
|||
@inject NavigationManager Navigation |
|||
@using Microsoft.AspNetCore.Components.WebAssembly.Authentication |
|||
@code { |
|||
protected override void OnInitialized() |
|||
{ |
|||
@ -0,0 +1,10 @@ |
|||
@using System.Net.Http |
|||
@using Microsoft.AspNetCore.Components.Authorization |
|||
@using Microsoft.AspNetCore.Components.Forms |
|||
@using Microsoft.AspNetCore.Components.Routing |
|||
@using Microsoft.AspNetCore.Components.Web |
|||
@using Microsoft.JSInterop |
|||
@using Blazorise |
|||
@using Blazorise.DataGrid |
|||
@using Volo.Abp.BlazoriseUI; |
|||
@using Volo.Abp.BlazoriseUI.Components; |
|||
@ -0,0 +1,14 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,15 @@ |
|||
using Volo.Abp.BlazoriseUI; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpBlazoriseUIModule), |
|||
typeof(AbpUiNavigationModule) |
|||
)] |
|||
public class AbpAspNetCoreComponentsWebThemingModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -1,6 +1,6 @@ |
|||
using System.Reflection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Routing |
|||
{ |
|||
public class AbpRouterOptions |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using System.Collections.Generic; |
|||
using System.Reflection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Routing |
|||
{ |
|||
public class RouterAssemblyList : List<Assembly> |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public class AbpToolbarOptions |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public interface IToolbarContributor |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public interface IToolbarManager |
|||
{ |
|||
@ -1,4 +1,4 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public static class StandardToolbars |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public class Toolbar |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using System; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Toolbars |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Toolbars |
|||
{ |
|||
public class ToolbarItem |
|||
{ |
|||
@ -0,0 +1,15 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.BlazoriseUI\Volo.Abp.BlazoriseUI.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.UI.Navigation\Volo.Abp.UI.Navigation.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -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> |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.UI\Volo.Abp.UI.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components\Volo.Abp.AspNetCore.Components.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="$(MicrosoftPackageVersion)" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="$(MicrosoftPackageVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.Web |
|||
{ |
|||
public class AbpAspNetCoreApplicationCreationOptions |
|||
{ |
|||
public AbpApplicationCreationOptions ApplicationCreationOptions { get; } |
|||
|
|||
public AbpAspNetCoreApplicationCreationOptions( |
|||
AbpApplicationCreationOptions applicationCreationOptions) |
|||
{ |
|||
ApplicationCreationOptions = applicationCreationOptions; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using Microsoft.AspNetCore.Components; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.DependencyInjection.Extensions; |
|||
using Volo.Abp.AspNetCore.Components.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.UI; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpUiModule), |
|||
typeof(AbpAspNetCoreComponentsModule) |
|||
)] |
|||
public class AbpAspNetCoreComponentsWebModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.Replace(ServiceDescriptor.Transient<IComponentActivator, ServiceProviderComponentActivator>()); |
|||
|
|||
//context.Services
|
|||
// .GetHostBuilder().Logging
|
|||
// .AddProvider(new AbpExceptionHandlingLoggerProvider(context.Services));
|
|||
} |
|||
} |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
using Volo.Abp.AspNetCore.Components.Alerts; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.Alerts |
|||
namespace Volo.Abp.AspNetCore.Components.Web.Alerts |
|||
{ |
|||
public class AlertManager : IAlertManager, IScopedDependency |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
|||
namespace Volo.Abp.AspNetCore.Components.Web |
|||
{ |
|||
public class CookieOptions |
|||
{ |
|||
4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/DependencyInjection/WebAssemblyClientScopeServiceProviderAccessor.cs → framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs
4
framework/src/Volo.Abp.AspNetCore.Components.WebAssembly/Volo/Abp/AspNetCore/Components/WebAssembly/DependencyInjection/WebAssemblyClientScopeServiceProviderAccessor.cs → framework/src/Volo.Abp.AspNetCore.Components.Web/Volo/Abp/AspNetCore/Components/Web/DependencyInjection/ComponentsClientScopeServiceProviderAccessor.cs
@ -1,9 +1,9 @@ |
|||
using System; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.DependencyInjection |
|||
namespace Volo.Abp.AspNetCore.Components.Web.DependencyInjection |
|||
{ |
|||
public class WebAssemblyClientScopeServiceProviderAccessor : |
|||
public class ComponentsClientScopeServiceProviderAccessor : |
|||
IClientScopeServiceProviderAccessor, |
|||
ISingletonDependency |
|||
{ |
|||
@ -1,8 +1,9 @@ |
|||
using System; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
using Volo.Abp.AspNetCore.Components.ExceptionHandling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|||
namespace Volo.Abp.AspNetCore.Components.Web.ExceptionHandling |
|||
{ |
|||
public class AbpExceptionHandlingLogger : ILogger |
|||
{ |
|||
@ -1,7 +1,7 @@ |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Logging; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|||
namespace Volo.Abp.AspNetCore.Components.Web.ExceptionHandling |
|||
{ |
|||
public class AbpExceptionHandlingLoggerProvider : ILoggerProvider |
|||
{ |
|||
@ -1,6 +1,6 @@ |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
|||
namespace Volo.Abp.AspNetCore.Components.Web |
|||
{ |
|||
public interface IAbpUtilsService |
|||
{ |
|||
@ -1,7 +1,6 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
|||
namespace Volo.Abp.AspNetCore.Components.Web |
|||
{ |
|||
public interface ICookieService |
|||
{ |
|||
@ -1,16 +1,14 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.Razor"> |
|||
|
|||
<Import Project="..\..\..\configureawait.props" /> |
|||
<Import Project="..\..\..\common.props" /> |
|||
<Import Project="..\..\..\configureawait.props"/> |
|||
<Import Project="..\..\..\common.props"/> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\Volo.Abp.BlazoriseUI\Volo.Abp.BlazoriseUI.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.Http.Client.IdentityModel.WebAssembly\Volo.Abp.Http.Client.IdentityModel.WebAssembly.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.UI.Navigation\Volo.Abp.UI.Navigation.csproj" /> |
|||
<ProjectReference Include="..\Volo.Abp.AspNetCore.Components.Web.Theming\Volo.Abp.AspNetCore.Components.Web.Theming.csproj"/> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
|
|||
@ -1,17 +0,0 @@ |
|||
using Volo.Abp.Bundling; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly |
|||
{ |
|||
public class ComponentsWebAssemblyBundleContributor : IBundleContributor |
|||
{ |
|||
public void AddScripts(BundleContext context) |
|||
{ |
|||
context.Add("_content/Volo.Abp.AspNetCore.Components.WebAssembly/libs/abp/js/abp.js"); |
|||
} |
|||
|
|||
public void AddStyles(BundleContext context) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.ExceptionHandling |
|||
{ |
|||
public interface IUserExceptionInformer |
|||
{ |
|||
void Inform(UserExceptionInformerContext context); |
|||
} |
|||
} |
|||
@ -1,11 +0,0 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class WebAssemblyCurrentTenantAccessor : ICurrentTenantAccessor, ISingletonDependency |
|||
{ |
|||
public BasicTenantInfo Current { get; set; } |
|||
} |
|||
} |
|||
@ -1,70 +0,0 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.AspNetCore.Mvc.MultiTenancy; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Http.Client.DynamicProxying; |
|||
using Volo.Abp.MultiTenancy; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy |
|||
{ |
|||
public class WebAssemblyRemoteTenantStore : ITenantStore, ITransientDependency |
|||
{ |
|||
protected IHttpClientProxy<IAbpTenantAppService> Proxy { get; } |
|||
protected WebAssemblyRemoteTenantStoreCache Cache { get; } |
|||
|
|||
public WebAssemblyRemoteTenantStore( |
|||
IHttpClientProxy<IAbpTenantAppService> proxy, |
|||
WebAssemblyRemoteTenantStoreCache cache) |
|||
{ |
|||
Proxy = proxy; |
|||
Cache = cache; |
|||
} |
|||
|
|||
public async Task<TenantConfiguration> FindAsync(string name) |
|||
{ |
|||
var cached = Cache.Find(name); |
|||
if (cached != null) |
|||
{ |
|||
return cached; |
|||
} |
|||
|
|||
var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByNameAsync(name)); |
|||
Cache.Set(tenant); |
|||
return tenant; |
|||
} |
|||
|
|||
public async Task<TenantConfiguration> FindAsync(Guid id) |
|||
{ |
|||
var cached = Cache.Find(id); |
|||
if (cached != null) |
|||
{ |
|||
return cached; |
|||
} |
|||
|
|||
var tenant = CreateTenantConfiguration(await Proxy.Service.FindTenantByIdAsync(id)); |
|||
Cache.Set(tenant); |
|||
return tenant; |
|||
} |
|||
|
|||
public TenantConfiguration Find(string name) |
|||
{ |
|||
return AsyncHelper.RunSync(() => FindAsync(name)); |
|||
} |
|||
|
|||
public TenantConfiguration Find(Guid id) |
|||
{ |
|||
return AsyncHelper.RunSync(() => FindAsync(id)); |
|||
} |
|||
|
|||
protected virtual TenantConfiguration CreateTenantConfiguration(FindTenantResultDto tenantResultDto) |
|||
{ |
|||
if (!tenantResultDto.Success || tenantResultDto.TenantId == null) |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
return new TenantConfiguration(tenantResultDto.TenantId.Value, tenantResultDto.Name); |
|||
} |
|||
} |
|||
} |
|||
@ -1,35 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.MultiTenancy; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.WebAssembly.MultiTenancy |
|||
{ |
|||
public class WebAssemblyRemoteTenantStoreCache : IScopedDependency |
|||
{ |
|||
protected readonly List<TenantConfiguration> CachedTenants = new List<TenantConfiguration>(); |
|||
|
|||
public virtual TenantConfiguration Find(string name) |
|||
{ |
|||
return CachedTenants.FirstOrDefault(t => t.Name == name); |
|||
} |
|||
|
|||
public virtual TenantConfiguration Find(Guid id) |
|||
{ |
|||
return CachedTenants.FirstOrDefault(t => t.Id == id); |
|||
} |
|||
|
|||
public virtual void Set(TenantConfiguration tenant) |
|||
{ |
|||
var existingTenant = Find(tenant.Id); |
|||
if (existingTenant != null) |
|||
{ |
|||
existingTenant.Name = tenant.Name; |
|||
return; |
|||
} |
|||
|
|||
CachedTenants.Add(tenant); |
|||
} |
|||
} |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue