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 index 7f9c332e13..87eb2e5bf4 100644 --- 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 @@ -2,7 +2,9 @@ using System; using System.Threading.Tasks; using Microsoft.Extensions.Options; using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations; using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; +using Volo.Abp.EventBus.Local; namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { @@ -10,10 +12,14 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { public SettingPageCreationContext SettingPageCreationContext { get; private set; } + protected ILocalEventBus LocalEventBus { get; } protected SettingManagementPageOptions Options { get; } - public IndexModel(IOptions options) + public IndexModel( + IOptions options, + ILocalEventBus localEventBus) { + LocalEventBus = localEventBus; Options = options.Value; } @@ -25,7 +31,7 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { await contributor.ConfigureAsync(SettingPageCreationContext); } - + return Page(); } @@ -33,5 +39,14 @@ namespace Volo.Abp.SettingManagement.Web.Pages.SettingManagement { return Task.FromResult(Page()); } + + public virtual async Task OnPostRefreshConfigurationAsync() + { + await LocalEventBus.PublishAsync( + new CurrentApplicationConfigurationCacheResetEventData() + ); + + return NoContent(); + } } -} \ No newline at end of file +} diff --git a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js index 32ea1a27cc..fdd63bd4fd 100644 --- a/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js +++ b/modules/setting-management/src/Volo.Abp.SettingManagement.Web/Pages/SettingManagement/Index.js @@ -3,5 +3,9 @@ $(document).on('AbpSettingSaved', function () { abp.notify.success(l('SuccessfullySaved')); + + abp.ajax({ + url: abp.appPath + 'SettingManagement?handler=RefreshConfiguration' + }); }); })(jQuery);