Skip to content

Commit

Permalink
Merge pull request #17660 from abpframework/EngincanV/update-dataseeder
Browse files Browse the repository at this point in the history
Improve auth-server homepage design & update dataseeder
  • Loading branch information
EngincanV committed Sep 20, 2023
2 parents 30bcc7b + ddf13ab commit cfe42dd
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ protected void DeleteUnrelatedProjects(ProjectBuildContext context, List<Project
{
steps.Add(new MauiChangeApplicationIdGuidStep());
steps.Add(new MauiChangePortStep());
context.Symbols.Add("mobile:maui");
}
else
{
Expand All @@ -192,10 +193,12 @@ protected void DeleteUnrelatedProjects(ProjectBuildContext context, List<Project
context.BuildArgs.ExtraProperties.ContainsKey("separate-auth-server"))
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public"));
context.Symbols.Add("ui:mvc-public-host");
}
else
{
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.Web.Public.Host"));
context.Symbols.Add("ui:mvc-public");
}
}
}
Expand Down Expand Up @@ -399,6 +402,7 @@ protected void ConfigureWithoutUi(ProjectBuildContext context, List<ProjectBuild
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.HttpApi.Host"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
context.Symbols.Add("HostWithIds");
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
}
}
Expand All @@ -424,6 +428,7 @@ protected void ConfigureWithBlazorUi(ProjectBuildContext context, List<ProjectBu
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
context.Symbols.Add("HostWithIds");
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
}

Expand Down Expand Up @@ -517,6 +522,7 @@ protected void ConfigureWithAngularUi(ProjectBuildContext context, List<ProjectB
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
context.Symbols.Add("HostWithIds");
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
}

Expand Down Expand Up @@ -554,6 +560,7 @@ protected void ConfigureWithMauiBlazorUi(ProjectBuildContext context, List<Proje
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.IdentityServer"));
steps.Add(new RemoveProjectFromSolutionStep("MyCompanyName.MyProjectName.AuthServer"));
steps.Add(new TemplateProjectRenameStep("MyCompanyName.MyProjectName.HttpApi.HostWithIds", "MyCompanyName.MyProjectName.HttpApi.Host"));
context.Symbols.Add("HostWithIds");
steps.Add(new AppTemplateChangeConsoleTestClientPortSettingsStep("44305"));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.UI;
using Volo.Abp.VirtualFileSystem;
using Volo.Abp.Account.Localization;

namespace MyCompanyName.MyProjectName;

Expand Down Expand Up @@ -90,7 +91,8 @@ public override void ConfigureServices(ServiceConfigurationContext context)
options.Resources
.Get<MyProjectNameResource>()
.AddBaseTypes(
typeof(AbpUiResource)
typeof(AbpUiResource),
typeof(AccountResource)
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@
Layout = Theme.GetEmptyLayout();
}

@section styles {
<style>
body {
background-color: white;
}
</style>
}

<div class="d-flex align-items-center" style="min-height: 100vh;">
<div class="container">
<abp-row>
Expand All @@ -30,37 +38,30 @@
<h1>@BrandingProvider.AppName</h1>
}
</div>

<abp-card>
<abp-card-body>
<div class="container">
<abp-row>
<abp-column size="_9">

<div class="d-flex align-items-center">
<div class="me-3 p-2">
<i class="fa fa-user d-block" style="font-size: 10em; color: #12b900"></i>
</div>
<div class="p2">
@if (CurrentUser.IsAuthenticated)
{
<span class="fs-16">
@L["Welcome"] <span class="fw-7">@CurrentUser.UserName</span>
</span>
<span class="fs-14 d-block text-dark-800 opacity-75 mb-1">@CurrentUser.Email</span>
<div class="d-grid gap-2">
<a abp-button="Outline_Primary" asp-controller="Manage" asp-action="Index" asp-area="Account">@L["MyAccount"]</a>
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account">@L["Logout"]</a>
</div>
}
else
{
<a abp-button="Primary" asp-controller="Login" asp-action="Index" asp-area="Account">@L["Login"]</a>
}
</div>

<abp-column size="_6">
<div class="mr-auto p-2 float-start">
<div class="">
@if (CurrentUser.IsAuthenticated)
{
<div class="">
<a abp-button="Outline_Primary" asp-controller="Manage" asp-action="Index" asp-area="Account" class="me-2">@L["MyAccount"]</a>
<a abp-button="Primary" asp-controller="Logout" asp-action="Index" asp-area="Account" asp-route-returnUrl="/" >@L["Logout"]</a>
</div>
}
else
{
<a abp-button="Primary" asp-controller="Login" asp-action="Index" asp-area="Account">@L["Login"]</a>
}
</div>
</div>
</abp-column>
<abp-column size="_3">

