Browse Source

Added blazor admin app

pull/15/head
Halil İbrahim Kalkan 6 years ago
parent
commit
f69cffc771
  1. 14
      event-organizer/EventHub.sln
  2. 31
      event-organizer/src/EventHub.Admin/EventHub.Admin.csproj
  3. 12
      event-organizer/src/EventHub.Admin/EventHubBlazorAutoMapperProfile.cs
  4. 102
      event-organizer/src/EventHub.Admin/EventHubBlazorModule.cs
  5. 11
      event-organizer/src/EventHub.Admin/EventHubBrandingProvider.cs
  6. 16
      event-organizer/src/EventHub.Admin/EventHubBundleContributor.cs
  7. 13
      event-organizer/src/EventHub.Admin/EventHubComponentBase.cs
  8. 71
      event-organizer/src/EventHub.Admin/Menus/EventHubMenuContributor.cs
  9. 11
      event-organizer/src/EventHub.Admin/Menus/EventHubMenus.cs
  10. 155
      event-organizer/src/EventHub.Admin/Pages/Index.razor
  11. 7
      event-organizer/src/EventHub.Admin/Pages/Index.razor.cs
  12. 24
      event-organizer/src/EventHub.Admin/Program.cs
  13. 29
      event-organizer/src/EventHub.Admin/Properties/launchSettings.json
  14. 12
      event-organizer/src/EventHub.Admin/_Imports.razor
  15. 3
      event-organizer/src/EventHub.Admin/wwwroot/appsettings.Development.json
  16. 24
      event-organizer/src/EventHub.Admin/wwwroot/appsettings.json
  17. BIN
      event-organizer/src/EventHub.Admin/wwwroot/favicon.ico
  18. 17
      event-organizer/src/EventHub.Admin/wwwroot/global.css
  19. 791
      event-organizer/src/EventHub.Admin/wwwroot/global.js
  20. 29
      event-organizer/src/EventHub.Admin/wwwroot/index.html
  21. 48
      event-organizer/src/EventHub.Admin/wwwroot/main.css
  22. 39
      event-organizer/src/EventHub.Domain/IdentityServer/IdentityServerDataSeedContributor.cs
  23. 26
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs
  24. 26
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs
  25. 29
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHub.HttpApi.Client.ConsoleTestApp.csproj
  26. 29
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHubConsoleApiClientModule.cs
  27. 21
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/Program.cs
  28. 18
      event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/appsettings.json

14
event-organizer/EventHub.sln

@ -35,10 +35,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.TestBase", "test\E
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.Domain.Tests", "test\EventHub.Domain.Tests\EventHub.Domain.Tests.csproj", "{E512F4D9-9375-480F-A2F6-A46509F9D824}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.HttpApi.Client.ConsoleTestApp", "test\EventHub.HttpApi.Client.ConsoleTestApp\EventHub.HttpApi.Client.ConsoleTestApp.csproj", "{EF480016-9127-4916-8735-D2466BDBC582}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventHub.DbMigrator", "src\EventHub.DbMigrator\EventHub.DbMigrator.csproj", "{AA94D832-1CCC-4715-95A9-A483F23A1A5D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EventHub.Admin", "src\EventHub.Admin\EventHub.Admin.csproj", "{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -101,14 +101,14 @@ Global
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E512F4D9-9375-480F-A2F6-A46509F9D824}.Release|Any CPU.Build.0 = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF480016-9127-4916-8735-D2466BDBC582}.Release|Any CPU.Build.0 = Release|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA94D832-1CCC-4715-95A9-A483F23A1A5D}.Release|Any CPU.Build.0 = Release|Any CPU
{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -128,8 +128,8 @@ Global
{1FE30EB9-74A9-47F5-A9F6-7B1FAB672D81} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{91853F21-9CD9-4132-BC29-A7D5D84FFFE7} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{E512F4D9-9375-480F-A2F6-A46509F9D824} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{EF480016-9127-4916-8735-D2466BDBC582} = {04DBDB01-70F4-4E06-B468-8F87850B22BE}
{AA94D832-1CCC-4715-95A9-A483F23A1A5D} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
{7BB1EBA3-4B38-439D-BAE8-4A0801E21F72} = {CA9AC87F-097E-4F15-8393-4BC07735A5B0}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6AAFA1C6-603E-13FA-45E5-7910AA9F661D}

31
event-organizer/src/EventHub.Admin/EventHub.Admin.csproj

@ -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>

12
event-organizer/src/EventHub.Admin/EventHubBlazorAutoMapperProfile.cs

