mirror of https://github.com/abpframework/eventhub
28 changed files with 1413 additions and 195 deletions
@ -0,0 +1,31 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly"> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
<BlazorWebAssemblyLoadAllGlobalizationData>true</BlazorWebAssemblyLoadAllGlobalizationData> |
|||
<BlazorWebAssemblyEnableLinking>false</BlazorWebAssemblyEnableLinking> |
|||
<RootNamespace>EventHub.Admin</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Blazorise.Bootstrap" Version="0.9.3-preview6" /> |
|||
<PackageReference Include="Blazorise.Icons.FontAwesome" Version="0.9.3-preview6" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.*" /> |
|||
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.*" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Autofac.WebAssembly" Version="4.2.0-rc.1" /> |
|||
<PackageReference Include="Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme" Version="4.2.0-rc.1" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Identity.Blazor" Version="4.2.0-rc.1" /> |
|||
<PackageReference Include="Volo.Abp.TenantManagement.Blazor" Version="4.2.0-rc.1" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\src\EventHub.HttpApi.Client\EventHub.HttpApi.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,12 @@ |
|||
using AutoMapper; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
public class EventHubBlazorAutoMapperProfile : Profile |
|||
{ |
|||
public EventHubBlazorAutoMapperProfile() |
|||
{ |
|||
//Define your AutoMapper configuration here for the Blazor project.
|
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,102 @@ |
|||
using System; |
|||
using System.Net.Http; |
|||
using Blazorise.Bootstrap; |
|||
using Blazorise.Icons.FontAwesome; |
|||
using EventHub.Admin.Menus; |
|||
using IdentityModel; |
|||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.BasicTheme.Themes.Basic; |
|||
using Volo.Abp.AspNetCore.Components.WebAssembly.Theming.Routing; |
|||
using Volo.Abp.Autofac.WebAssembly; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.Identity.Blazor; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.TenantManagement.Blazor; |
|||
using Volo.Abp.UI.Navigation; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
[DependsOn( |
|||
typeof(AbpAutofacWebAssemblyModule), |
|||
typeof(EventHubHttpApiClientModule), |
|||
typeof(AbpAspNetCoreComponentsWebAssemblyBasicThemeModule), |
|||
typeof(AbpIdentityBlazorModule), |
|||
typeof(AbpTenantManagementBlazorModule) |
|||
)] |
|||
public class EventHubBlazorModule : 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); |
|||
ConfigureUI(builder); |
|||
ConfigureMenu(context); |
|||
ConfigureAutoMapper(context); |
|||
} |
|||
|
|||
private void ConfigureRouter(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpRouterOptions>(options => |
|||
{ |
|||
options.AppAssembly = typeof(EventHubBlazorModule).Assembly; |
|||
}); |
|||
} |
|||
|
|||
private void ConfigureMenu(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpNavigationOptions>(options => |
|||
{ |
|||
options.MenuContributors.Add(new EventHubMenuContributor(context.Services.GetConfiguration())); |
|||
}); |
|||
} |
|||
|
|||
private void ConfigureBlazorise(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services |
|||
.AddBootstrapProviders() |
|||
.AddFontAwesomeIcons(); |
|||
} |
|||
|
|||
private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) |
|||
{ |
|||
builder.Services.AddOidcAuthentication(options => |
|||
{ |
|||
builder.Configuration.Bind("AuthServer", options.ProviderOptions); |
|||
options.UserOptions.RoleClaim = JwtClaimTypes.Role; |
|||
options.ProviderOptions.DefaultScopes.Add("EventHub"); |
|||
options.ProviderOptions.DefaultScopes.Add("role"); |
|||
options.ProviderOptions.DefaultScopes.Add("email"); |
|||
options.ProviderOptions.DefaultScopes.Add("phone"); |
|||
}); |
|||
} |
|||
|
|||
private static void ConfigureUI(WebAssemblyHostBuilder builder) |
|||
{ |
|||
builder.RootComponents.Add<App>("#ApplicationContainer"); |
|||
} |
|||
|
|||
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<EventHubBlazorModule>(); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Ui.Branding; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
[Dependency(ReplaceServices = true)] |
|||
public class EventHubBrandingProvider : DefaultBrandingProvider |
|||
{ |
|||
public override string AppName => "EventHub"; |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using Volo.Abp.Bundling; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
public class EventHubBundleContributor : IBundleContributor |
|||
{ |
|||
public void AddScripts(BundleContext context) |
|||
{ |
|||
} |
|||
|
|||
public void AddStyles(BundleContext context) |
|||
{ |
|||
context.Add("main.css", true); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,13 @@ |
|||
using EventHub.Localization; |
|||
using Volo.Abp.AspNetCore.Components; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
public abstract class EventHubComponentBase : AbpComponentBase |
|||
{ |
|||
protected EventHubComponentBase() |
|||
{ |
|||
LocalizationResource = typeof(EventHubResource); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,71 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EventHub.Localization; |
|||
using Microsoft.Extensions.Configuration; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Account.Localization; |
|||
using Volo.Abp.UI.Navigation; |
|||
using Volo.Abp.Users; |
|||
|
|||
namespace EventHub.Admin.Menus |
|||
{ |
|||
public class EventHubMenuContributor : IMenuContributor |
|||
{ |
|||
private readonly IConfiguration _configuration; |
|||
|
|||
public EventHubMenuContributor(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<EventHubResource>(); |
|||
|
|||
context.Menu.Items.Insert( |
|||
0, |
|||
new ApplicationMenuItem( |
|||
EventHubMenus.Home, |
|||
l["Menu:Home"], |
|||
"/", |
|||
icon: "fas fa-home" |
|||
) |
|||
); |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
|
|||
private Task ConfigureUserMenuAsync(MenuConfigurationContext context) |
|||
{ |
|||
var accountStringLocalizer = context.GetLocalizer<AccountResource>(); |
|||
var currentUser = context.ServiceProvider.GetRequiredService<ICurrentUser>(); |
|||
|
|||
var identityServerUrl = _configuration["AuthServer:Authority"] ?? ""; |
|||
|
|||
if (currentUser.IsAuthenticated) |
|||
{ |
|||
context.Menu.AddItem(new ApplicationMenuItem( |
|||
"Account.Manage", |
|||
accountStringLocalizer["ManageYourProfile"], |
|||
$"{identityServerUrl.EnsureEndsWith('/')}Account/Manage?returnUrl={_configuration["App:SelfUrl"]}", |
|||
icon: "fa fa-cog", |
|||
order: 1000, |
|||
null)); |
|||
} |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
namespace EventHub.Admin.Menus |
|||
{ |
|||
public class EventHubMenus |
|||
{ |
|||
private const string Prefix = "EventHub"; |
|||
public const string Home = Prefix + ".Home"; |
|||
|
|||
//Add your menu items here...
|
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,155 @@ |
|||
@page "/" |
|||
@using Volo.Abp.MultiTenancy |
|||
@inherits EventHubComponentBase |
|||
@inject ICurrentTenant CurrentTenant |
|||
@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>EventHub</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="/authentication/login"> |
|||
<i class="fa fa-sign-in-alt"></i> @L["Login"] |
|||
</a> |
|||
} |
|||
</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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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-left"> |
|||
<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> |
|||
@ -0,0 +1,7 @@ |
|||
namespace EventHub.Admin.Pages |
|||
{ |
|||
public partial class Index |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Components.WebAssembly.Hosting; |
|||
|
|||
namespace EventHub.Admin |
|||
{ |
|||
public class Program |
|||
{ |
|||
public static async Task Main(string[] args) |
|||
{ |
|||
var builder = WebAssemblyHostBuilder.CreateDefault(args); |
|||
|
|||
var application = builder.AddApplication<EventHubBlazorModule>(options => |
|||
{ |
|||
options.UseAutofac(); |
|||
}); |
|||
|
|||
var host = builder.Build(); |
|||
|
|||
await application.InitializeAsync(host.Services); |
|||
|
|||
await host.RunAsync(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,29 @@ |
|||
{ |
|||
"iisSettings": { |
|||
"windowsAuthentication": false, |
|||
"anonymousAuthentication": true, |
|||
"iisExpress": { |
|||
"applicationUrl": "https://localhost:44307", |
|||
"sslPort": 44307 |
|||
} |
|||
}, |
|||
"profiles": { |
|||
"IIS Express": { |
|||
"commandName": "IISExpress", |
|||
"launchBrowser": true, |
|||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
}, |
|||
"EventHub.Blazor": { |
|||
"commandName": "Project", |
|||
"launchBrowser": true, |
|||
"inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}", |
|||
"applicationUrl": "https://localhost:44307", |
|||
"environmentVariables": { |
|||
"ASPNETCORE_ENVIRONMENT": "Development" |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
@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.AspNetCore.Components.WebAssembly.Http |
|||
@using Microsoft.JSInterop |
|||
@using Volo.Abp.AspNetCore.Components.WebAssembly |
|||
@using Blazorise |
|||
@using Blazorise.DataGrid |
|||
@using Volo.Abp.BlazoriseUI |
|||
@using Volo.Abp.BlazoriseUI.Components |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
{ |
|||
"App": { |
|||
"SelfUrl": "https://localhost:44307" |
|||
}, |
|||
"AuthServer": { |
|||
"Authority": "https://localhost:44361", |
|||
"ClientId": "EventHub_Blazor", |
|||
"ResponseType": "code" |
|||
}, |
|||
"RemoteServices": { |
|||
"Default": { |
|||
"BaseUrl": "https://localhost:44349" |
|||
} |
|||
}, |
|||
"AbpCli": { |
|||
"Bundle": { |
|||
"Mode": "BundleAndMinify", |
|||
"Name": "global", |
|||
"Parameters": { |
|||
|
|||
} |
|||
} |
|||
} |
|||
} |
|||
|
After Width: | Height: | Size: 31 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,29 @@ |
|||
<!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>EventHub.Blazor</title> |
|||
<base href="/" /> |
|||
|
|||
<!--ABP:Styles--> |
|||
<link href="global.css?_v=637453952859170535" rel="stylesheet"/> |
|||
<link href="main.css" 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=637453952867128601"></script> |
|||
<!--/ABP:Scripts--> |
|||
|
|||
</body> |
|||
</html> |
|||
@ -0,0 +1,48 @@ |
|||
.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); |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.Identity; |
|||
|
|||
namespace EventHub.HttpApi.Client.ConsoleTestApp |
|||
{ |
|||
public class ClientDemoService : ITransientDependency |
|||
{ |
|||
private readonly IProfileAppService _profileAppService; |
|||
|
|||
public ClientDemoService(IProfileAppService profileAppService) |
|||
{ |
|||
_profileAppService = profileAppService; |
|||
} |
|||
|
|||
public async Task RunAsync() |
|||
{ |
|||
var output = await _profileAppService.GetAsync(); |
|||
Console.WriteLine($"UserName : {output.UserName}"); |
|||
Console.WriteLine($"Email : {output.Email}"); |
|||
Console.WriteLine($"Name : {output.Name}"); |
|||
Console.WriteLine($"Surname : {output.Surname}"); |
|||
} |
|||
} |
|||
} |
|||
@ -1,26 +0,0 @@ |
|||
using Microsoft.Extensions.Hosting; |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp; |
|||
|
|||
namespace EventHub.HttpApi.Client.ConsoleTestApp |
|||
{ |
|||
public class ConsoleTestAppHostedService : IHostedService |
|||
{ |
|||
public async Task StartAsync(CancellationToken cancellationToken) |
|||
{ |
|||
using (var application = AbpApplicationFactory.Create<EventHubConsoleApiClientModule>()) |
|||
{ |
|||
application.Initialize(); |
|||
|
|||
var demo = application.ServiceProvider.GetRequiredService<ClientDemoService>(); |
|||
await demo.RunAsync(); |
|||
|
|||
application.Shutdown(); |
|||
} |
|||
} |
|||
|
|||
public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; |
|||
} |
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<PropertyGroup> |
|||
<OutputType>Exe</OutputType> |
|||
<TargetFramework>net5.0</TargetFramework> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<None Remove="appsettings.json" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<Content Include="appsettings.json"> |
|||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |
|||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> |
|||
</Content> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel" Version="4.2.0-rc.1" /> |
|||
<ProjectReference Include="..\..\src\EventHub.HttpApi.Client\EventHub.HttpApi.Client.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.*" /> |
|||
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="5.0.*" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -1,29 +0,0 @@ |
|||
using System; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Polly; |
|||
using Volo.Abp.Http.Client; |
|||
using Volo.Abp.Http.Client.IdentityModel; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace EventHub.HttpApi.Client.ConsoleTestApp |
|||
{ |
|||
[DependsOn( |
|||
typeof(EventHubHttpApiClientModule), |
|||
typeof(AbpHttpClientIdentityModelModule) |
|||
)] |
|||
public class EventHubConsoleApiClientModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
PreConfigure<AbpHttpClientBuilderOptions>(options => |
|||
{ |
|||
options.ProxyClientBuildActions.Add((remoteServiceName, clientBuilder) => |
|||
{ |
|||
clientBuilder.AddTransientHttpErrorPolicy( |
|||
policyBuilder => policyBuilder.WaitAndRetryAsync(3, i => TimeSpan.FromSeconds(Math.Pow(2, i))) |
|||
); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -1,21 +0,0 @@ |
|||
using System.Threading.Tasks; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Microsoft.Extensions.Hosting; |
|||
|
|||
namespace EventHub.HttpApi.Client.ConsoleTestApp |
|||
{ |
|||
class Program |
|||
{ |
|||
static async Task Main(string[] args) |
|||
{ |
|||
await CreateHostBuilder(args).RunConsoleAsync(); |
|||
} |
|||
|
|||
public static IHostBuilder CreateHostBuilder(string[] args) => |
|||
Host.CreateDefaultBuilder(args) |
|||
.ConfigureServices((hostContext, services) => |
|||
{ |
|||
services.AddHostedService<ConsoleTestAppHostedService>(); |
|||
}); |
|||
} |
|||
} |
|||
@ -1,18 +0,0 @@ |
|||
{ |
|||
"RemoteServices": { |
|||
"Default": { |
|||
"BaseUrl": "https://localhost:44361" |
|||
} |
|||
}, |
|||
"IdentityClients": { |
|||
"Default": { |
|||
"GrantType": "password", |
|||
"ClientId": "EventHub_App", |
|||
"ClientSecret": "1q2w3e*", |
|||
"UserName": "admin", |
|||
"UserPassword": "1q2w3E*", |
|||
"Authority": "https://localhost:44361", |
|||
"Scope": "EventHub" |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue