easyabp / abp.settingui Goto Github PK
View Code? Open in Web Editor NEWAn ABP module used to manage ABP settings.
License: MIT License
An ABP module used to manage ABP settings.
License: MIT License
I saw the grouping demo:
context.Add(
new SettingDefinition(
"Connection.Ip", // Setting name
"127.0.0.1", // Default value
L("DisplayName:Connection.Ip"), // Display name
L("Description:Connection.Ip") // Description
)
.WithProperty(SettingUiConst.Group1, "Server")
.WithProperty(SettingUiConst.Group2, "Connection")
);
"SettingUiConst.Group$n" cannot express the hierarchy well, maybe this is a better way:
context.Add(
new SettingDefinition(
"Connection.Ip", // Setting name
"127.0.0.1", // Default value
L("DisplayName:Connection.Ip"), // Display name
L("Description:Connection.Ip") // Description
)
.WithProperty("SettingGroup", "Server:Connection") // More then 2 levels support
.WithProperty("SettingType", "number") // Original name is: Type
);
Hi, found this awesome module that need for my project but can't make it work with the Blazor server UI and tiered project.
There are some new settings added the sample app, we should complete the localizations.
When open the setting management page, it thrown below exception:
Volo.Abp.Http.Client.AbpRemoteCallException: 对不起,在处理你的请求期间,产生了一个服务器内部错误!
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.ThrowExceptionForResponseAsync(HttpResponseMessage response) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor
1.MakeRequestAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.MakeRequestAndGetResultAsync[T](IAbpMethodInvocation invocation) at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor
1.GetResultAsync(Task task, Type resultType)
at Volo.Abp.Http.Client.DynamicProxying.DynamicHttpProxyInterceptor1.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter
1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue
1.ProceedAsync()
at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func
3 proceed)
at EasyAbp.Abp.SettingUi.Web.Pages.SettingUiPageContributor.ConfigureAsync(SettingPageCreationContext context)
at Volo.Abp.SettingManagement.Web.Pages.SettingManagement.IndexModel.OnGetAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Convert[T](Object taskAsObject)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.ExecutorFactory.GenericTaskHandlerMethod.Execute(Object receiver, Object[] arguments)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeHandlerMethodAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeNextPageFilterAsync()
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Rethrow(PageHandlerExecutedContext context)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure.PageActionInvoker.InvokeInnerFilterAsync()
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ExceptionContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|24_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<b__1>d.MoveNext()
--- End of stack trace from previous location ---
Antiforgery token validation failed. The antiforgery token could not be decrypted.
Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted.
---> System.Security.Cryptography.CryptographicException: The payload was invalid. For more information go to http://aka.ms/dataprotectionwarning
at Microsoft.AspNetCore.DataProtection.Cng.CbcAuthenticatedEncryptor.DecryptImpl(Byte* pbCiphertext, UInt32 cbCiphertext, Byte* pbAdditionalAuthenticatedData, UInt32 cbAdditionalAuthenticatedData)
at Microsoft.AspNetCore.DataProtection.Cng.Internal.CngAuthenticatedEncryptorBase.Decrypt(ArraySegment1 ciphertext, ArraySegment
1 additionalAuthenticatedData)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status)
at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
--- End of inner exception stack trace ---
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.DeserializeTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet, AntiforgeryToken& cookieToken, AntiforgeryToken& requestToken)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet)
at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext)
at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)
Hello!
What should we override to perform validation when saving settings through this module?
Ideally we can override and check if the setting group is x then perform some validation
Hi
How can I change the theme layout for this module?
Thanks
Hi @wakuflair ,
I'll use this module in my project. Can you release new version?
Now we can control the display of settings in SettingUI (#46), we should doc it.
Hi, just started using your module, its awesome!
What is the roadmap for implementing the tenant provider and giving ability to control settings for tenants?
Thanks
see #40 (comment)
For example, save the setting value as global.
If (custom group1) is in the first place, the form that saves the right card will throw an exception.
Logs:
System.NullReferenceException: Object reference not set to an instance of an object.
at AspNetCoreGeneratedDocument.Pages_SettingManagement_Index.<ExecuteAsync>b__12_5()
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
at AspNetCoreGeneratedDocument.Pages_SettingManagement_Index.<ExecuteAsync>b__12_1()
at Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync()
at AspNetCoreGeneratedDocument.Pages_SettingManagement_Index.ExecuteAsync()
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, Boolean invokeViewStarts)
at Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderAsync(ViewContext context)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.ViewFeatures.ViewExecutor.ExecuteAsync(ViewContext viewContext, String contentType, Nullable`1 statusCode)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResultFilterAsync>g__Awaited|30_0[TFilter,TFilterAsync](ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResultExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.ResultNext[TFilter,TFilterAsync](State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeResultFilters()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
at Volo.Abp.AspNetCore.Serilog.AbpSerilogMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Volo.Abp.AspNetCore.Auditing.AbpAuditingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Volo.Abp.AspNetCore.Uow.AbpUnitOfWorkMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Volo.Abp.AspNetCore.ExceptionHandling.AbpExceptionHandlingMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Builder.ApplicationBuilderAbpOpenIddictMiddlewareExtension.<>c__DisplayClass0_0.<<UseAbpOpenIddictValidation>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Volo.Abp.AspNetCore.Tracing.AbpCorrelationIdMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Localization.RequestLocalizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.RequestLocalization.AbpRequestLocalizationMiddleware.InvokeAsync(HttpContext context, RequestDelegate next)
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass6_1.<<UseMiddlewareInterface>b__1>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)
hi,
please upgrade abp version to 6.0.1
##错误描述:
KeyNotFoundException: The given key 'Group1' was not present in the dictionary.
##版本:
1.3.1
##问题分析原因:
调试代码在EasyAbp.Abp.SettingUi.Web.Pages.Components中发现取Group1对应属性值,而SettingInfo并未对Properties进行赋值,导致取值错误。默认是否应该调用WithProperty方法,设置Group1,Group2 的Value?
It is recommended that the SettingUiController method use virtual methods.
When using the ABP commercial template reference this module, visit the SettingManagement page, it throw an exception that the "Group1" not in the directory.
I have deleted the branch, so cannot cope the detailed exception info here, if you need it, I could run it again to reproduce it.
Hi,
Can you add this config in AbpHelper.CLI?
Hi
First of all, great module! I was just about to make mine and I found yours and used it instead.
I have a problem
Does this module work well under multi tenancy?
I try use this module in multi tenancy,login with tenancy and update setting ,all settings ProviderName are set to 'G'
Tks
Because EasyAbp
is already in the organization name.
and can you support the below function:
the smart property recognition for the following codes,
for example: the boolean property should smart work with si.WithProperty(SettingUiConst.Type, bool)
;
private List<SettingInfo> SetSettingDefinitionProperties(IDictionary<string, IDictionary<string, string>> settingProperties)
{
var settingInfos = new List<SettingInfo>();
var settingDefinitions = _settingDefinitionManager.GetAll();
foreach (var settingDefinition in settingDefinitions)
{
var si = CreateSettingInfo(settingDefinition);
if (settingProperties.ContainsKey(si.Name))
{
// This Setting is defined in the property file,
// set its property values from the dictionary
var properties = settingProperties[si.Name];
foreach (var kv in properties)
{
// Do not assign the property if it has already been set by the user.
if (!si.Properties.ContainsKey(kv.Key))
{
si.WithProperty(kv.Key, kv.Value);
}
}
}
// Default group1: Others
if (!si.Properties.ContainsKey(SettingUiConst.Group1))
{
si.WithProperty(SettingUiConst.Group1, SettingUiConst.DefaultGroup);
}
// Default group2: Others
if (!si.Properties.ContainsKey(SettingUiConst.Group2))
{
si.WithProperty(SettingUiConst.Group2, SettingUiConst.DefaultGroup);
}
// Default type: text
if (!si.Properties.ContainsKey(SettingUiConst.Type))
{
si.WithProperty(SettingUiConst.Type, SettingUiConst.DefaultType);
}
settingInfos.Add(si);
}
return settingInfos;
}
Hi,
I think settings can be sorted on the UI with Weight / Order
property.
We can use like this (code side);
context.Add(
new SettingDefinition(
...
)
.WithProperty(SettingUiConst.Weight, "5")
...
);
or like this (xml side);
"Setting1": {
...
"Weight": "5"
}
Code Example
SettingInfo
public class SettingInfo
{
public short Weight { get; set; }
...
}
Default value can be set zero.
... SetSettingDefinitionPropertiesAsync(...) {
...
// Default weight: 0
if(!si.Properties.ContainsKey(SettingUiConst.Weight))
{
si.WithProperty(SettingUiConst.Weight, "0");
}
...
}
in SettingUiAppService.GroupSettingDefinitions:
settingInfos.OrderByDescending(si => (short) si.Properties[SettingUiConst.Weight]).ToList();
Hi,
The following error occurs when using basic theme.
NullReferenceException: Object reference not set to an instance of an object.
AspNetCoreGeneratedDocument.Pages_SettingManagement_Index.b__12_5()
Hello,
First of all, great module! I was just about to make mine and I found yours and used it instead.
I was wondering if there is a way to make settings required? If a user deletes the content of a setting, it will be saved as blank in the DB. This overrides the default value with "nothing".
I see 2 possible solutions:
What do you think?
Thank you!
Hi!
Thanks for providing this awesome module.
I am seeking advice around disabling the default Abp settings from displaying for tenants.
For example i would like the host admin to control System and Mail settings and not the individual users or tenant admins.
Is it possible accomplish this in the current version 1.1.10?
Hi @wakuflair ,
I see your document of settingUI module in MVC, how about using it in Angular ?
Thanks and this is great module
If admin changes the Setting to required confirm of email/phone - and then logs out - the admin can no longer log back in!! :-)
Suggest that Admin account should be except from requiring confirm?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.