diff --git a/modules/setting-management/Volo.Abp.SettingManagement.sln b/modules/setting-management/Volo.Abp.SettingManagement.sln index fc870e1e80..54a63cb48a 100644 --- a/modules/setting-management/Volo.Abp.SettingManagement.sln +++ b/modules/setting-management/Volo.Abp.SettingManagement.sln @@ -15,13 +15,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{7E8D2943-A EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.SettingManagement.Tests", "test\Volo.Abp.SettingManagement.Tests\Volo.Abp.SettingManagement.Tests.csproj", "{E8335ADC-D09E-4B74-8190-45A9FAF962CA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.MongoDB", "src\Volo.Abp.SettingManagement.MongoDB\Volo.Abp.SettingManagement.MongoDB.csproj", "{7615D255-FB8F-49F0-81C0-F2E69F7F0CB7}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.SettingManagement.MongoDB", "src\Volo.Abp.SettingManagement.MongoDB\Volo.Abp.SettingManagement.MongoDB.csproj", "{7615D255-FB8F-49F0-81C0-F2E69F7F0CB7}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.TestBase", "test\Volo.Abp.SettingManagement.TestBase\Volo.Abp.SettingManagement.TestBase.csproj", "{D4A2DCB2-FA6A-43DC-9469-B6CDAA7EB489}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.SettingManagement.TestBase", "test\Volo.Abp.SettingManagement.TestBase\Volo.Abp.SettingManagement.TestBase.csproj", "{D4A2DCB2-FA6A-43DC-9469-B6CDAA7EB489}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.EntityFrameworkCore.Tests", "test\Volo.Abp.SettingManagement.EntityFrameworkCore.Tests\Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj", "{AFF6A7B6-A80B-4569-9F6B-CD6C72EAB6D4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.SettingManagement.EntityFrameworkCore.Tests", "test\Volo.Abp.SettingManagement.EntityFrameworkCore.Tests\Volo.Abp.SettingManagement.EntityFrameworkCore.Tests.csproj", "{AFF6A7B6-A80B-4569-9F6B-CD6C72EAB6D4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.MongoDB.Tests", "test\Volo.Abp.SettingManagement.MongoDB.Tests\Volo.Abp.SettingManagement.MongoDB.Tests.csproj", "{DF76DE74-1029-4FEA-8ADF-3C5636944757}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.SettingManagement.MongoDB.Tests", "test\Volo.Abp.SettingManagement.MongoDB.Tests\Volo.Abp.SettingManagement.MongoDB.Tests.csproj", "{DF76DE74-1029-4FEA-8ADF-3C5636944757}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.SettingManagement.Web", "src\Volo.Abp.SettingManagement.Web\Volo.Abp.SettingManagement.Web.csproj", "{AF6BE46D-AC88-4DEF-BBEC-F60A00847D43}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -61,6 +63,10 @@ Global {DF76DE74-1029-4FEA-8ADF-3C5636944757}.Debug|Any CPU.Build.0 = Debug|Any CPU {DF76DE74-1029-4FEA-8ADF-3C5636944757}.Release|Any CPU.ActiveCfg = Release|Any CPU {DF76DE74-1029-4FEA-8ADF-3C5636944757}.Release|Any CPU.Build.0 = Release|Any CPU + {AF6BE46D-AC88-4DEF-BBEC-F60A00847D43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {AF6BE46D-AC88-4DEF-BBEC-F60A00847D43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {AF6BE46D-AC88-4DEF-BBEC-F60A00847D43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {AF6BE46D-AC88-4DEF-BBEC-F60A00847D43}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -74,6 +80,7 @@ Global {D4A2DCB2-FA6A-43DC-9469-B6CDAA7EB489} = {7E8D2943-ADE7-4C89-8048-0780CE07E0E0} {AFF6A7B6-A80B-4569-9F6B-CD6C72EAB6D4} = {7E8D2943-ADE7-4C89-8048-0780CE07E0E0} {DF76DE74-1029-4FEA-8ADF-3C5636944757} = {7E8D2943-ADE7-4C89-8048-0780CE07E0E0} + {AF6BE46D-AC88-4DEF-BBEC-F60A00847D43} = {F1BE945B-F0CF-4712-BC2B-9AF8C02059EA} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {24B3A486-E7CA-4AA5-B76F-27D351A97E59} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs new file mode 100644 index 0000000000..387c7c3de9 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/AbpSettingManagementWebModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.Modularity; + +namespace Volo.Abp.SettingManagement.Web +{ + [DependsOn( + typeof(AbpAspNetCoreMvcUiThemeSharedModule) + )] + public class AbpSettingManagementWebModule : AbpModule + { + + } +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/ISettingPageContributor.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/ISettingPageContributor.cs new file mode 100644 index 0000000000..e641ee2ade --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/ISettingPageContributor.cs @@ -0,0 +1,9 @@ +using System.Threading.Tasks; + +namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement +{ + public interface ISettingPageContributor + { + Task ConfigureAsync(SettingPageCreationContext context); + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml new file mode 100644 index 0000000000..19ac5145a7 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml @@ -0,0 +1,9 @@ +@page +@model Volo.Abp.SettingManagement.Web.Pages.SettingManagement.IndexModel +@foreach (var group in Model.SettingPageCreationContext.Groups) +{ +

@group.DisplayName

+
+ @await Component.InvokeAsync(group.ComponentType) +
+} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs new file mode 100644 index 0000000000..057d929ebf --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.cshtml.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Options; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement +{ + public class IndexModel : AbpPageModel + { + public SettingPageCreationContext SettingPageCreationContext { get; private set; } + + private readonly SettingManagementPageOptions _options; + + public IndexModel(IOptions options) + { + _options = options.Value; + } + + public async Task OnGetAsync() + { + SettingPageCreationContext = new SettingPageCreationContext(); + + foreach (var contributor in _options.Contributors) + { + await contributor.ConfigureAsync(SettingPageCreationContext); + } + } + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingManagementPageOptions.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingManagementPageOptions.cs new file mode 100644 index 0000000000..7dc50af16f --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingManagementPageOptions.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement +{ + public class SettingManagementPageOptions + { + public List Contributors { get; } + + public SettingManagementPageOptions() + { + Contributors = new List(); + } + } +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageCreationContext.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageCreationContext.cs new file mode 100644 index 0000000000..f67eda6e2c --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageCreationContext.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement +{ + public class SettingPageCreationContext + { + public List Groups { get; } + + public SettingPageCreationContext() + { + Groups = new List(); + } + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs new file mode 100644 index 0000000000..5acd284267 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/SettingPageGroup.cs @@ -0,0 +1,36 @@ +using System; +using JetBrains.Annotations; + +namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement +{ + public class SettingPageGroup + { + public string Id + { + get => _id; + set => _id = Check.NotNullOrWhiteSpace(value, nameof(Id)); + } + private string _id; + + public string DisplayName + { + get => _displayName; + set => _displayName = Check.NotNullOrWhiteSpace(value, nameof(DisplayName)); + } + private string _displayName; + + public Type ComponentType + { + get => _componentType; + set => _componentType = Check.NotNull(value, nameof(ComponentType)); + } + private Type _componentType; + + public SettingPageGroup([NotNull] string id, [NotNull] string displayName, [NotNull] Type componentType) + { + Id = id; + DisplayName = displayName; + ComponentType = componentType; + } + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Properties/launchSettings.json b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Properties/launchSettings.json new file mode 100644 index 0000000000..844334b642 --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:62272/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Volo.Abp.SettingManagement.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "http://localhost:62273/" + } + } +} \ No newline at end of file diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj new file mode 100644 index 0000000000..310ac9056a --- /dev/null +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Volo.Abp.SettingManagement.Web.csproj @@ -0,0 +1,13 @@ + + + + netstandard2.0 + Library + true + + + + + + +