示例#1
0
        private string CreatePlusExtendScript(ApplicationConfigurationDto config)
        {
            var script = new StringBuilder();

            script.AppendLine("(function(){");
            script.AppendLine();
            script.AppendLine($"$.extend(true, Plus, {_jsonSerializer.Serialize(config, indented: true)})");
            script.AppendLine();
            script.AppendLine("Plus.event.trigger('Plus.configurationInitialized');");
            script.AppendLine();
            script.Append("})();");

            return(script.ToString());
        }
        public virtual async Task <ApplicationConfigurationDto> GetAsync()
        {
            //TODO: Optimize & cache..?

            Logger.LogDebug("Executing PlusApplicationConfigurationAppService.GetAsync()...");

            var result = new ApplicationConfigurationDto
            {
                Auth             = await GetAuthConfigAsync(),
                Features         = await GetFeaturesConfigAsync(),
                Localization     = await GetLocalizationConfigAsync(),
                CurrentUser      = GetCurrentUser(),
                Setting          = await GetSettingConfigAsync(),
                MultiTenancy     = GetMultiTenancy(),
                CurrentTenant    = GetCurrentTenant(),
                Timing           = await GetTimingConfigAsync(),
                Clock            = GetClockConfig(),
                ObjectExtensions = _cachedObjectExtensionsDtoService.Get()
            };

            Logger.LogDebug("Executed PlusApplicationConfigurationAppService.GetAsync().");

            return(result);
        }