|
|
@ -2,6 +2,7 @@ using System; |
|
|
using System.Collections.Generic; |
|
|
using System.Collections.Generic; |
|
|
using System.Linq; |
|
|
using System.Linq; |
|
|
using System.Text; |
|
|
using System.Text; |
|
|
|
|
|
using Microsoft.Extensions.Options; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.Http.Modeling; |
|
|
using Volo.Abp.Http.Modeling; |
|
|
|
|
|
|
|
|
@ -19,6 +20,13 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public const string Name = "jquery"; |
|
|
public const string Name = "jquery"; |
|
|
|
|
|
|
|
|
|
|
|
private readonly DynamicJavaScriptProxyOptions _dynamicJavaScriptProxyOptions; |
|
|
|
|
|
|
|
|
|
|
|
public JQueryProxyScriptGenerator(IOptions<DynamicJavaScriptProxyOptions> dynamicJavaScriptProxyOptions) |
|
|
|
|
|
{ |
|
|
|
|
|
_dynamicJavaScriptProxyOptions = dynamicJavaScriptProxyOptions.Value; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
public string CreateScript(ApplicationApiDescriptionModel model) |
|
|
public string CreateScript(ApplicationApiDescriptionModel model) |
|
|
{ |
|
|
{ |
|
|
var script = new StringBuilder(); |
|
|
var script = new StringBuilder(); |
|
|
@ -26,10 +34,16 @@ namespace Volo.Abp.Http.ProxyScripting.Generators.JQuery |
|
|
script.AppendLine("/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */"); |
|
|
script.AppendLine("/* This file is automatically generated by ABP framework to use MVC Controllers from javascript. */"); |
|
|
script.AppendLine(); |
|
|
script.AppendLine(); |
|
|
|
|
|
|
|
|
foreach (var module in model.Modules.Values) |
|
|
foreach (var module in model.Modules) |
|
|
{ |
|
|
{ |
|
|
|
|
|
if (!_dynamicJavaScriptProxyOptions.EnabledModules.Any(m => |
|
|
|
|
|
module.Key.Equals(m, StringComparison.CurrentCultureIgnoreCase))) |
|
|
|
|
|
{ |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
script.AppendLine(); |
|
|
script.AppendLine(); |
|
|
AddModuleScript(script, module); |
|
|
AddModuleScript(script, module.Value); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
AddInitializedEventTrigger(script); |
|
|
AddInitializedEventTrigger(script); |
|
|
|