@ -0,0 +1,12 @@
using AutoMapper;
namespace EventHub.Admin
{
public class EventHubBlazorAutoMapperProfile : Profile
{
public EventHubBlazorAutoMapperProfile()
{
//Define your AutoMapper configuration here for the Blazor project.
}
}
}

102
event-organizer/src/EventHub.Admin/EventHubBlazorModule.cs

@ -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>();
});
}
}
}

11
event-organizer/src/EventHub.Admin/EventHubBrandingProvider.cs

@ -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";
}
}

16
event-organizer/src/EventHub.Admin/EventHubBundleContributor.cs

@ -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);
}
}
}

13
event-organizer/src/EventHub.Admin/EventHubComponentBase.cs

@ -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);
}
}
}

71
event-organizer/src/EventHub.Admin/Menus/EventHubMenuContributor.cs

@ -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;
}
}
}

11
event-organizer/src/EventHub.Admin/Menus/EventHubMenus.cs

@ -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...
}
}

155
event-organizer/src/EventHub.Admin/Pages/Index.razor

@ -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>

7
event-organizer/src/EventHub.Admin/Pages/Index.razor.cs

@ -0,0 +1,7 @@
namespace EventHub.Admin.Pages
{
public partial class Index
{
}
}

24
event-organizer/src/EventHub.Admin/Program.cs

@ -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();
}
}
}

29
event-organizer/src/EventHub.Admin/Properties/launchSettings.json

@ -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"
}
}
}
}

12
event-organizer/src/EventHub.Admin/_Imports.razor

@ -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

3
event-organizer/src/EventHub.Admin/wwwroot/appsettings.Development.json

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

24
event-organizer/src/EventHub.Admin/wwwroot/appsettings.json

@ -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": {
}
}
}
}

BIN
event-organizer/src/EventHub.Admin/wwwroot/favicon.ico

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

17
event-organizer/src/EventHub.Admin/wwwroot/global.css

File diff suppressed because one or more lines are too long

791
event-organizer/src/EventHub.Admin/wwwroot/global.js

File diff suppressed because one or more lines are too long

29
event-organizer/src/EventHub.Admin/wwwroot/index.html

@ -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>

48
event-organizer/src/EventHub.Admin/wwwroot/main.css

@ -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);
}
}

39
event-organizer/src/EventHub.Domain/IdentityServer/IdentityServerDataSeedContributor.cs

@ -142,45 +142,6 @@ namespace EventHub.IdentityServer
var configurationSection = _configuration.GetSection("IdentityServer:Clients");
//Web Client
var webClientId = configurationSection["EventHub_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["EventHub_Web:RootUrl"].EnsureEndsWith('/');
/* EventHub_Web client is only needed if you created a tiered
* solution. Otherwise, you can delete this client. */
await CreateClientAsync(
name: webClientId,
scopes: commonScopes,
grantTypes: new[] { "hybrid" },
secret: (configurationSection["EventHub_Web:ClientSecret"] ?? "1q2w3e*").Sha256(),
redirectUri: $"{webClientRootUrl}signin-oidc",
postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc",
frontChannelLogoutUri: $"{webClientRootUrl}Account/FrontChannelLogout",
corsOrigins: new[] { webClientRootUrl.RemovePostFix("/") }
);
}
//Console Test / Angular Client
var consoleAndAngularClientId = configurationSection["EventHub_App:ClientId"];
if (!consoleAndAngularClientId.IsNullOrWhiteSpace())
{
var webClientRootUrl = configurationSection["EventHub_App:RootUrl"]?.TrimEnd('/');
await CreateClientAsync(
name: consoleAndAngularClientId,
scopes: commonScopes,
grantTypes: new[] { "password", "client_credentials", "authorization_code" },
secret: (configurationSection["EventHub_App:ClientSecret"] ?? "1q2w3e*").Sha256(),
requireClientSecret: false,
redirectUri: webClientRootUrl,
postLogoutRedirectUri: webClientRootUrl,
corsOrigins: new[] { webClientRootUrl.RemovePostFix("/") }
);
}
// Blazor Client
var blazorClientId = configurationSection["EventHub_Blazor:ClientId"];
if (!blazorClientId.IsNullOrWhiteSpace())

26
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs

@ -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}");
}
}
}

26
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs

@ -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;
}
}

29
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHub.HttpApi.Client.ConsoleTestApp.csproj

@ -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>

29
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/EventHubConsoleApiClientModule.cs

@ -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)))
);
});
});
}
}
}

21
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/Program.cs

@ -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>();
});
}
}

18
event-organizer/test/EventHub.HttpApi.Client.ConsoleTestApp/appsettings.json

@ -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…
Cancel
Save