<abp-column size="_6">
<div class="ml-auto p-2 float-end">
<abp-dropdown>
<abp-dropdown-button text="@Model.CurrentLanguage" />
Expand All @@ -78,16 +79,17 @@
</div>
</abp-column>
</abp-row>
<hr class="m-4" />
<abp-row>
@if (Model.Applications != null)
{
foreach (var application in Model.Applications)

@if (Model.Applications != null)
{
<hr class="m-2" />

<abp-row class="mt-3">
@foreach (var application in Model.Applications)
{
<abp-column size-md="@Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Grid.ColumnSize._4" class="mb-2">
<abp-card>
<abp-card-body>

@if (!application.LogoUri.IsNullOrEmpty())
{
<div class="mx-auto">
Expand All @@ -96,16 +98,13 @@
}

<h4>@application.DisplayName</h4>
<span class="text-muted">@application.ClientUri</span>
<div class="mt-1">
<a abp-button="@Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button.AbpButtonType.Outline_Secondary" href="@application.ClientUri">@L["Visit"]</a>
</div>
<a href="@application.ClientUri" class="text-muted stretched-link">@application.ClientUri</a>
</abp-card-body>
</abp-card>
</abp-column>
}
}
</abp-row>
</abp-row>
}
</div>
</abp-card-body>
</abp-card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,32 @@
//</TEMPLATE-REMOVE>
"OpenIddict": {
"Applications": {
//<TEMPLATE-REMOVE IF-NOT='ui:mvc'>
"MyProjectName_Web": {
"ClientId": "MyProjectName_Web",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44302"
},
//</TEMPLATE-REMOVE>
//<TEMPLATE-REMOVE IF-NOT='ui:blazor'>
"MyProjectName_Blazor": {
"ClientId": "MyProjectName_Blazor",
"RootUrl": "https://localhost:44307"
},
//</TEMPLATE-REMOVE>
//<TEMPLATE-REMOVE IF-NOT='ui:angular'>
"MyProjectName_App": {
"ClientId": "MyProjectName_App",
"RootUrl": "http://localhost:4200"
},
//</TEMPLATE-REMOVE>
//<TEMPLATE-REMOVE IF-NOT='ui:blazor-server&&TIERED'>
"MyProjectName_BlazorServerTiered": {
"ClientId": "MyProjectName_BlazorServerTiered",
"ClientSecret": "1q2w3e*",
"RootUrl": "https://localhost:44309"
},
//</TEMPLATE-REMOVE>
"MyProjectName_Swagger": {
"ClientId": "MyProjectName_Swagger",
"RootUrl": "https://localhost:44305"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private async Task CreateApplicationsAsync()

var configurationSection = _configuration.GetSection("OpenIddict:Applications");

//<TEMPLATE-REMOVE IF-NOT='ui:mvc'>
//Web Client
var webClientId = configurationSection["MyProjectName_Web:ClientId"];
if (!webClientId.IsNullOrWhiteSpace())
Expand All @@ -103,7 +104,9 @@ private async Task CreateApplicationsAsync()
postLogoutRedirectUri: $"{webClientRootUrl}signout-callback-oidc"
);
}
//</TEMPLATE-REMOVE>

//<TEMPLATE-REMOVE IF-NOT='ui:angular'>
//Console Test / Angular Client
var consoleAndAngularClientId = configurationSection["MyProjectName_App:ClientId"];
if (!consoleAndAngularClientId.IsNullOrWhiteSpace())
Expand All @@ -127,7 +130,9 @@ private async Task CreateApplicationsAsync()
postLogoutRedirectUri: consoleAndAngularClientRootUrl
);
}
//</TEMPLATE-REMOVE>

//<TEMPLATE-REMOVE IF-NOT='ui:blazor'>
// Blazor Client
var blazorClientId = configurationSection["MyProjectName_Blazor:ClientId"];
if (!blazorClientId.IsNullOrWhiteSpace())
Expand All @@ -147,7 +152,9 @@ private async Task CreateApplicationsAsync()
postLogoutRedirectUri: $"{blazorRootUrl}/authentication/logout-callback"
);
}
//</TEMPLATE-REMOVE>

//<TEMPLATE-REMOVE IF-NOT='ui:blazor-server&&TIERED'>
// Blazor Server Tiered Client
var blazorServerTieredClientId = configurationSection["MyProjectName_BlazorServerTiered:ClientId"];
if (!blazorServerTieredClientId.IsNullOrWhiteSpace())
Expand All @@ -170,7 +177,9 @@ private async Task CreateApplicationsAsync()
postLogoutRedirectUri: $"{blazorServerTieredRootUrl}signout-callback-oidc"
);
}
//</TEMPLATE-REMOVE>

//<TEMPLATE-REMOVE IF-NOT='HostWithIds'>
// Swagger Client
var swaggerClientId = configurationSection["MyProjectName_Swagger:ClientId"];
if (!swaggerClientId.IsNullOrWhiteSpace())
Expand All @@ -189,6 +198,7 @@ private async Task CreateApplicationsAsync()
clientUri: swaggerRootUrl
);
}
//</TEMPLATE-REMOVE>
}

private async Task CreateApplicationAsync(
Expand Down

0 comments on commit cfe42dd

Please sign in to comment.