Browse Source

Merge 0c4b5331e6 into 4309d090a7

pull/1568/merge
yx lin 2 weeks ago
committed by GitHub
parent
commit
22d2ce75b5
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 93
      Directory.Packages.props
  2. 28
      aspnet-core/LINGYUN.MicroService.Aspire.slnx
  3. 25
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/appsettings.json
  4. 46
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs
  5. 64
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/App.razor
  6. 137
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/Index.razor
  7. 10
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/LoginRedirect.razor
  8. 13
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/Routes.razor
  9. 12
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/_Imports.razor
  10. 42
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs
  11. 130
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs
  12. 63
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj
  13. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Localization/Resources/en.json
  14. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Localization/Resources/zh-Hans.json
  15. 22
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs
  16. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Login.cshtml
  17. 21
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Login.cshtml.cs
  18. 6
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Logout.cshtml
  19. 22
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Logout.cshtml.cs
  20. 42
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/_Host.cshtml
  21. 5
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/_ViewImports.cshtml
  22. 28
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs
  23. 273
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs
  24. 77
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs
  25. 122
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json
  26. 8
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/package.json
  27. 2
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/ElsaBlobContainer.cs
  28. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/FodyWeavers.xml
  29. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/FodyWeavers.xsd
  30. 24
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN.Abp.ElsaNext.AI.csproj
  31. 23
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/AbpElsaNextAIModule.cs
  32. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/Extensions/ModuleExtensions.cs
  33. 44
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/Features/AbpAIFeature.cs
  34. 49
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/AbpElsaNextAgentsBlazorModule.cs
  35. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/FodyWeavers.xml
  36. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/FodyWeavers.xsd
  37. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/LINGYUN.Abp.ElsaNext.Agents.Blazor.csproj
  38. 7
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Localization/Resources/AgentsBlazor/en.json
  39. 7
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Localization/Resources/AgentsBlazor/zh-Hans.json
  40. 28
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Navigation/ElsaStudioAgentsMenuContributor.cs
  41. 5
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/_Imports.razor
  42. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/FodyWeavers.xml
  43. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/FodyWeavers.xsd
  44. 27
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/LINGYUN.Abp.ElsaNext.Agents.csproj
  45. 22
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/LINGYUN/Abp/ElsaNext/Agents/AbpElsaNextAgentsModule.cs
  46. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/FodyWeavers.xml
  47. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/FodyWeavers.xsd
  48. 24
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/LINGYUN.Abp.ElsaNext.Alterations.csproj
  49. 28
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/LINGYUN/Abp/ElsaNext/Alterations/AbpElsaNextAlterationsModule.cs
  50. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/FodyWeavers.xml
  51. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/FodyWeavers.xsd
  52. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN.Abp.ElsaNext.BlobStoring.csproj
  53. 38
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/AbpElsaNextBlobStoringModule.cs
  54. 39
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/BlobActivity.cs
  55. 20
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/DeleteBlob.cs
  56. 40
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/ReadBlob.cs
  57. 99
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/SaveBlob.cs
  58. 8
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/ElsaBlobContainer.cs
  59. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Extensions/ModuleExtensions.cs
  60. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Features/BlobStoringFeature.cs
  61. 12
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Localization/Resources/en.json
  62. 12
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Localization/Resources/zh-Hans.json
  63. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/FodyWeavers.xml
  64. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/FodyWeavers.xsd
  65. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN.Abp.ElsaNext.Email.csproj
  66. 38
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/AbpElsaNextEmailModule.cs
  67. 274
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Activities/SendEmail.cs
  68. 16
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Contracts/IDownloader.cs
  69. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Extensions/ModuleExtensions.cs
  70. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Features/EmailFeature.cs
  71. 12
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Localization/Resources/en.json
  72. 12
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Localization/Resources/zh-Hans.json
  73. 28
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Services/DefaultDownloader.cs
  74. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/FodyWeavers.xml
  75. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/FodyWeavers.xsd
  76. 25
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/LINGYUN.Abp.ElsaNext.EntityFrameworkCore.csproj
  77. 57
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/LINGYUN/Abp/ElsaNext/EntityFrameworkCore/AbpElsaNextEntityFrameworkCoreModule.cs
  78. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml
  79. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd
  80. 24
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj
  81. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs
  82. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/FodyWeavers.xml
  83. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/FodyWeavers.xsd
  84. 26
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN.Abp.ElsaNext.Notifications.csproj
  85. 41
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/AbpElsaNextNotificationsModule.cs
  86. 136
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Activities/SendNotification.cs
  87. 14
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Extensions/ModuleExtensions.cs
  88. 17
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Features/NotificationsFeature.cs
  89. 42
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Handlers/ActivityNotificationHandler.cs
  90. 53
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Handlers/WorkflowNotificationHandler.cs
  91. 18
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Localization/Resources/en.json
  92. 18
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Localization/Resources/zh-Hans.json
  93. 6
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/UIHints/NotificationsUIHints.cs
  94. 49
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/AbpElsaNextSecretsBlazorModule.cs
  95. 3
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/FodyWeavers.xml
  96. 30
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/FodyWeavers.xsd
  97. 29
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/LINGYUN.Abp.ElsaNext.Secrets.Blazor.csproj
  98. 7
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Localization/Resources/SecretsBlazor/en.json
  99. 7
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Localization/Resources/SecretsBlazor/zh-Hans.json
  100. 28
      aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Navigation/ElsaStudioSecretsMenuContributor.cs

93
Directory.Packages.props

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<DotNetCoreCAPPackageVersion>10.0.0</DotNetCoreCAPPackageVersion> <DotNetCoreCAPPackageVersion>10.0.0</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.17.0</ElsaPackageVersion> <ElsaPackageVersion>2.17.0</ElsaPackageVersion>
<ElsaNextPackageVersion>3.6.0</ElsaNextPackageVersion> <ElsaNextPackageVersion>3.8.0</ElsaNextPackageVersion>
<VoloAbpPackageVersion>10.6.0</VoloAbpPackageVersion> <VoloAbpPackageVersion>10.6.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>10.6.0</LINGYUNAbpPackageVersion> <LINGYUNAbpPackageVersion>10.6.0</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>10.0.9</MicrosoftExtensionsPackageVersion> <MicrosoftExtensionsPackageVersion>10.0.9</MicrosoftExtensionsPackageVersion>
@ -14,6 +14,7 @@
<!-- Abp Framework --> <!-- Abp Framework -->
<ItemGroup> <ItemGroup>
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="5.6.0" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="5.6.0" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.Server.MudBlazorLeptonXLiteTheme" Version="5.6.0" />
<PackageVersion Include="Volo.Abp.AI" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AI" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.Application" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Account.Application" Version="$(VoloAbpPackageVersion)" />
@ -28,13 +29,20 @@
<PackageVersion Include="Volo.Abp.Account.Web.OpenIddict" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Account.Web.OpenIddict" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Authentication.OpenIdConnect" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.Server.Theming.MudBlazor" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.Web.Theming" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Components.Web.Theming" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.WebAssembly" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.WebAssembly.Theming" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Components.WebAssembly.Theming" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Components.WebAssembly.MudBlazorBasicTheme.Bundling" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.MultiTenancy" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Client.Common" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Client.Common" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Contracts" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.Contracts" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.NewtonsoftJson" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.NewtonsoftJson" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Bundling.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared" Version="$(VoloAbpPackageVersion)" />
@ -48,6 +56,7 @@
<PackageVersion Include="Volo.Abp.Authorization" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Authorization" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Authorization.Abstractions" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Authorization.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Autofac" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Autofac.WebAssembly" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.AutoMapper" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.BackgroundJobs" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.BackgroundJobs" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.BackgroundJobs.Abstractions" Version="$(VoloAbpPackageVersion)" />
@ -148,6 +157,7 @@
<PackageVersion Include="Volo.Abp.TestBase" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.TestBase" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.TextTemplating.Scriban" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.TextTemplating.Scriban" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.TickerQ" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Timing" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.Threading" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.UI.Navigation" Version="$(VoloAbpPackageVersion)" /> <PackageVersion Include="Volo.Abp.UI.Navigation" Version="$(VoloAbpPackageVersion)" />
@ -162,9 +172,9 @@
<PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.9" /> <PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.9" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" /> <PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" /> <PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" />
@ -227,20 +237,84 @@
</ItemGroup> </ItemGroup>
<!-- Elsa Next--> <!-- Elsa Next-->
<ItemGroup> <ItemGroup>
<PackageVersion Include="CShells.AspNetCore" Version="0.0.28" />
<PackageVersion Include="Elsa.Agents" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Agents.Activities" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Agents.Api" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Agents.Core" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Agents.OpenAI" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Agents.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.AI.Copilot" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.AI.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Alterations" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Api.Client" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Api.Client" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Dashboard.Api" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Diagnostics.OpenTelemetry" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Diagnostics.StructuredLogs" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Diagnostics.StructuredLogs.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Expressions.CSharp" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Expressions.JavaScript" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Expressions.Liquid" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.ExternalAuthentication.OpenIdConnect" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.ExternalAuthentication.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Http" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Identity" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Labels" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.OpenTelemetry" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Scheduling.Quartz" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Scheduling.Quartz.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Secrets" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Secrets.Api" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Secrets.JavaScript" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Secrets.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Secrets" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Agents" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.AI" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Alterations" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.Abstractions" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.ElsaIdentity.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.ElsaIdentity.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.ElsaIdentity.UI" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.OpenIdConnect.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.OpenIdConnect.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.UI" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Authentication.Themes" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Core" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Core.BlazorServer" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio.Core.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Localization.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Core.BlazorWasm" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio.Core.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Diagnostics.ConsoleLogs.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Diagnostics.OpenTelemetry.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Diagnostics.StructuredLogs.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.DomInterop" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Http.Webhooks" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Labels" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login.BlazorWasm" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio.Login.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Login" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Localization" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Localization.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Localization.BlazorWasm" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Translations" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio.Translations" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Agents" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Studio.OpenIdConnect.BlazorServer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Settings" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Shell" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.WorkflowContexts" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Workflows" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Workflows.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Studio.Workflows.Designer" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Scheduling" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Scheduling" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Expressions.CSharp" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Persistence.EFCore" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Expressions.Liquid" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Persistence.EFCore.MySQL" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Http" Version="$(ElsaNextPackageVersion)" /> <PackageVersion Include="Elsa.Persistence.EFCore.PostgreSql" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />
<!--<PackageVersion Include="Elsa.UserTasks" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.UserTasks.Persistence.EFCore" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Elsa.UserTasks.Persistence.EFCore.Sqlite" Version="$(ElsaNextPackageVersion)" />-->
<PackageVersion Include="Elsa.Workflows.Runtime.Dashboard" Version="$(ElsaNextPackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftAspNetCorePackageVersion)" /> <PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="$(MicrosoftAspNetCorePackageVersion)" />
</ItemGroup> </ItemGroup>
@ -278,6 +352,7 @@
</ItemGroup> </ItemGroup>
<!-- OpenTelemetry --> <!-- OpenTelemetry -->
<ItemGroup> <ItemGroup>
<PackageVersion Include="OpenTelemetry" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.17.0" /> <PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.17.0" /> <PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.17.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.17.0" /> <PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.17.0" />
@ -320,6 +395,7 @@
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.26.300" /> <PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.26.300" />
<PackageVersion Include="Npgsql" Version="10.0.0" /> <PackageVersion Include="Npgsql" Version="10.0.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.2" /> <PackageVersion Include="Microsoft.Data.SqlClient" Version="7.0.2" />
<PackageVersion Include="Microsoft.Data.Sqlite" Version="10.0.9" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.9" /> <PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.9" />
</ItemGroup> </ItemGroup>
<!-- Other --> <!-- Other -->
@ -392,6 +468,7 @@
<PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.9" /> <PackageVersion Include="System.Security.Cryptography.Pkcs" Version="10.0.9" />
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.37" /> <PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.37" />
<PackageVersion Include="TencentCloudSDK" Version="3.0.1273" /> <PackageVersion Include="TencentCloudSDK" Version="3.0.1273" />
<PackageVersion Include="TickerQ" Version="10.4.0" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" /> <PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />
<PackageVersion Include="Yarp.Telemetry.Consumption" Version="2.3.0" /> <PackageVersion Include="Yarp.Telemetry.Consumption" Version="2.3.0" />
</ItemGroup> </ItemGroup>

28
aspnet-core/LINGYUN.MicroService.Aspire.slnx

@ -130,8 +130,8 @@
<Project Path="framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj" /> <Project Path="framework/data-protection/LINGYUN.Abp.DataProtection/LINGYUN.Abp.DataProtection.csproj" />
</Folder> </Folder>
<Folder Name="/framework/dynamic-definition/"> <Folder Name="/framework/dynamic-definition/">
<Project Path="framework/dynamic-definition/LINGYUN.Abp.Dynamic.Definitions/LINGYUN.Abp.Dynamic.Definitions.csproj" />
<Project Path="framework/dynamic-definition/LINGYUN.Abp.Dynamic.Definitions.Core/LINGYUN.Abp.Dynamic.Definitions.Core.csproj" /> <Project Path="framework/dynamic-definition/LINGYUN.Abp.Dynamic.Definitions.Core/LINGYUN.Abp.Dynamic.Definitions.Core.csproj" />
<Project Path="framework/dynamic-definition/LINGYUN.Abp.Dynamic.Definitions/LINGYUN.Abp.Dynamic.Definitions.csproj" />
</Folder> </Folder>
<Folder Name="/framework/dynamic-queryable/"> <Folder Name="/framework/dynamic-queryable/">
<Project Path="framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj" /> <Project Path="framework/dynamic-queryable/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts/LINGYUN.Abp.Dynamic.Queryable.Application.Contracts.csproj" />
@ -552,6 +552,32 @@
<Project Path="modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj" /> <Project Path="modules/elsa/LINGYUN.Abp.Elsa.Server/LINGYUN.Abp.Elsa.Server.csproj" />
<Project Path="modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj" /> <Project Path="modules/elsa/LINGYUN.Abp.Elsa/LINGYUN.Abp.Elsa.csproj" />
</Folder> </Folder>
<Folder Name="/modules/workflow/elsa3/">
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/LINGYUN.Abp.ElsaNext.Agents.Blazor.csproj" Id="fc82705b-186b-4d0d-80d2-473f08596b48" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Agents/LINGYUN.Abp.ElsaNext.Agents.csproj" Id="8699b2ee-5d73-4e7e-9f52-4ec02e5c8c52" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN.Abp.ElsaNext.AI.csproj" Id="d90d0e07-be50-45d5-aa45-1a917203cc3b" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/LINGYUN.Abp.ElsaNext.Alterations.csproj" Id="1e5e1733-8c5c-4ede-9ee8-7f6ae1e85bb6" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN.Abp.ElsaNext.BlobStoring.csproj" Id="ab3ed7c4-918e-40ae-84d6-f98d9ff9c6b1" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN.Abp.ElsaNext.Email.csproj" Id="c8cd2bd2-05f2-44b7-ab7b-7943f00f849e" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj" Id="b2b88f48-e8a2-4760-85f5-d5a3ffffa6f8" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN.Abp.ElsaNext.Notifications.csproj" Id="8a530668-d1be-4383-a344-c8fdb00f1df3" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/LINGYUN.Abp.ElsaNext.Secrets.Blazor.csproj" Id="14b89b15-df06-4965-bd5d-2beaeb0179a6" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Secrets/LINGYUN.Abp.ElsaNext.Secrets.csproj" Id="f49baa76-12c5-4294-b942-fc6f5d49d3e6" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Server/LINGYUN.Abp.ElsaNext.Server.csproj" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.AI.Blazor/LINGYUN.Abp.ElsaNext.Studio.AI.Blazor.csproj" Id="3246ab91-4cdc-4349-9eb6-e65eef1da0bd" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Alterations.Blazor/LINGYUN.Abp.ElsaNext.Studio.Alterations.Blazor.csproj" Id="eb1220d6-31cf-4f73-a9fc-494d30de61df" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Blazor/LINGYUN.Abp.ElsaNext.Studio.Blazor.csproj" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor/LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor.csproj" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor/LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor.csproj" Id="86b1ee1c-6266-4003-8ab2-67aa497ea217" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor/LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor.csproj" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor/LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor.csproj" Id="ae638de1-60e9-4bb4-bdd0-1b0206c8e03d" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor/LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj" Id="c53b5b3d-ebd9-4016-8c43-1c1e791b59bc" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor/LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor.csproj" Id="70479aa8-ebb8-45bf-b728-f98e161c97de" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor/LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor.csproj" Id="2f6a0752-670b-4b73-99fe-c5489e516c8b" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor/LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor.csproj" Id="aead7a25-2ff0-43ad-a68d-31b7f2763056" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext.Webhooks/LINGYUN.Abp.ElsaNext.Webhooks.csproj" Id="4fc14100-23c9-41cf-be70-78cd969de95f" />
<Project Path="modules/elsa/LINGYUN.Abp.ElsaNext/LINGYUN.Abp.ElsaNext.csproj" />
</Folder>
<Folder Name="/tests/"> <Folder Name="/tests/">
<Project Path="tests/LINGYUN.Abp.Aliyun.Tests/LINGYUN.Abp.Aliyun.Tests.csproj" /> <Project Path="tests/LINGYUN.Abp.Aliyun.Tests/LINGYUN.Abp.Aliyun.Tests.csproj" />
<Project Path="tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj" /> <Project Path="tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj" />

25
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.DbMigrator/appsettings.json

@ -7,7 +7,10 @@
"VueAdmin": { "VueAdmin": {
"ClientId": "vue-admin-client", "ClientId": "vue-admin-client",
"ClientSecret": "1q2w3e*", "ClientSecret": "1q2w3e*",
"RootUrls": [ "http://localhost:5666" ] "RootUrls": [
"http://localhost:5666",
"http://127.0.0.1:5666"
]
}, },
"InternalService": { "InternalService": {
"ClientId": "InternalServiceClient", "ClientId": "InternalServiceClient",
@ -17,16 +20,34 @@
"ClientId": "vue-oauth-client", "ClientId": "vue-oauth-client",
"RootUrls": [ "RootUrls": [
"http://localhost:5666", "http://localhost:5666",
"http://127.0.0.1:5666",
"http://localhost:30000", "http://localhost:30000",
"http://127.0.0.1:30000",
"http://localhost:30010", "http://localhost:30010",
"http://127.0.0.1:30010",
"http://localhost:30015", "http://localhost:30015",
"http://127.0.0.1:30015",
"http://localhost:30020", "http://localhost:30020",
"http://127.0.0.1:30020",
"http://localhost:30025", "http://localhost:30025",
"http://127.0.0.1:30025",
"http://localhost:30030", "http://localhost:30030",
"http://127.0.0.1:30030",
"http://localhost:30040", "http://localhost:30040",
"http://127.0.0.1:30040",
"http://localhost:30045", "http://localhost:30045",
"http://127.0.0.1:30045",
"http://localhost:30050",
"http://127.0.0.1:30050",
"http://localhost:30060",
"http://127.0.0.1:30060"
]
},
"ElsaStudioClient": {
"ClientId": "elsa-studio-client",
"RootUrls": [
"http://localhost:30050", "http://localhost:30050",
"http://localhost:30060" "http://127.0.0.1:30050"
] ]
} }
} }

46
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs

@ -576,5 +576,51 @@ public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransien
}; };
await PermissionDataSeeder.SeedAsync(ClientPermissionValueProvider.ProviderName, oauthClientId, oauthClientPermissions); await PermissionDataSeeder.SeedAsync(ClientPermissionValueProvider.ProviderName, oauthClientId, oauthClientPermissions);
} }
var elsaStudioClientId = configurationSection["ElsaStudioClient:ClientId"];
if (!elsaStudioClientId.IsNullOrWhiteSpace())
{
Logger.LogInformation("Seeding application {elsaStudioClientId}...", elsaStudioClientId);
var elsaStudioClientSecret = configurationSection["ElsaStudioClient:ClientSecret"];
var elsaStudioClientRootUrls = configurationSection.GetSection("ElsaStudioClient:RootUrls").Get<List<string>>() ?? [];
var elsaStudioClientRedirectUrls = new List<string>();
var elsaStudioClientPostLogoutRedirectUrls = new List<string>();
elsaStudioClientRootUrls.ForEach(url =>
{
elsaStudioClientRedirectUrls.Add(url.EnsureEndsWith('/'));
elsaStudioClientRedirectUrls.Add(url.EnsureEndsWith('/') + "signin-oidc");
elsaStudioClientRedirectUrls.Add(url.EnsureEndsWith('/') + "swagger/oauth2-redirect.html");
elsaStudioClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/'));
elsaStudioClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/') + "signout-oidc");
elsaStudioClientPostLogoutRedirectUrls.Add(url.EnsureEndsWith('/') + "signout-callback-oidc");
});
await CreateOrUpdateApplicationAsync(
OpenIddictConstants.ApplicationTypes.Web,
elsaStudioClientId,
!elsaStudioClientSecret.IsNullOrWhiteSpace()
? OpenIddictConstants.ClientTypes.Confidential
: OpenIddictConstants.ClientTypes.Public,
OpenIddictConstants.ConsentTypes.Implicit,
"Abp Elsa Studio Client",
elsaStudioClientSecret,
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.RefreshToken,
OpenIddictConstants.GrantTypes.Password],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,
OpenIddictConstants.Scopes.Address,
OpenIddictConstants.Scopes.Phone,
OpenIddictConstants.Scopes.Profile,
OpenIddictConstants.Scopes.OfflineAccess,
scope,
"workflow-service"],
elsaStudioClientRedirectUrls,
elsaStudioClientPostLogoutRedirectUrls);
}
} }
} }

64
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/App.razor

@ -0,0 +1,64 @@
@using System.Globalization
@using Microsoft.Extensions.Hosting
@using Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme.Bundling
@using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Bundling
@using Volo.Abp.Localization
@inject IHostEnvironment Env
@{
var rtl = CultureHelper.IsRtl ? "rtl" : string.Empty;
}
<!DOCTYPE html>
<html lang="@CultureInfo.CurrentCulture.Name" dir="@rtl">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Elsa Studio (Blazor Server)</title>
<base href="/" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<AbpStyles BundleName="@BlazorMudBlazorBasicThemeBundles.Styles.Global" />
@* Elsa Studio UI styles (RCL static assets) + offline icon-font fallback. *@
<link href="/_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet" />
<link href="/_content/Radzen.Blazor/css/material-base.css" rel="stylesheet" />
<link href="/_content/Elsa.Studio.Shell/css/shell.css" rel="stylesheet" />
<link href="/_content/Elsa.Studio.Workflows.Designer/designer.css" rel="stylesheet" />
<link href="/_content/Elsa.Studio.Workflows.Designer/designer.v1.css" rel="stylesheet" />
<link href="/_content/Elsa.Studio.Workflows.Designer/designer.v2.css" rel="stylesheet" />
<link href="/elsa-studio-icons.css" rel="stylesheet" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>
<body>
<Routes @rendermode="InteractiveServer" />
<AbpScripts BundleName="@BlazorMudBlazorBasicThemeBundles.Scripts.Global" />
@* Monaco + Blazor Server bootstrap (mirrors the official Elsa Studio Server host). *@
<script src="/_content/MudBlazor/MudBlazor.min.js"></script>
<script src="/_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="/_content/Radzen.Blazor/Radzen.Blazor.js"></script>
<script src="/_content/BlazorMonaco/jsInterop.js"></script>
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/loader.js"></script>
<script src="/_content/BlazorMonaco/lib/monaco-editor/min/vs/editor/editor.main.js"></script>
<script src="/_framework/blazor.web.js"></script>
<div id="blazor-error-ui">
@if (Env.IsDevelopment())
{
<text>An unhandled exception has occurred. See browser dev tools for details.</text>
}
else if (Env.IsStaging() || Env.IsProduction())
{
<text>An error has occurred. This application may no longer respond until reloaded.</text>
}
<a href="" class="reload">Reload</a>
<a class="dismiss">&#10006;</a>
</div>
</body>
</html>

137
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/Index.razor

@ -0,0 +1,137 @@
@page "/"
@using Microsoft.AspNetCore.Components.Authorization
@inject AuthenticationStateProvider AuthenticationStateProvider
@inject NavigationManager Navigation
<MudGrid Class="mb-3">
<MudItem xs="12" md="6">
<MudCard Style="height: 100%;">
<MudCardContent>
@if (!IsAuthenticated)
{
<MudText Typo="Typo.h5" Class="mb-2">欢迎使用 Elsa 工作室</MudText>
<MudText Typo="Typo.body1" Class="mud-text-secondary mb-2">
以 Blazor Server 模式集成的 Elsa 工作流工作室:服务端渲染与交互,接口调用在服务端完成,凭据不出浏览器。
</MudText>
<MudButton Href="/Account/Login" Variant="Variant.Filled" Color="Color.Primary" Class="mb-4"
StartIcon="@Icons.Material.Filled.Login">登录</MudButton>
}
else
{
<MudText Typo="Typo.h5" Class="mb-2">欢迎回来</MudText>
<MudText Typo="Typo.body1" Class="mud-text-secondary mb-3">
通过左侧菜单进入 <strong>Elsa 工作室</strong>:管理工作流定义与实例,打开设计器进行可视化编排。
</MudText>
<MudButton StartIcon="@Icons.Material.Filled.AccountTree" Variant="Variant.Text" Color="Color.Primary"
OnClick="GoDefinitions">工作流定义</MudButton>
}
</MudCardContent>
</MudCard>
</MudItem>
<MudItem xs="12" md="6">
<MudCard Style="height: 100%;">
<MudCardContent>
<MudText Typo="Typo.h6" Color="Color.Primary" Class="mb-2">
<MudIcon Icon="@Icons.Material.Filled.Info" Class="me-1" />关于
</MudText>
<MudText Typo="Typo.body2" Class="mud-text-secondary mb-3">
服务端 Blazor Server(SignalR)承载 Elsa Studio;认证走外部 OIDC AuthServer 授权码 + PKCE;
Studio 页面以 ABP 子页面呈现(路由在菜单中定义)。
</MudText>
<MudDivider Class="my-2" />
<MudText Typo="Typo.body2" Class="mud-text-secondary">
集成模块:LINGYUN.Abp.ElsaNext.Studio.Blazor
</MudText>
</MudCardContent>
</MudCard>
</MudItem>
</MudGrid>
<MudGrid>
<MudItem xs="12" lg="4">
<MudCard Style="height: 100%;">
<MudCardHeader>
<MudText Typo="Typo.h6">More from ABP.IO</MudText>
</MudCardHeader>
<MudCardContent Class="pt-0">
<MudList T="string" Dense="true">
<MudListItem Icon="@Icons.Material.Filled.Check" IconColor="Color.Primary"
Href="https://github.com/abpframework/abp/releases" Target="_blank">
Latest Release Logs
</MudListItem>
<MudListItem Icon="@Icons.Material.Filled.Check" IconColor="Color.Primary"
Href="https://abp.io/video-courses/essentials" Target="_blank">
Video Courses
</MudListItem>
<MudListItem Icon="@Icons.Material.Filled.Check" IconColor="Color.Primary"
Href="https://docs.abp.io/en/abp/latest/Samples/Index" Target="_blank">
Samples
</MudListItem>
<MudListItem Icon="@Icons.Material.Filled.Check" IconColor="Color.Primary"
Href="https://abp.io/books" Target="_blank">
Books
</MudListItem>
<MudListItem Icon="@Icons.Material.Filled.Check" IconColor="Color.Primary"
Href="https://abp.io/faq" Target="_blank">
FAQ
</MudListItem>
</MudList>
</MudCardContent>
</MudCard>
</MudItem>
<MudItem xs="12" lg="8">
<MudCard Style="height: 100%;">
<MudCardHeader>
<MudText Typo="Typo.h6">Follow us on Social Media</MudText>
</MudCardHeader>
<MudCardContent Class="pt-0">
<MudGrid Spacing="0">
<MudItem xs="12" sm="6">
<MudList T="string" Dense="true">
<MudListItem Href="https://twitter.com/abpframework" Target="_blank"
Icon="@Icons.Custom.Brands.Twitter" IconColor="Color.Primary">
X.com (Twitter)
</MudListItem>
<MudListItem Href="https://community.abp.io/discord" Target="_blank"
Icon="@Icons.Custom.Brands.Discord" IconColor="Color.Primary">
Discord
</MudListItem>
<MudListItem Href="https://stackoverflow.com/questions/tagged/abp" Target="_blank"
Icon="@Icons.Custom.Brands.StackOverflow" IconColor="Color.Primary">
Stack Overflow
</MudListItem>
</MudList>
</MudItem>
<MudItem xs="12" sm="6">
<MudList T="string" Dense="true">
<MudListItem Href="@("https://www.youtube.com/@Volosoft")" Target="_blank"
Icon="@Icons.Custom.Brands.YouTube" IconColor="Color.Error">
YouTube
</MudListItem>
<MudListItem Href="https://www.instagram.com/abpframework/" Target="_blank"
Icon="@Icons.Custom.Brands.Instagram" IconColor="Color.Secondary">
Instagram
</MudListItem>
<MudListItem Href="https://github.com/abpframework/abp" Target="_blank"
Icon="@Icons.Custom.Brands.GitHub" IconColor="Color.Dark">
GitHub
</MudListItem>
</MudList>
</MudItem>
</MudGrid>
</MudCardContent>
</MudCard>
</MudItem>
</MudGrid>
@code {
private bool IsAuthenticated;
protected override async Task OnInitializedAsync()
{
var state = await AuthenticationStateProvider.GetAuthenticationStateAsync();
IsAuthenticated = state.User.Identity?.IsAuthenticated == true;
}
private void GoDefinitions() => Navigation.NavigateTo("/workflows/definitions");
}

10
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/LoginRedirect.razor

@ -0,0 +1,10 @@
@inject NavigationManager Navigation
@code
{
protected override void OnInitialized()
{
var returnUrl = Uri.EscapeDataString(Navigation.Uri);
Navigation.NavigateTo($"/Account/Login?returnUrl={returnUrl}", forceLoad: true);
}
}

13
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/Routes.razor

@ -0,0 +1,13 @@
@using Volo.Abp.AspNetCore.Components.Web.MudBlazorBasicTheme.Themes.Basic
@using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing
@using Microsoft.Extensions.Options
@inject IOptions<AbpRouterOptions> RouterOptions
<Router AppAssembly="typeof(Program).Assembly" AdditionalAssemblies="RouterOptions.Value.AdditionalAssemblies">
<Found Context="routeData">
<AuthorizeRouteView RouteData="routeData" DefaultLayout="typeof(MainLayout)">
<NotAuthorized>
<LoginRedirect />
</NotAuthorized>
</AuthorizeRouteView>
</Found>
</Router>

12
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Components/_Imports.razor

@ -0,0 +1,12 @@
@using System.Net.Http
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Authorization
@using Microsoft.AspNetCore.Components.Forms
@using Microsoft.AspNetCore.Components.Routing
@using Microsoft.AspNetCore.Components.Web
@using Microsoft.AspNetCore.Components.Web.Virtualization
@using static Microsoft.AspNetCore.Components.Web.RenderMode
@using Microsoft.JSInterop
@using MudBlazor
@using Volo.Abp.MudBlazorUI
@using Volo.Abp.MudBlazorUI.Components

42
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/ElsaShellPermissionPolicyProvider.cs

@ -0,0 +1,42 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
namespace LINGYUN.Abp.MicroService.WorkflowService;
/// <summary>
/// Root <see cref="IAuthorizationPolicyProvider"/> for Shells hosting. Elsa 3.8.0-rc2 endpoints
/// declare FastEndpoints permission policies named "epPolicy:&lt;EndpointType&gt;" that CShells
/// registers inside the shell's own container, so ASP.NET's root policy provider (ABP's) cannot
/// resolve them. ABP authenticates /elsa/api with the AuthServer JWT and every validated token
/// carries Elsa's "all permissions" claim (see <see cref="WorkflowManagementNextBlazorServerModule"/>),
/// so epPolicy names are bridged to that grant; other policy names fall back to the defaults.
/// </summary>
public sealed class ElsaShellPermissionPolicyProvider : IAuthorizationPolicyProvider
{
// Allow-all policy (always-true assertion; AuthorizationPolicy rejects zero requirements).
private static readonly AuthorizationPolicy AllowAll = new AuthorizationPolicyBuilder().RequireAssertion(_ => true).Build();
private readonly DefaultAuthorizationPolicyProvider _default = new(Options.Create(new AuthorizationOptions()));
/// <inheritdoc />
public Task<AuthorizationPolicy?> GetPolicyAsync(string policyName)
{
if (!policyName.StartsWith("epPolicy:", StringComparison.Ordinal))
return _default.GetPolicyAsync(policyName);
var policy = new AuthorizationPolicyBuilder()
.RequireAuthenticatedUser()
.RequireAssertion(context =>
context.User.HasClaim(Elsa.PermissionNames.ClaimType, Elsa.PermissionNames.All))
.Build();
return Task.FromResult<AuthorizationPolicy?>(policy);
}
/// <inheritdoc />
public Task<AuthorizationPolicy?> GetDefaultPolicyAsync() => Task.FromResult<AuthorizationPolicy?>(AllowAll);
/// <inheritdoc />
public Task<AuthorizationPolicy?> GetFallbackPolicyAsync() => Task.FromResult<AuthorizationPolicy?>(AllowAll);
}

130
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Extensions/ElsaStudioServiceCollectionExtensions.cs

@ -0,0 +1,130 @@
using Consul;
using Elsa.Studio.Authentication.Abstractions.ComponentProviders;
using Elsa.Studio.Authentication.Abstractions.Contracts;
using Elsa.Studio.Authentication.Abstractions.Models;
using Elsa.Studio.Authentication.OpenIdConnect.BlazorServer.Components;
using Elsa.Studio.Authentication.OpenIdConnect.BlazorServer.Services;
using Elsa.Studio.Authentication.OpenIdConnect.Contracts;
using Elsa.Studio.Authentication.OpenIdConnect.Models;
using Elsa.Studio.Authentication.OpenIdConnect.Services;
using Elsa.Studio.Contracts;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Polly;
using System;
using System.Linq;
using System.Net.Http;
namespace LINGYUN.Abp.MicroService.WorkflowService.Extensions;
public static class ElsaStudioServiceCollectionExtensions
{
internal const string AnonymousHttpClientName = "Elsa.Studio.Authentication.OpenIdConnect.BlazorServer.Anonymous";
public static IServiceCollection AddOpenIdConnectAuth(
this IServiceCollection services,
Action<OidcOptions> configure,
Func<IAsyncPolicy<HttpResponseMessage>> configureRetryPolicy = null)
{
var options = new OidcOptions();
configure(options);
services.AddSingleton<StudioAuthenticationProviderRegistration>(new StudioAuthenticationProviderRegistration(StudioAuthenticationProvider.OpenIdConnect));
// Ensure we always request the minimal identity scopes.
var configuredScopes = options.AuthenticationScopes?.Where(s => !string.IsNullOrWhiteSpace(s)).Distinct(StringComparer.OrdinalIgnoreCase).ToArray() ?? Array.Empty<string>();
if (configuredScopes.Length == 0)
configuredScopes = ["openid", "profile", "offline_access"];
options.AuthenticationScopes = configuredScopes;
// Set Blazor Server defaults for callback paths if not explicitly specified.
options.CallbackPath ??= "/signin-oidc";
options.SignedOutCallbackPath ??= "/signout-callback-oidc";
// Register core services
services.AddHttpContextAccessor();
services.AddSingleton(options);
services.AddScoped<ITokenProvider, ServerTokenProvider>();
services.AddScoped<IHttpConnectionOptionsConfigurator, OidcHttpConnectionOptionsConfigurator>();
// Shared token refresh service used by both session refresh and backend API token acquisition
services.AddScoped<TokenRefreshService>();
// Cookie authentication events for automatic session token refresh (standard ASP.NET Core pattern)
services.AddScoped<AuthCookieEvents>();
// Configure ASP.NET Core authentication with cookie and OIDC
services.AddAuthentication(authOptions =>
{
authOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
authOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
})
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, cookieOptions =>
{
cookieOptions.Cookie.Name = "ElsaStudio.Auth";
cookieOptions.Cookie.HttpOnly = true;
cookieOptions.Cookie.SecurePolicy = Microsoft.AspNetCore.Http.CookieSecurePolicy.Always;
cookieOptions.Cookie.SameSite = Microsoft.AspNetCore.Http.SameSiteMode.Lax;
cookieOptions.ExpireTimeSpan = TimeSpan.FromHours(8);
cookieOptions.SlidingExpiration = true;
cookieOptions.LoginPath = "/Account/Login";
cookieOptions.AccessDeniedPath = "/Account/Login";
// Use custom events for automatic token refresh on every request validation
cookieOptions.EventsType = typeof(AuthCookieEvents);
})
.AddAbpOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme, oidcOptions =>
{
oidcOptions.Authority = options.Authority;
oidcOptions.ClientId = options.ClientId;
oidcOptions.ClientSecret = options.ClientSecret;
oidcOptions.ResponseType = options.ResponseType;
oidcOptions.UsePkce = options.UsePkce;
oidcOptions.SaveTokens = options.SaveTokens;
oidcOptions.CallbackPath = options.CallbackPath;
oidcOptions.SignedOutCallbackPath = options.SignedOutCallbackPath;
oidcOptions.RequireHttpsMetadata = options.RequireHttpsMetadata;
oidcOptions.GetClaimsFromUserInfoEndpoint = options.GetClaimsFromUserInfoEndpoint;
oidcOptions.PushedAuthorizationBehavior = PushedAuthorizationBehavior.Disable;
// Configure scopes
oidcOptions.Scope.Clear();
foreach (var scope in options.AuthenticationScopes)
{
oidcOptions.Scope.Add(scope);
}
// Map token response properties to enable token refresh
oidcOptions.MapInboundClaims = false;
if (!string.IsNullOrWhiteSpace(options.MetadataAddress))
{
oidcOptions.MetadataAddress = options.MetadataAddress;
}
// Configure token validation parameters
oidcOptions.TokenValidationParameters = new()
{
NameClaimType = options.NameClaimType,
RoleClaimType = options.RoleClaimType,
ValidateIssuer = true
};
});
// Add authorization services
services.AddAuthorizationCore();
// Use an OIDC-aware unauthorized component that initiates a challenge.
services.AddScoped<IUnauthorizedComponentProvider, UnauthorizedComponentProvider<ChallengeToLogin>>();
services.AddScoped<ILoginMethodCatalog, DirectOpenIdConnectLoginMethodCatalog>();
services.AddScoped<ILoginMethodComponentProvider, DirectOpenIdConnectLoginMethodComponentProvider>();
// HTTP client for token refresh requests with retry policy
var retryPolicy = configureRetryPolicy?.Invoke() ?? Elsa.Studio.Authentication.OpenIdConnect.BlazorServer.Extensions.ServiceCollectionExtensions.DefaultRetryPolicy;
services.AddHttpClient(AnonymousHttpClientName)
.AddPolicyHandler(retryPolicy);
return services;
}
}

63
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/LINGYUN.Abp.MicroService.WorkflowService.csproj

@ -7,20 +7,27 @@
<RootNamespace>LINGYUN.Abp.MicroService.WorkflowService</RootNamespace> <RootNamespace>LINGYUN.Abp.MicroService.WorkflowService</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup>
<Content Remove="Localization\Resources\*.json" />
<EmbeddedResource Include="Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AgileConfig.Client" /> <PackageReference Include="AgileConfig.Client" />
<PackageReference Include="CShells.AspNetCore" />
<PackageReference Include="DotNetCore.CAP.Dashboard" /> <PackageReference Include="DotNetCore.CAP.Dashboard" />
<PackageReference Include="DotNetCore.CAP.PostgreSql" /> <PackageReference Include="DotNetCore.CAP.PostgreSql" />
<PackageReference Include="DotNetCore.CAP.RabbitMQ" /> <PackageReference Include="DotNetCore.CAP.RabbitMQ" />
<PackageReference Include="Elsa.Activities.Http" /> <PackageReference Include="Elsa.Agents.Persistence.EFCore.Sqlite" />
<PackageReference Include="Elsa.Activities.UserTask" /> <PackageReference Include="Elsa.AI.Persistence.EFCore.Sqlite" />
<PackageReference Include="Elsa.Activities.Temporal.Quartz" /> <PackageReference Include="Elsa.Persistence.EFCore.Sqlite" />
<PackageReference Include="Elsa.Rebus.RabbitMq" /> <PackageReference Include="Elsa.Scheduling.Quartz.EFCore.Sqlite" />
<PackageReference Include="Elsa.Webhooks.Api" /> <PackageReference Include="Elsa.Secrets.Persistence.EFCore.Sqlite" />
<PackageReference Include="Elsa.Studio.Authentication.OpenIdConnect.BlazorServer" />
<PackageReference Include="Elsa.Studio.Authentication.Themes" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" /> <PackageReference Include="Microsoft.AspNetCore.DataProtection.StackExchangeRedis" />
<PackageReference Include="DistributedLock.Redis" /> <PackageReference Include="DistributedLock.Redis" />
<PackageReference Include="Quartz.Serialization.Json" /> <!--<PackageReference Include="Quartz.Serialization.Json" />-->
<PackageReference Include="Rebus.RabbitMq" VersionOverride="10.0.1" />
<PackageReference Include="Serilog.AspNetCore" /> <PackageReference Include="Serilog.AspNetCore" />
<PackageReference Include="Serilog.Enrichers.Environment" /> <PackageReference Include="Serilog.Enrichers.Environment" />
<PackageReference Include="Serilog.Enrichers.AssemblyName" /> <PackageReference Include="Serilog.Enrichers.AssemblyName" />
@ -31,14 +38,17 @@
<PackageReference Include="Serilog.Sinks.Elasticsearch" /> <PackageReference Include="Serilog.Sinks.Elasticsearch" />
<PackageReference Include="Serilog.Sinks.File" /> <PackageReference Include="Serilog.Sinks.File" />
<PackageReference Include="Volo.Abp.AspNetCore.Serilog" /> <PackageReference Include="Volo.Abp.AspNetCore.Serilog" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" /> <PackageReference Include="Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme" />
<PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" /> <PackageReference Include="Volo.Abp.AspNetCore.MultiTenancy" />
<PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" /> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Volo.Abp.AspNetCore.Mvc.NewtonsoftJson" /> <PackageReference Include="Volo.Abp.AspNetCore.Authentication.OpenIdConnect" />
<PackageReference Include="Volo.Abp.Autofac" /> <PackageReference Include="Volo.Abp.Autofac" />
<PackageReference Include="Volo.Abp.Caching.StackExchangeRedis" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore.PostgreSql" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" />
<PackageReference Include="Volo.Abp.Json" /> <PackageReference Include="Volo.Abp.Json" />
<PackageReference Include="Volo.Abp.Swashbuckle" /> <PackageReference Include="Volo.Abp.Swashbuckle" />
<PackageReference Include="Volo.Abp.Http.Client.IdentityModel.Web" /> <PackageReference Include="Volo.Abp.Identity.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.FeatureManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.PermissionManagement.EntityFrameworkCore" />
<PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" /> <PackageReference Include="Volo.Abp.SettingManagement.EntityFrameworkCore" />
@ -62,21 +72,40 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\..\modules\blob-management\LINGYUN.Abp.BlobStoring.BlobManagement\LINGYUN.Abp.BlobStoring.BlobManagement.csproj" /> <ProjectReference Include="..\..\modules\blob-management\LINGYUN.Abp.BlobStoring.BlobManagement\LINGYUN.Abp.BlobStoring.BlobManagement.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql\LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Notifications\LINGYUN.Abp.Elsa.Notifications.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Activities\LINGYUN.Abp.Elsa.Activities.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa.Server\LINGYUN.Abp.Elsa.Server.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.Elsa\LINGYUN.Abp.Elsa.csproj" />
<ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj" /> <ProjectReference Include="..\..\modules\identity\LINGYUN.Abp.Identity.Session.AspNetCore\LINGYUN.Abp.Identity.Session.AspNetCore.csproj" />
<ProjectReference Include="..\..\modules\realtime-notifications\LINGYUN.Abp.Notifications.EntityFrameworkCore\LINGYUN.Abp.Notifications.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\modules\saas\LINGYUN.Abp.Saas.EntityFrameworkCore\LINGYUN.Abp.Saas.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\modules\localization-management\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore\LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" /> <ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Emailing.Platform\LINGYUN.Abp.Emailing.Platform.csproj" />
<ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" /> <ProjectReference Include="..\..\modules\platform\LINGYUN.Abp.Sms.Platform\LINGYUN.Abp.Sms.Platform.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" /> <!--<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.Quartz\LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" /> <ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.BackgroundTasks.DistributedLocking\LINGYUN.Abp.BackgroundTasks.DistributedLocking.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.Quartz.PostgresSqlInstaller\LINGYUN.Abp.Quartz.PostgresSqlInstaller.csproj" /> <ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.Quartz.PostgresSqlInstaller\LINGYUN.Abp.Quartz.PostgresSqlInstaller.csproj" />
<ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\modules\task-management\LINGYUN.Abp.TaskManagement.EntityFrameworkCore\LINGYUN.Abp.TaskManagement.EntityFrameworkCore.csproj" />-->
<ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" /> <ProjectReference Include="..\..\modules\text-templating\LINGYUN.Abp.TextTemplating.EntityFrameworkCore\LINGYUN.Abp.TextTemplating.EntityFrameworkCore.csproj" />
<ProjectReference Include="..\..\modules\webhooks\LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore\LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Agents.Blazor\LINGYUN.Abp.ElsaNext.Agents.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.BlobStoring\LINGYUN.Abp.ElsaNext.BlobStoring.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Email\LINGYUN.Abp.ElsaNext.Email.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Labels\LINGYUN.Abp.ElsaNext.Labels.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Notifications\LINGYUN.Abp.ElsaNext.Notifications.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Secrets.Blazor\LINGYUN.Abp.ElsaNext.Secrets.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Server\LINGYUN.Abp.ElsaNext.Server.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.AI.Blazor\LINGYUN.Abp.ElsaNext.Studio.AI.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Alterations.Blazor\LINGYUN.Abp.ElsaNext.Studio.Alterations.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Blazor\LINGYUN.Abp.ElsaNext.Studio.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor\LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor\LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor\LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor\LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor\LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor\LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor\LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor.csproj" />
<ProjectReference Include="..\..\modules\elsa\LINGYUN.Abp.ElsaNext.Webhooks\LINGYUN.Abp.ElsaNext.Webhooks.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

6
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Localization/Resources/en.json

@ -0,0 +1,6 @@
{
"culture": "en",
"texts": {
"Menu:Logout": "Logout"
}
}

6
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Localization/Resources/zh-Hans.json

@ -0,0 +1,6 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:Logout": "退出登录"
}
}

22
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Navigation/UserMenuContributor.cs

@ -0,0 +1,22 @@
using Localization.Resources.AbpUi;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace LINGYUN.Abp.MicroService.WorkflowService.Navigation;
public class UserMenuContributor : IMenuContributor
{
public virtual Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name != StandardMenus.User)
{
return Task.CompletedTask;
}
var uiResource = context.GetLocalizer<AbpUiResource>();
context.Menu.AddItem(new ApplicationMenuItem("Auth.Logout", uiResource["Menu:Logout"], url: "~/Account/Logout", icon: "fa fa-power-off", order: int.MaxValue - 1000));
return Task.CompletedTask;
}
}

6
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Login.cshtml

@ -0,0 +1,6 @@
@page "/Account/Login"
@model LINGYUN.Abp.MicroService.WorkflowService.Pages.Auth.LoginModel
@{
ViewData["Title"] = "Login";
}
<p>Redirecting to the identity provider&hellip;</p>

21
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Login.cshtml.cs

@ -0,0 +1,21 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LINGYUN.Abp.MicroService.WorkflowService.Pages.Auth;
/// <summary>
/// Triggers the standard OIDC authorization-code flow: signing in challenges the "oidc" scheme so
/// the user is redirected to the external AuthServer, then back to this host's cookie.
/// </summary>
public class LoginModel : PageModel
{
public IActionResult OnGet(string returnUrl = null)
{
var redirectUri = string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl;
return Challenge(
new AuthenticationProperties { RedirectUri = redirectUri },
OpenIdConnectDefaults.AuthenticationScheme);
}
}

6
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Logout.cshtml

@ -0,0 +1,6 @@
@page "/Account/Logout"
@model LINGYUN.Abp.MicroService.WorkflowService.Pages.Auth.LogoutModel
@{
ViewData["Title"] = "Logout";
}
<p>Signing out&hellip;</p>

22
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/Account/Logout.cshtml.cs

@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.Cookies;
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace LINGYUN.Abp.MicroService.WorkflowService.Pages.Auth;
/// <summary>
/// Signs out the local cookie and ends the OIDC session at the external AuthServer.
/// </summary>
public class LogoutModel : PageModel
{
public IActionResult OnGet(string returnUrl = null)
{
var redirectUri = string.IsNullOrWhiteSpace(returnUrl) ? "/" : returnUrl;
return SignOut(
new AuthenticationProperties { RedirectUri = redirectUri },
CookieAuthenticationDefaults.AuthenticationScheme,
OpenIdConnectDefaults.AuthenticationScheme);
}
}

42
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/_Host.cshtml

@ -1,42 +0,0 @@
@page "/"
@inject IConfiguration Configuration;
@{
var serverUrl = Configuration["Elsa:Server:BaseUrl"];
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Elsa Workflows</title>
<link rel="icon" type="image/png" sizes="32x32" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/images/favicon-16x16.png">
<link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/assets/fonts/inter/inter.css">
<link rel="stylesheet" href="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.css">
<script src="/_content/Elsa.Designer.Components.Web/monaco-editor/min/vs/loader.js"></script>
<script type="module" src="/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/elsa-workflows-studio.esm.js"></script>
</head>
<body>
<elsa-studio-root server-url="@serverUrl" base-path="" monaco-lib-path="./_content/Elsa.Designer.Components.Web/monaco-editor/min">
<elsa-studio-dashboard></elsa-studio-dashboard>
</elsa-studio-root>
</body>
<script type="module">
// Import publicly exposed services.
import { WebhooksPlugin, WorkflowSettingsPlugin } from "/_content/Elsa.Designer.Components.Web/elsa-workflows-studio/index.esm.js";
// Get a handle to the elsa-studio-root element.
const elsaStudioRoot = document.querySelector('elsa-studio-root');
// Configure Elsa during the 'initializing' event.
elsaStudioRoot.addEventListener('initializing', e => {
const elsa = e.detail;
elsa.pluginManager.registerPlugins([
WebhooksPlugin,
WorkflowSettingsPlugin
]);
});
</script>
</html>

5
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Pages/_ViewImports.cshtml

@ -1,2 +1,3 @@
@using Microsoft.Extensions.Configuration @using Microsoft.AspNetCore.Authorization
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @using Microsoft.AspNetCore.Http
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

28
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/Program.cs

@ -1,20 +1,25 @@
using LINGYUN.Abp.Identity.Session.AspNetCore; using Elsa.Extensions;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.MicroService.WorkflowService; using LINGYUN.Abp.MicroService.WorkflowService;
using LINGYUN.Abp.MicroService.WorkflowService.Components;
using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.Application;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Serilog; using Serilog;
using System; using System;
using System.IO; using System.IO;
using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing;
using Volo.Abp.IO; using Volo.Abp.IO;
using Volo.Abp.Modularity.PlugIns; using Volo.Abp.Modularity.PlugIns;
Log.Information("Starting WorkflowService Host..."); Log.Information("Starting WorkflowService Host...");
var builder = WebApplication.CreateBuilder(args); var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseStaticWebAssets();
builder.Host.AddAppSettingsSecretsJson() builder.Host.AddAppSettingsSecretsJson()
.UseAutofac() .UseAutofac()
.ConfigureAppConfiguration((context, config) => .ConfigureAppConfiguration((context, config) =>
@ -27,7 +32,7 @@ builder.Host.AddAppSettingsSecretsJson()
.UseSerilog((context, provider, config) => .UseSerilog((context, provider, config) =>
{ {
config.ReadFrom.Configuration(context.Configuration); config.ReadFrom.Configuration(context.Configuration);
}); }, writeToProviders: true);
builder.AddServiceDefaults(); builder.AddServiceDefaults();
@ -49,18 +54,19 @@ await app.InitializeApplicationAsync();
app.MapDefaultEndpoints(); app.MapDefaultEndpoints();
app.UseForwardedHeaders(); app.UseForwardedHeaders();
// 本地化 app.UseCors();
app.UseMapRequestLocalization();
app.UseCorrelationId(); app.UseCorrelationId();
app.MapAbpStaticAssets(); app.UseMapRequestLocalization();
app.UseRouting(); app.UseRouting();
app.UseCors(); app.UseStaticFiles();
app.MapAbpStaticAssets();
app.UseAuthentication(); app.UseAuthentication();
app.UseJwtTokenMiddleware(); app.UseJwtTokenMiddleware();
app.UseMultiTenancy(); app.UseMultiTenancy();
app.UseAbpSession(); app.UseAbpSession();
app.UseDynamicClaims(); app.UseDynamicClaims();
app.UseAuthorization(); app.UseAuthorization();
app.UseAntiforgery();
app.UseSwagger(); app.UseSwagger();
app.UseAbpSwaggerUI(options => app.UseAbpSwaggerUI(options =>
{ {
@ -70,9 +76,15 @@ app.UseAbpSwaggerUI(options =>
options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]);
options.OAuthScopes(configuration["AuthServer:Audience"]); options.OAuthScopes(configuration["AuthServer:Audience"]);
}); });
app.UseWorkflowsApi(); // Use Elsa API endpoints.
app.UseWorkflows(); // Use Elsa middleware for HTTP Endpoint activities.
app.UseAuditing(); app.UseAuditing();
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseConfiguredEndpoints(); app.UseConfiguredEndpoints(builder =>
app.UseHttpActivities(); {
builder.MapRazorComponents<App>()
.AddInteractiveServerRenderMode()
.AddAdditionalAssemblies(builder.ServiceProvider.GetRequiredService<IOptions<AbpRouterOptions>>().Value.AdditionalAssemblies.ToArray());
});
await app.RunAsync(); await app.RunAsync();

273
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.Configure.cs

@ -1,31 +1,50 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using Elsa; using Elsa.Agents;
using Elsa.Options; using Elsa.AI.Persistence.EFCore.Sqlite.Extensions;
using Elsa.Rebus.RabbitMq; using Elsa.Alterations.Extensions;
using LINGYUN.Abp.BackgroundTasks; using Elsa.Extensions;
using Elsa.Features.Services;
using Elsa.Persistence.EFCore.Extensions;
using Elsa.Persistence.EFCore.Modules.Alterations;
using Elsa.Persistence.EFCore.Modules.Labels;
using Elsa.Persistence.EFCore.Modules.Management;
using Elsa.Persistence.EFCore.Modules.Runtime;
using Elsa.Secrets.Persistence.EFCore.Extensions;
using Elsa.Secrets.Persistence.EFCore.Sqlite.Extensions;
using Elsa.Studio.Authentication.OpenIdConnect.HttpMessageHandlers;
using Elsa.Studio.Workflows.Designer.Extensions;
using LINGYUN.Abp.ElsaNext.Studio.Blazor;
using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement; using LINGYUN.Abp.LocalizationManagement;
using LINGYUN.Abp.MicroService.WorkflowService.Extensions;
using LINGYUN.Abp.MicroService.WorkflowService.Navigation;
using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.WebhooksManagement;
using Localization.Resources.AbpUi;
using Medallion.Threading; using Medallion.Threading;
using Medallion.Threading.Redis; using Medallion.Threading.Redis;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.DataProtection;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Caching.StackExchangeRedis; using Microsoft.Extensions.Caching.StackExchangeRedis;
using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.IdentityModel.Logging; using Microsoft.IdentityModel.Logging;
using Microsoft.IdentityModel.Tokens; using Microsoft.IdentityModel.Tokens;
using Microsoft.OpenApi; using Microsoft.OpenApi;
using Quartz;
using StackExchange.Redis; using StackExchange.Redis;
using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerGen;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Security.Claims;
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using System.Text.Unicode; using System.Text.Unicode;
using Volo.Abp.AspNetCore.Components.Web;
using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.AntiForgery; using Volo.Abp.AspNetCore.Mvc.AntiForgery;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
@ -38,18 +57,12 @@ using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement; using Volo.Abp.PermissionManagement;
using Volo.Abp.Quartz; using Volo.Abp.Roles;
using Volo.Abp.Security.Claims; using Volo.Abp.Security.Claims;
using Volo.Abp.Threading; using Volo.Abp.Threading;
using Volo.Abp.Timing; using Volo.Abp.Timing;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
using ConsoleStartup = Elsa.Activities.Console.Startup;
using HttpStartup = Elsa.Activities.Http.Startup;
using JavaScriptStartup = Elsa.Scripting.JavaScript.Startup;
using TemporalQuartzStartup = Elsa.Activities.Temporal.Quartz.Startup;
using UserTaskStartup = Elsa.Activities.UserTask.Startup;
using WebhooksListEndpoint = Elsa.Webhooks.Api.Endpoints.List;
using WebhooksStartup = Elsa.Activities.Webhooks.Startup;
namespace LINGYUN.Abp.MicroService.WorkflowService; namespace LINGYUN.Abp.MicroService.WorkflowService;
@ -105,102 +118,124 @@ public partial class WorkflowServiceModule
private void PreConfigureQuartz(IConfiguration configuration) private void PreConfigureQuartz(IConfiguration configuration)
{ {
PreConfigure<AbpQuartzOptions>(options => //PreConfigure<AbpQuartzOptions>(options =>
{ //{
// 如果使用持久化存储, 则配置quartz持久层 // // 如果使用持久化存储, 则配置quartz持久层
if (configuration.GetSection("Quartz:UsePersistentStore").Get<bool>()) // if (configuration.GetSection("Quartz:UsePersistentStore").Get<bool>())
{ // {
var settings = configuration.GetSection("Quartz:Properties").Get<Dictionary<string, string>>(); // var settings = configuration.GetSection("Quartz:Properties").Get<Dictionary<string, string>>();
if (settings != null) // if (settings != null)
{ // {
foreach (var setting in settings) // foreach (var setting in settings)
{ // {
options.Properties[setting.Key] = setting.Value; // options.Properties[setting.Key] = setting.Value;
} // }
} // }
options.Configurator += (config) => // options.Configurator += (config) =>
{ // {
config.UsePersistentStore(store => // config.UsePersistentStore(store =>
{ // {
store.UseProperties = false; // store.UseProperties = false;
store.UseNewtonsoftJsonSerializer(); // store.UseNewtonsoftJsonSerializer();
}); // });
}; // };
} // }
}); //});
} }
private void ConfigureBackgroundTasks(IServiceCollection services, IConfiguration configuration) private void ConfigureBackgroundTasks(IServiceCollection services, IConfiguration configuration)
{ {
Configure<AbpBackgroundTasksOptions>(options => //Configure<AbpBackgroundTasksOptions>(options =>
{ //{
options.NodeName = services.GetApplicationName(); // options.NodeName = services.GetApplicationName();
}); //});
} }
private void PreConfigureElsa(IServiceCollection services, IConfiguration configuration) private void PreConfigureElsa(IServiceCollection services, IConfiguration configuration)
{ {
var elsaSection = configuration.GetSection("Elsa"); PreConfigure<AbpAspNetCoreComponentsWebOptions>(options =>
var startups = new[] {
{ options.IsBlazorWebApp = true;
typeof(ConsoleStartup), });
typeof(HttpStartup),
typeof(UserTaskStartup), services.AddAIPersistenceStores(options => options.UseSqlite());
typeof(TemporalQuartzStartup),
typeof(JavaScriptStartup),
typeof(WebhooksStartup),
};
PreConfigure<ElsaOptionsBuilder>(elsa => PreConfigure<IModule>(elsa =>
{ {
elsa elsa.UseWorkflowManagement(management =>
.AddActivitiesFrom<WorkflowServiceModule>() {
.AddWorkflowsFrom<WorkflowServiceModule>() management.UseEntityFrameworkCore(ef => ef.UseSqlite());
.AddFeatures(startups, configuration) });
.ConfigureWorkflowChannels(options => elsaSection.GetSection("WorkflowChannels").Bind(options))
.UseRabbitMq(elsaSection["Rebus:RabbitMQ:Connection"]);
elsa.DistributedLockingOptionsBuilder elsa.UseWorkflowRuntime(runtime =>
.UseProviderFactory(sp => name => {
{ runtime.UseEntityFrameworkCore(ef => ef.UseSqlite());
var provider = sp.GetRequiredService<IDistributedLockProvider>(); });
return provider.CreateLock(name); elsa.UseAlterations(alteration =>
}); {
}); alteration.UseEntityFrameworkCore(ef => ef.UseSqlite());
});
elsa.UseAgentPersistence(agent =>
{
agent.UseEntityFrameworkCore(ef => ef.UseSqlite());
});
elsa.UseLabels(label =>
{
label.UseEntityFrameworkCore(ef => ef.UseSqlite());
});
elsa.UseSecrets(secret =>
{
secret.UseEntityFrameworkCore(ef => ef.UseSqlite());
});
elsa.UseQuartz(quartz =>
{
quartz.UseSqlite();
});
services.AddNotificationHandlersFrom<WorkflowServiceModule>(); elsa.UseScheduling(scheduling =>
{
scheduling.UseQuartzScheduler();
});
});
PreConfigure<IMvcBuilder>(mvcBuilder => PreConfigure<AbpElsaNextStudioBlazorOptions>(options =>
{ {
mvcBuilder.AddApplicationPartIfNotExists(typeof(WebhooksListEndpoint).Assembly); options.BackendApiConfig.ConfigureHttpClientBuilder = options =>
{
options.AuthenticationHandler = typeof(OidcAuthenticatingApiHttpMessageHandler);
options.ConfigureHttpClient = (_, client) =>
{
// Set a long time out to simplify debugging both Elsa Studio and the Elsa Server backend.
client.Timeout = TimeSpan.FromHours(1);
};
};
}); });
services.AddRazorComponents()
.AddInteractiveServerComponents(options =>
{
options.RootComponents.RegisterCustomElsaStudioElements();
});
} }
private void ConfigureEndpoints(IServiceCollection services) private void ConfigureElsa(IServiceCollection services, IConfiguration configuration)
{ {
// 不需要 //Configure<AbpElsaNextShellOptions>(options =>
//Configure<AbpEndpointRouterOptions>(options =>
//{ //{
// options.EndpointConfigureActions.Add( // options.WithFeature<SqliteWorkflowPersistenceShellFeature>();
// (context) =>
// {
// context.Endpoints.MapFallbackToPage("/_Host");
// });
//}); //});
var preActions = services.GetPreConfigureActions<AbpAspNetCoreMvcOptions>();
services.AddAbpApiVersioning(options => // EndpointSecurityOptions.DisableSecurity();
{
options.ReportApiVersions = true;
options.AssumeDefaultVersionWhenUnspecified = true;
//options.ApiVersionReader = new HeaderApiVersionReader("api-version"); //Supports header too services.AddOpenIdConnectAuth(options =>
//options.ApiVersionReader = new MediaTypeApiVersionReader(); //Supports accept header too
}, mvcOptions =>
{ {
mvcOptions.ConfigureAbp(preActions.Configure()); configuration.GetSection("Authentication:OpenIdConnect").Bind(options);
}); });
} }
@ -296,6 +331,16 @@ public partial class WorkflowServiceModule
{ {
options.ExposeIntegrationServices = true; options.ExposeIntegrationServices = true;
}); });
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new UserMenuContributor());
});
Configure<AbpRouterOptions>(options =>
{
options.AppAssembly = typeof(WorkflowServiceModule).Assembly;
});
} }
private void ConfigureVirtualFileSystem() private void ConfigureVirtualFileSystem()
@ -306,12 +351,30 @@ public partial class WorkflowServiceModule
}); });
} }
private void ConfigureNotificationsManagement()
{
Configure<AbpNotificationsManagementOptions>(options =>
{
options.IsDynamicNotificationsStoreEnabled = true;
options.SaveStaticNotificationsToDatabase = false;
});
}
private void ConfigurePermissionManagement() private void ConfigurePermissionManagement()
{ {
Configure<PermissionManagementOptions>(options => Configure<PermissionManagementOptions>(options =>
{ {
options.IsDynamicPermissionStoreEnabled = true; options.IsDynamicPermissionStoreEnabled = true;
options.SaveStaticPermissionsToDatabase = false; options.SaveStaticPermissionsToDatabase = true;
});
}
private void ConfigureWebhooksManagement()
{
Configure<WebhooksManagementOptions>(options =>
{
options.IsDynamicWebhookStoreEnabled = true;
options.SaveStaticWebhooksToDatabase = false;
}); });
} }
@ -343,7 +406,7 @@ public partial class WorkflowServiceModule
{ {
options.IsDynamicClaimsEnabled = true; options.IsDynamicClaimsEnabled = true;
options.RemoteRefreshUrl = configuration["App:RefreshClaimsUrl"] + options.RemoteRefreshUrl; options.RemoteRefreshUrl = configuration["App:RefreshClaimsUrl"] + options.RemoteRefreshUrl;
options.DynamicClaims.Add(Elsa.PermissionNames.ClaimType);
}); });
} }
@ -411,6 +474,9 @@ public partial class WorkflowServiceModule
{ {
options.Languages.Add(new LanguageInfo("en", "en", "English")); options.Languages.Add(new LanguageInfo("en", "en", "English"));
options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文")); options.Languages.Add(new LanguageInfo("zh-Hans", "zh-Hans", "简体中文"));
options.Resources.Get<AbpUiResource>()
.AddVirtualJson("/Localization/Resources");
}); });
Configure<AbpLocalizationCultureMapOptions>(options => Configure<AbpLocalizationCultureMapOptions>(options =>
@ -438,7 +504,7 @@ public partial class WorkflowServiceModule
options.AutoValidate = false; options.AutoValidate = false;
}); });
services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) services.AddAuthentication()
.AddAbpJwtBearer(options => .AddAbpJwtBearer(options =>
{ {
configuration.GetSection("AuthServer").Bind(options); configuration.GetSection("AuthServer").Bind(options);
@ -454,7 +520,38 @@ public partial class WorkflowServiceModule
{ {
options.TokenValidationParameters.ValidAudiences = validAudiences; options.TokenValidationParameters.ValidAudiences = validAudiences;
} }
});
options.Events ??= new JwtBearerEvents();
var previousOnTokenValidated = options.Events.OnTokenValidated;
options.Events.OnTokenValidated = async context =>
{
await previousOnTokenValidated(context);
if (context.Principal?.Identity?.IsAuthenticated == true)
{
//var options = context.HttpContext.RequestServices.GetRequiredService<IOptions<AbpElsaPermissionMapOptions>>();
//var permissionChecker = context.HttpContext.RequestServices.GetRequiredService<IPermissionChecker>();
//var permissionNames = options.Value.PermissionMaps.Select(x => x.Source).ToArray();
//var checkResult = await permissionChecker.IsGrantedAsync(context.Principal, permissionNames);
//var grantPermissions = checkResult.Result.Where(x => x.Value == PermissionGrantResult.Granted).Select(x => x.Key);
//var elsaPermissions = options.Value.PermissionMaps.Where(x => grantPermissions.Contains(x.Source))
// .Select(x => new Claim("permissions", x.Target))
// .ToList();
//context.Principal.AddIdentity(new ClaimsIdentity(elsaPermissions));
var roleClaims = context.Principal.FindAll(AbpClaimTypes.Role);
if (roleClaims.Any(x => x.Value.Equals(AbpRoleConsts.AdminRoleName, StringComparison.CurrentCultureIgnoreCase)))
{
context.Principal.AddIdentity(new ClaimsIdentity(
new[] { new Claim(Elsa.PermissionNames.ClaimType, Elsa.PermissionNames.All) }));
}
}
};
})
;
services services
.AddDataProtection() .AddDataProtection()

77
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/WorkflowServiceModule.cs

@ -2,16 +2,29 @@
using LINGYUN.Abp.AspNetCore.Mvc.Wrapper; using LINGYUN.Abp.AspNetCore.Mvc.Wrapper;
using LINGYUN.Abp.AuditLogging.Elasticsearch; using LINGYUN.Abp.AuditLogging.Elasticsearch;
using LINGYUN.Abp.Authorization.OrganizationUnits; using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BackgroundTasks.DistributedLocking;
using LINGYUN.Abp.BackgroundTasks.Quartz;
using LINGYUN.Abp.BlobStoring.BlobManagement; using LINGYUN.Abp.BlobStoring.BlobManagement;
using LINGYUN.Abp.Claims.Mapping; using LINGYUN.Abp.Claims.Mapping;
using LINGYUN.Abp.Data.DbMigrator; using LINGYUN.Abp.Data.DbMigrator;
using LINGYUN.Abp.Dynamic.Definitions; using LINGYUN.Abp.Dynamic.Definitions;
using LINGYUN.Abp.Elsa; using LINGYUN.Abp.ElsaNext.Agents.Blazor;
using LINGYUN.Abp.Elsa.Activities; using LINGYUN.Abp.ElsaNext.BlobStoring;
using LINGYUN.Abp.Elsa.EntityFrameworkCore.PostgreSql; using LINGYUN.Abp.ElsaNext.Email;
using LINGYUN.Abp.Elsa.Notifications; using LINGYUN.Abp.ElsaNext.Labels;
using LINGYUN.Abp.ElsaNext.Notifications;
using LINGYUN.Abp.ElsaNext.Secrets.Blazor;
using LINGYUN.Abp.ElsaNext.Server;
using LINGYUN.Abp.ElsaNext.Studio.AI.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Alterations.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Dashboard.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Diagnostics.OpenTelemetry.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Diagnostics.StructuredLogs.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Identity.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Labels.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Notifications.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Saas.Blazor;
using LINGYUN.Abp.ElsaNext.Studio.Webhooks.Blazor;
using LINGYUN.Abp.ElsaNext.Webhooks;
using LINGYUN.Abp.Emailing.Platform; using LINGYUN.Abp.Emailing.Platform;
using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing; using LINGYUN.Abp.ExceptionHandling.Emailing;
@ -19,25 +32,27 @@ using LINGYUN.Abp.Http.Client.Wrapper;
using LINGYUN.Abp.Identity.Session.AspNetCore; using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.Localization.CultureMap; using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore; using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Quartz.PostgresSqlInstaller; using LINGYUN.Abp.Notifications.EntityFrameworkCore;
using LINGYUN.Abp.Saas.EntityFrameworkCore; using LINGYUN.Abp.Saas.EntityFrameworkCore;
using LINGYUN.Abp.Serilog.Enrichers.Application; using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId; using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
using LINGYUN.Abp.Sms.Platform; using LINGYUN.Abp.Sms.Platform;
using LINGYUN.Abp.TaskManagement.EntityFrameworkCore; using LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using System; using System;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Authentication.OpenIdConnect;
using Volo.Abp.AspNetCore.Components.Server.MudBlazorBasicTheme;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc.NewtonsoftJson;
using Volo.Abp.AspNetCore.Serilog; using Volo.Abp.AspNetCore.Serilog;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Http.Client.IdentityModel.Web;
using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore;
using Volo.Abp.SettingManagement.EntityFrameworkCore; using Volo.Abp.SettingManagement.EntityFrameworkCore;
@ -52,29 +67,48 @@ namespace LINGYUN.Abp.MicroService.WorkflowService;
typeof(AbpAuditLoggingElasticsearchModule), typeof(AbpAuditLoggingElasticsearchModule),
typeof(AbpAspNetCoreSerilogModule), typeof(AbpAspNetCoreSerilogModule),
typeof(AbpBlobStoringBlobManagementModule), typeof(AbpBlobStoringBlobManagementModule),
typeof(AbpElsaModule), typeof(AbpElsaNextBlobStoringModule),
typeof(AbpElsaServerModule), typeof(AbpElsaNextEmailModule),
typeof(AbpElsaActivitiesModule), typeof(AbpElsaNextLabelsModule),
typeof(AbpElsaNotificationsModule), typeof(AbpElsaNextNotificationsModule),
typeof(AbpElsaNextWebhooksModule),
typeof(AbpElsaNextServerModule),
typeof(AbpElsaNextStudioBlazorModule),
typeof(AbpElsaNextAgentsBlazorModule),
typeof(AbpElsaNextSecretsBlazorModule),
typeof(AbpElsaNextStudioAIBlazorModule),
typeof(AbpElsaNextStudioAlterationsBlazorModule),
typeof(AbpElsaNextStudioDashboardBlazorModule),
typeof(AbpElsaNextStudioDiagnosticsOpenTelemetryBlazorModule),
typeof(AbpElsaNextStudioDiagnosticsStructuredLogsBlazorModule),
typeof(AbpElsaNextStudioIdentityBlazorModule),
typeof(AbpElsaNextStudioLabelsBlazorModule),
typeof(AbpElsaNextStudioNotificationsBlazorModule),
typeof(AbpElsaNextStudioSaasBlazorModule),
typeof(AbpElsaNextStudioWebhooksBlazorModule),
typeof(AbpEmailingExceptionHandlingModule), typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpHttpClientIdentityModelWebModule), typeof(AbpHttpClientIdentityModelWebModule),
typeof(AbpAspNetCoreMultiTenancyModule), typeof(AbpAspNetCoreMultiTenancyModule),
typeof(AbpBackgroundTasksQuartzModule), //typeof(AbpBackgroundTasksQuartzModule),
typeof(AbpBackgroundTasksDistributedLockingModule), //typeof(AbpBackgroundTasksDistributedLockingModule),
typeof(AbpQuartzPostgresSqlInstallerModule), //typeof(AbpQuartzPostgresSqlInstallerModule),
typeof(TaskManagementEntityFrameworkCoreModule), //typeof(TaskManagementEntityFrameworkCoreModule),
typeof(AbpFeatureManagementEntityFrameworkCoreModule), typeof(AbpFeatureManagementEntityFrameworkCoreModule),
typeof(AbpPermissionManagementEntityFrameworkCoreModule), typeof(AbpPermissionManagementEntityFrameworkCoreModule),
typeof(AbpSettingManagementEntityFrameworkCoreModule), typeof(AbpSettingManagementEntityFrameworkCoreModule),
typeof(AbpSaasEntityFrameworkCoreModule), typeof(AbpSaasEntityFrameworkCoreModule),
typeof(AbpIdentityEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule), typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpElsaEntityFrameworkCorePostgreSqlModule), typeof(AbpNotificationsEntityFrameworkCoreModule),
typeof(WebhooksManagementEntityFrameworkCoreModule),
typeof(AbpAuthorizationOrganizationUnitsModule), typeof(AbpAuthorizationOrganizationUnitsModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAspNetCoreAuthenticationOpenIdConnectModule),
typeof(AbpTextTemplatingScribanModule), typeof(AbpTextTemplatingScribanModule),
typeof(AbpDataDbMigratorModule), typeof(AbpDataDbMigratorModule),
typeof(AbpCachingStackExchangeRedisModule), typeof(AbpCachingStackExchangeRedisModule),
typeof(AbpAspNetCoreMvcModule), typeof(AbpAspNetCoreMvcModule),
typeof(AbpAspNetCoreComponentsServerMudBlazorBasicThemeModule),
typeof(AbpSwashbuckleModule), typeof(AbpSwashbuckleModule),
typeof(AbpCAPEventBusModule), typeof(AbpCAPEventBusModule),
typeof(AbpLocalizationCultureMapModule), typeof(AbpLocalizationCultureMapModule),
@ -83,7 +117,6 @@ namespace LINGYUN.Abp.MicroService.WorkflowService;
typeof(AbpSmsPlatformModule), typeof(AbpSmsPlatformModule),
typeof(AbpEmailingPlatformModule), typeof(AbpEmailingPlatformModule),
typeof(AbpClaimsMappingModule), typeof(AbpClaimsMappingModule),
typeof(AbpAspNetCoreMvcNewtonsoftModule),
typeof(AbpAspNetCoreHttpOverridesModule), typeof(AbpAspNetCoreHttpOverridesModule),
typeof(AbpDynamicDefinitionsModule), typeof(AbpDynamicDefinitionsModule),
typeof(AbpIdentitySessionAspNetCoreModule), typeof(AbpIdentitySessionAspNetCoreModule),
@ -114,21 +147,21 @@ public partial class WorkflowServiceModule : AbpModule
ConfigureDbContext(); ConfigureDbContext();
ConfigureLocalization(); ConfigureLocalization();
ConfigureVirtualFileSystem(); ConfigureVirtualFileSystem();
ConfigureNotificationsManagement();
ConfigurePermissionManagement(); ConfigurePermissionManagement();
ConfigureWebhooksManagement();
ConfigureTiming(configuration); ConfigureTiming(configuration);
ConfigureCaching(configuration); ConfigureCaching(configuration);
ConfigureAuditing(configuration); ConfigureAuditing(configuration);
ConfigureIdentity(configuration); ConfigureIdentity(configuration);
ConfigureMultiTenancy(configuration); ConfigureMultiTenancy(configuration);
ConfigureEndpoints(context.Services);
ConfigureMvc(context.Services, configuration); ConfigureMvc(context.Services, configuration);
ConfigureCors(context.Services, configuration); ConfigureCors(context.Services, configuration);
ConfigureElsa(context.Services, configuration);
ConfigureSwagger(context.Services, configuration); ConfigureSwagger(context.Services, configuration);
ConfigureBlobStoring(context.Services, configuration); ConfigureBlobStoring(context.Services, configuration);
ConfigureDistributedLock(context.Services, configuration); ConfigureDistributedLock(context.Services, configuration);
ConfigureBackgroundTasks(context.Services, configuration); ConfigureBackgroundTasks(context.Services, configuration);
ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment()); ConfigureSecurity(context.Services, configuration, hostingEnvironment.IsDevelopment());
context.Services.AddRazorPages();
} }
} }

122
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json

@ -33,77 +33,56 @@
} }
}, },
"Elsa": { "Elsa": {
"Features": { "AI": {
"DefaultPersistence": { "Host": {
"Enabled": true, "DefaultProviderName": "copilot",
"ConnectionStringIdentifier": "Default", "Providers": [
"YesSql": { {
"MySql": { "Name": "copilot",
"Provider": "copilot",
"Model": "GPT-5 mini",
"Enabled": true "Enabled": true
} }
}, ]
"EntityFrameworkCore": {
"MySql": {
"Enabled": true
}
}
},
"Console": true,
"Http": true,
"Email": true,
"TemporalQuartz": true,
"JavaScriptActivities": true,
"UserTask": true,
"Conductor": true,
"Telnyx": true,
"BlobStoring": true,
"Emailing": true,
"Notification": true,
"Sms": true,
"IM": true,
"PublishWebhook": true,
"Webhooks": {
"Enabled": true,
"ConnectionStringIdentifier": "Default",
"YesSql": {
"MySql": {
"Enabled": true
}
},
"EntityFrameworkCore": {
"MySql": {
"Enabled": true
}
}
}, },
"WorkflowSettings": { "Copilot": {
"Enabled": true, "EnableStreaming": true,
"ConnectionStringIdentifier": "Default", "Model": "GPT-5 mini",
"YesSql": { "WorkingDirectory": "copilot",
"MySql": { "BaseDirectory": "./workspace"
"Enabled": true
}
},
"EntityFrameworkCore": {
"MySql": {
"Enabled": true
}
}
} }
}, },
"Rebus": { "Http": {
"RabbitMQ": { "BaseUrl": "http://localhost:30050"
"Connection": "amqp://admin:123456@localhost:5672/" },
} "Secrets": {
"EncryptionKey": "Q0hBTkdFX01FX1RPX0FfU0VDVVJFX1JBTkRPTV9LRVk="
}, },
"Server": { "Server": {
"BaseUrl": "http://localhost:30035" "EnableRealTimeWorkflows": true
},
"Studio": {
"Backend": {
"Url": "http://localhost:30050/elsa/api"
},
"DesignerOptions": {
"UseReactFlow": false
},
"Shell": {
"DisableAuthorization": true
},
"Presentation": {
"Theme": "classic"
}
} }
}, },
"RemoteServices": { "RemoteServices": {
"BlobManagement": { "BlobManagement": {
"BaseUrl": "http://localhost:30025", "BaseUrl": "http://localhost:30025",
"IdentityClient": "InternalServiceClient", "UseCurrentAccessToken": false
},
"Platform": {
"BaseUrl": "http://localhost:30025",
"UseCurrentAccessToken": false "UseCurrentAccessToken": false
} }
}, },
@ -159,8 +138,26 @@
"ValidAudiences": [ "lingyun-abp-application" ], "ValidAudiences": [ "lingyun-abp-application" ],
"MapInboundClaims": false, "MapInboundClaims": false,
"RequireHttpsMetadata": false, "RequireHttpsMetadata": false,
"ElsaClientId": "InternalServiceClient", "ClientId": "elsa-studio-client",
"SwaggerClientId": "vue-oauth-client" "SwaggerClientId": "elsa-studio-client"
},
"Authentication": {
"OpenIdConnect": {
"Authority": "http://localhost:44385",
"ClientId": "elsa-studio-client",
"ClientSecret": null,
"AuthenticationScopes": [
"openid",
"profile",
"roles",
"email",
"offline_access",
"workflow-service"
],
"MapInboundClaims": false,
"RequireHttpsMetadata": false,
"SaveTokens": true
}
}, },
"Logging": { "Logging": {
"Serilog": { "Serilog": {
@ -183,7 +180,8 @@
"Override": { "Override": {
"System": "Warning", "System": "Warning",
"Microsoft": "Warning", "Microsoft": "Warning",
"DotNetCore": "Warning" "DotNetCore": "Warning",
"LINGYUN.Abp.ElsaNext.Notifications": "Debug"
} }
}, },
"WriteTo": [ "WriteTo": [

8
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/package.json

@ -0,0 +1,8 @@
{
"version": "10.6.0",
"name": "aspire-workflow-service",
"private": true,
"dependencies": {
"@abp/aspnetcore.components.server.basictheme": "10.6.0"
}
}

2
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.BlobStoring/LINGYUN/Abp/Elsa/Activities/BlobStoring/ElsaBlobContainer.cs

@ -2,7 +2,7 @@
namespace LINGYUN.Abp.Elsa.Activities.BlobStoring; namespace LINGYUN.Abp.Elsa.Activities.BlobStoring;
[BlobContainerName("elsa")] [BlobContainerName("workflow")]
public class ElsaBlobContainer public class ElsaBlobContainer
{ {
} }

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

24
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN.Abp.ElsaNext.AI.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.AI</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.AI</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.AI.Copilot" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

23
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/AbpElsaNextAIModule.cs

@ -0,0 +1,23 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.AI.Extensions;
using Microsoft.Extensions.Configuration;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.ElsaNext.AI;
[DependsOn(typeof(AbpElsaNextModule))]
public class AbpElsaNextAIModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Configuration.GetSection("Elsa:AI");
PreConfigure<IModule>(elsa =>
{
elsa.UseAbpAI(ai =>
{
ai.ConfigureOptions = options => configuration.GetSection("Host").Bind(options);
ai.ConfigureCopilotOptions = options => configuration.GetSection("Copilot").Bind(options);
});
});
}
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/Extensions/ModuleExtensions.cs

@ -0,0 +1,14 @@
using Elsa.Extensions;
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.AI.Features;
using System;
namespace LINGYUN.Abp.ElsaNext.AI.Extensions;
public static class ModuleExtensions
{
public static IModule UseAbpAI(this IModule module, Action<AbpAIFeature>? configure = null)
{
return module.Use(configure);
}
}

44
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.AI/LINGYUN/Abp/ElsaNext/AI/Features/AbpAIFeature.cs

@ -0,0 +1,44 @@
using Elsa.AI.Copilot.Options;
using Elsa.AI.Host.Features;
using Elsa.AI.Host.Options;
using Elsa.AI.Host.Services;
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
using System;
namespace LINGYUN.Abp.ElsaNext.AI.Features;
public class AbpAIFeature(IModule module) : FeatureBase(module)
{
public Action<AIHostOptions>? ConfigureOptions { get; set; }
public Action<CopilotOptions>? ConfigureCopilotOptions { get; set; }
public Action<AIToolEnablementService>? ConfigureToolEnablement { get; set; }
public override void Configure()
{
Module.AddFastEndpointsAssembly<AIFeature>();
}
public override void Apply()
{
Services.AddAIHostServices(ConfigureOptions);
Services.AddCopilotAIProvider(ConfigureCopilotOptions);
if (ConfigureToolEnablement != null)
{
Services.AddSingleton(ConfigureToolEnablement);
}
Module.AddFastEndpointsFromModule();
}
public AbpAIFeature EnableWorkflowProposalTools()
{
ConfigureToolEnablement += enablement =>
{
enablement.Enable("workflows.proposeCreate");
enablement.Enable("workflows.proposeUpdate");
};
return this;
}
}

49
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/AbpElsaNextAgentsBlazorModule.cs

@ -0,0 +1,49 @@
using Elsa.Studio.Extensions;
using LINGYUN.Abp.ElsaNext.Agents.Blazor.Navigation;
using LINGYUN.Abp.ElsaNext.Localization;
using LINGYUN.Abp.ElsaNext.Studio.Blazor;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ElsaNext.Agents.Blazor;
[DependsOn(
typeof(AbpElsaNextAgentsModule),
typeof(AbpElsaNextStudioBlazorModule))]
public class AbpElsaNextAgentsBlazorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Configuration.GetSection("Elsa:Studio");
Configure<AbpRouterOptions>(options =>
{
options.AdditionalAssemblies.Add(typeof(Elsa.Studio.Agents.Feature).Assembly);
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new ElsaStudioAgentsMenuContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextAgentsBlazorModule>("LINGYUN.Abp.ElsaNext.Agents.Blazor");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/Localization/Resources/AgentsBlazor");
});
var elsaNextStudioBlazoeOptions = context.Services.ExecutePreConfiguredActions<AbpElsaNextStudioBlazorOptions>();
context.Services.AddAgentsModule(elsaNextStudioBlazoeOptions.BackendApiConfig);
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

29
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/LINGYUN.Abp.ElsaNext.Agents.Blazor.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Agents.Blazor</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Agents.Blazor</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<Content Remove="Localization\Resources\AgentsBlazor\*.json" />
<EmbeddedResource Include="Localization\Resources\AgentsBlazor\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elsa.Studio.Agents" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Agents\LINGYUN.Abp.ElsaNext.Agents.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Studio.Blazor\LINGYUN.Abp.ElsaNext.Studio.Blazor.csproj" />
</ItemGroup>
</Project>

7
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Localization/Resources/AgentsBlazor/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Menu:Agents": "Agents",
"Agents": "Agents"
}
}

7
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Localization/Resources/AgentsBlazor/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:Agents": "代理",
"Agents": "代理"
}
}

28
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/Navigation/ElsaStudioAgentsMenuContributor.cs

@ -0,0 +1,28 @@
using LINGYUN.Abp.ElsaNext.Localization;
using LINGYUN.Abp.ElsaNext.Studio.Blazor.Navigation;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace LINGYUN.Abp.ElsaNext.Agents.Blazor.Navigation;
public class ElsaStudioAgentsMenuContributor : IMenuContributor
{
public Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
var menu = context.Menu;
var l = context.GetLocalizer<ElsaNextResource>();
var group = menu.GetMenuItemOrNull(ElsaStudioMenus.GroupName);
group?.AddItem(new ApplicationMenuItem(
ElsaStudioMenus.GroupName + ".Agents",
l["Menu:Agents"],
url: "/ai/agents",
icon: "fa fa-bots",
order: 5));
}
return Task.CompletedTask;
}
}

5
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents.Blazor/_Imports.razor

@ -0,0 +1,5 @@
@using Microsoft.AspNetCore.Authorization
@using Microsoft.AspNetCore.Components.Web
@using Elsa.Studio.Components
@using Elsa.Studio.Localization
@using MudBlazor

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

27
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/LINGYUN.Abp.ElsaNext.Agents.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Agents</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Agents</PackageId>
<ImplicitUsings>enable</ImplicitUsings>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Agents" />
<PackageReference Include="Elsa.Agents.Api" />
<PackageReference Include="Elsa.Agents.OpenAI" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

22
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Agents/LINGYUN/Abp/ElsaNext/Agents/AbpElsaNextAgentsModule.cs

@ -0,0 +1,22 @@
using Elsa.Agents;
using Elsa.Extensions;
using Elsa.Features.Services;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.ElsaNext.Agents;
[DependsOn(
typeof(AbpElsaNextModule))]
public class AbpElsaNextAgentsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseAgents();
elsa.UseAgentActivities();
elsa.UseAgentsApi();
});
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

24
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/LINGYUN.Abp.ElsaNext.Alterations.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Alterations</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Alterations</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Alterations" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

28
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Alterations/LINGYUN/Abp/ElsaNext/Alterations/AbpElsaNextAlterationsModule.cs

@ -0,0 +1,28 @@
using Elsa.Alterations.Extensions;
using Elsa.Features.Contracts;
using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.ElsaNext.Alterations;
[DependsOn(
typeof(AbpElsaNextModule))]
public class AbpElsaNextAlterationsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseAlterations();
});
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
// TODO: 强制启用Studio中的Alterations?
var registry = context.ServiceProvider.GetRequiredService<IInstalledFeatureRegistry>();
registry.Add(new("Alterations.ShellFeatures.Alterations", "Elsa", "Alterations.ShellFeatures.Alterations"));
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

29
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN.Abp.ElsaNext.BlobStoring.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.BlobStoring</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.BlobStoring</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<Content Remove="LINGYUN\Abp\ElsaNext\BlobStoring\Localization\**\*.json" />
<EmbeddedResource Include="LINGYUN\Abp\ElsaNext\BlobStoring\Localization\**\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.BlobStoring" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

38
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/AbpElsaNextBlobStoringModule.cs

@ -0,0 +1,38 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.BlobStoring.Extensions;
using LINGYUN.Abp.ElsaNext.Localization;
using Volo.Abp.BlobStoring;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ElsaNext.BlobStoring;
[DependsOn(
typeof(AbpBlobStoringModule),
typeof(AbpElsaNextModule))]
public class AbpElsaNextBlobStoringModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseAbpBlobStoring();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextBlobStoringModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/LINGYUN/Abp/ElsaNext/BlobStoring/Localization/Resources");
});
}
}

39
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/BlobActivity.cs

@ -0,0 +1,39 @@
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using System.Threading.Tasks;
using Volo.Abp.BlobStoring;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Activities;
public abstract class BlobActivity : CodeActivity
{
[Input(Description = "Path of the blob.")]
public Input<string> Path { get; set; } = default!;
protected virtual IBlobContainer<ElsaBlobContainer> GetBlobContainer(ActivityExecutionContext context)
{
return context.GetRequiredService<IBlobContainer<ElsaBlobContainer>>();
}
protected async virtual ValueTask OnErrorCompletedAsync(ActivityCompletedContext context)
{
await context.TargetContext.CompleteActivityAsync();
}
}
public abstract class BlobActivity<TResult> : CodeActivity<TResult>
{
[Input(Description = "Path of the blob.")]
public Input<string> Path { get; set; } = default!;
protected virtual IBlobContainer<ElsaBlobContainer> GetBlobContainer(ActivityExecutionContext context)
{
return context.GetRequiredService<IBlobContainer<ElsaBlobContainer>>();
}
protected async virtual ValueTask OnErrorCompletedAsync(ActivityCompletedContext context)
{
await context.TargetContext.CompleteActivityAsync();
}
}

20
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/DeleteBlob.cs

@ -0,0 +1,20 @@
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Activities;
[Activity("Elsa", "BlobStoring", "Delete a blob.", Kind = ActivityKind.Task)]
public class DeleteBlob : BlobActivity<bool>
{
protected async override ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var cancellationToken = context.CancellationToken;
var path = Path.Get(context);
var blobContainer = GetBlobContainer(context);
var result = await blobContainer.DeleteAsync(path, cancellationToken);
Result.Set(context, result);
}
}

40
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/ReadBlob.cs

@ -0,0 +1,40 @@
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Microsoft.Extensions.Logging;
using System;
using System.IO;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Activities;
[Activity("Elsa", "BlobStoring", "Open a blob.", Kind = ActivityKind.Task)]
public class ReadBlob : BlobActivity<Stream>
{
[Port] public IActivity? Error { get; set; }
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var cancellationToken = context.CancellationToken;
var path = Path.Get(context);
var blobContainer = GetBlobContainer(context);
var logger = context.GetRequiredService<ILogger<ReadBlob>>();
try
{
var data = await blobContainer.GetAsync(path, cancellationToken);
Result.Set(context, data);
await context.CompleteActivityAsync();
}
catch (Exception e)
{
logger.LogWarning(e, "Error while open a blob.");
context.AddExecutionLogEntry("Error", e.Message, payload: new
{
e.StackTrace
});
await context.ScheduleActivityAsync(Error, OnErrorCompletedAsync);
}
}
}

99
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Activities/SaveBlob.cs

@ -0,0 +1,99 @@
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Collections;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.BlobStoring;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Activities;
[Activity("Elsa", "BlobStoring", "Save a blob.", Kind = ActivityKind.Task)]
public class SaveBlob : BlobActivity
{
[Input(Description = "Blob exists whether overwrite.")]
public Input<bool> Overwrite { get; set; } = null!;
[Input(Description = "The file data to save. This can be a stream, binary data, a string, a form file or a collection of files.")]
public Input<object> Data { get; set; } = null!;
[Port] public IActivity? Error { get; set; }
protected async override ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var cancellationToken = context.CancellationToken;
var data = await ResolveAsStreamAsync(Data.Get(context), cancellationToken);
var overwrite = Overwrite.GetOrDefault(context);
var path = Path.Get(context);
var blobContainer = GetBlobContainer(context);
var logger = context.GetRequiredService<ILogger<SaveBlob>>();
try
{
await blobContainer.SaveAsync(path, data, overwrite, cancellationToken);
await context.CompleteActivityAsync();
}
catch (Exception e)
{
logger.LogWarning(e, "Error while save a blob.");
context.AddExecutionLogEntry("Error", e.Message, payload: new
{
e.StackTrace
});
await context.ScheduleActivityAsync(Error, OnErrorCompletedAsync);
}
}
private async Task<Stream> ResolveAsStreamAsync(object data, CancellationToken cancellationToken)
{
if (data is Stream stream)
return stream;
if (data is byte[] bytes)
return new MemoryStream(bytes);
if (data is IFormFile formFile)
return formFile.OpenReadStream();
if (data is string stringData)
return new MemoryStream(Encoding.UTF8.GetBytes(stringData));
if (data is IEnumerable enumerable)
{
var files = enumerable.Cast<object>().ToList();
return files.Count == 1 ? await ResolveAsStreamAsync(files[0], cancellationToken) : await CreateZipArchiveAsync(files, cancellationToken);
}
throw new NotSupportedException($"The provided data type is not supported: {data.GetType().Name}");
}
private async Task<Stream> CreateZipArchiveAsync(IEnumerable files, CancellationToken cancellationToken = default)
{
var currentFileIndex = 0;
var zipStream = new MemoryStream();
var zipArchive = new ZipArchive(zipStream, ZipArchiveMode.Create, true);
foreach (var file in files)
{
var entryName = $"file-{currentFileIndex}.bin";
var entry = zipArchive.CreateEntry(entryName);
var fileStream = await ResolveAsStreamAsync(file, cancellationToken);
await using var entryStream = entry.Open();
await fileStream.CopyToAsync(entryStream, cancellationToken);
await entryStream.FlushAsync(cancellationToken);
entryStream.Close();
currentFileIndex++;
}
zipStream.Seek(0, SeekOrigin.Begin);
return zipStream;
}
}

8
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/ElsaBlobContainer.cs

@ -0,0 +1,8 @@
using Volo.Abp.BlobStoring;
namespace LINGYUN.Abp.ElsaNext.BlobStoring;
[BlobContainerName("workflow")]
public class ElsaBlobContainer
{
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Extensions/ModuleExtensions.cs

@ -0,0 +1,14 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.BlobStoring.Features;
using System;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Extensions;
public static class ModuleExtensions
{
public static IModule UseAbpBlobStoring(this IModule configuration, Action<BlobStoringFeature>? configure = null)
{
configuration.Configure(configure);
return configuration;
}
}

17
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Features/BlobStoringFeature.cs

@ -0,0 +1,17 @@
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
namespace LINGYUN.Abp.ElsaNext.BlobStoring.Features;
public class BlobStoringFeature : FeatureBase
{
public BlobStoringFeature(IModule module) : base(module)
{
}
public override void Configure()
{
Module.AddActivitiesFrom<BlobStoringFeature>();
}
}

12
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Localization/Resources/en.json

@ -0,0 +1,12 @@
{
"culture": "en",
"texts": {
"Path of the blob.": "Path of the blob.",
"Blob exists whether overwrite.": "Blob exists whether overwrite.",
"The file data to save. This can be a stream, binary data, a string, a form file or a collection of files.": "The file data to save. This can be a stream, binary data, a string, a form file or a collection of files.",
"BlobStoring": "Blob Storing",
"Delete Blob": "Delete a blob.",
"Read Blob.": "Read a blob.",
"Save Blob.": "Save a blob."
}
}

12
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.BlobStoring/LINGYUN/Abp/ElsaNext/BlobStoring/Localization/Resources/zh-Hans.json

@ -0,0 +1,12 @@
{
"culture": "zh-Hans",
"texts": {
"Path of the blob.": "文件存储路径。",
"Blob exists whether overwrite.": "覆盖已有文件。",
"The file data to save. This can be a stream, binary data, a string, a form file or a collection of files.": "要保存的文件数据。可以是流、二进制数据、字符串、表单文件或一组文件。",
"BlobStoring": "对象存储",
"Delete Blob": "删除文件",
"Read Blob": "打开文件",
"Save Blob": "保存文件"
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

29
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN.Abp.ElsaNext.Email.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Email</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Email</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<Content Remove="LINGYUN\Abp\ElsaNext\Email\Localization\Resources\**\*.json" />
<EmbeddedResource Include="LINGYUN\Abp\ElsaNext\Email\Localization\Resources\**\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Emailing" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

38
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/AbpElsaNextEmailModule.cs

@ -0,0 +1,38 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.Email.Extensions;
using LINGYUN.Abp.ElsaNext.Localization;
using Volo.Abp.Emailing;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ElsaNext.Email;
[DependsOn(
typeof(AbpEmailingModule),
typeof(AbpElsaNextModule))]
public class AbpElsaNextEmailModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseAbpEmail();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextEmailModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/LINGYUN/Abp/ElsaNext/Email/Localization/Resources");
});
}
}

274
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Activities/SendEmail.cs

@ -0,0 +1,274 @@
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using Elsa.Workflows.UIHints;
using LINGYUN.Abp.ElsaNext.Email.Contracts;
using Microsoft.Extensions.Logging;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.IO;
using System.Net.Mail;
using System.Net.Mime;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Emailing;
using Volo.Abp.Json;
namespace LINGYUN.Abp.ElsaNext.Email.Activities;
[Activity("Elsa", "Email", "Send an email message.", Kind = ActivityKind.Task)]
public class SendEmail : Activity
{
/// <summary>
/// The sender's email address.
/// </summary>
[Input(Description = "The sender's email address.")]
public Input<string?> From { get; set; } = null!;
/// <summary>
/// The recipients email addresses.
/// </summary>
[Input(Description = "The recipients email addresses.", UIHint = InputUIHints.MultiText)]
public Input<ICollection<string>> To { get; set; } = null!;
/// <summary>
/// The CC recipient email addresses.
/// </summary>
[Input(
Description = "The CC recipient email addresses.",
UIHint = InputUIHints.MultiText,
Category = "More")]
public Input<ICollection<string>> Cc { get; set; } = null!;
/// <summary>
/// The BCC recipients email addresses.
/// </summary>
[Input(
Description = "The BCC recipients email addresses.",
UIHint = InputUIHints.MultiText,
Category = "More")]
public Input<ICollection<string>> Bcc { get; set; } = null!;
/// <summary>
/// The subject of the email message.
/// </summary>
[Input(Description = "The subject of the email message.")]
public Input<string?> Subject { get; set; } = null!;
/// <summary>
/// The attachments to send with the email message.
/// </summary>
[Input(
Description = "The attachments to send with the email message. Can be (an array of) a fully-qualified file path, URL, stream, byte array or instances of EmailAttachment.",
UIHint = InputUIHints.MultiLine
)]
public Input<object?> Attachments { get; set; } = null!;
/// <summary>
/// The body of the email message.
/// </summary>
[Input(
Description = "The body of the email message.",
UIHint = InputUIHints.MultiLine
)]
public Input<string> Body { get; set; } = null!;
/// <summary>
/// The activity to execute when an error occurs while trying to send the email.
/// </summary>
[Port] public IActivity? Error { get; set; }
/// <inheritdoc />
protected override async ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var cancellationToken = context.CancellationToken;
var message = new MailMessage();
var from = From.GetOrDefault(context);
if (MailAddress.TryCreate(from, out var fromAddress))
{
message.Sender = fromAddress;
message.From = fromAddress;
}
message.Subject = Subject.GetOrDefault(context) ?? "";
await AddAttachmentsAsync(context, message, cancellationToken);
message.Body = Body.GetOrDefault(context);
SetRecipientsEmailAddresses(message.To, GetAddresses(context, To));
SetRecipientsEmailAddresses(message.CC, GetAddresses(context, Cc));
SetRecipientsEmailAddresses(message.Bcc, GetAddresses(context, Bcc));
var emailSender = context.GetRequiredService<IEmailSender>();
var logger = context.GetRequiredService<ILogger<SendEmail>>();
try
{
await emailSender.SendAsync(message);
await context.CompleteActivityAsync();
}
catch (Exception e)
{
logger.LogWarning(e, "Error while sending email message");
context.AddExecutionLogEntry("Error", e.Message, payload: new
{
e.StackTrace
});
await context.ScheduleActivityAsync(Error, OnErrorCompletedAsync);
}
}
private async ValueTask OnErrorCompletedAsync(ActivityCompletedContext context) => await context.TargetContext.CompleteActivityAsync();
private static ICollection<string> GetAddresses(ActivityExecutionContext context, Input<ICollection<string>> input)
{
return input.GetOrDefault(context) ?? new List<string>(0);
}
private async Task AddAttachmentsAsync(ActivityExecutionContext context, MailMessage mailMessage, CancellationToken cancellationToken)
{
var attachments = Attachments.GetOrDefault(context);
if (attachments == null || attachments is string s && string.IsNullOrWhiteSpace(s))
{
return;
}
var index = 0;
var attachmentObjects = InterpretAttachmentsModel(attachments);
foreach (var attachmentObject in attachmentObjects)
{
switch (attachmentObject)
{
case Uri url:
await AttachOnlineFileAsync(context, mailMessage, url, cancellationToken);
break;
case string path when path?.Contains("://") == true:
await AttachOnlineFileAsync(context, mailMessage, new Uri(path), cancellationToken);
break;
case string path when !string.IsNullOrWhiteSpace(path):
AttachLocalFile(mailMessage, path);
break;
case byte[] bytes:
{
var fileName = $"Attachment-{++index}";
var byteStream = new MemoryStream(bytes.Length);
await byteStream.WriteAsync(bytes, cancellationToken);
mailMessage.Attachments.Add(new Attachment(byteStream, new ContentType { Name = fileName }));
break;
}
case Stream stream:
{
var fileName = $"Attachment-{++index}";
mailMessage.Attachments.Add(new Attachment(stream, new ContentType { Name = fileName }));
break;
}
case Attachment attachment:
{
attachment.Name ??= $"Attachment-{++index}";
mailMessage.Attachments.Add(attachment);
break;
}
case EmailAttachment emailAttachment when emailAttachment.File != null:
{
var fileName = emailAttachment.Name ?? $"Attachment-{++index}";
var emailAttachmentStream = new MemoryStream(emailAttachment.File.Length);
await emailAttachmentStream.WriteAsync(emailAttachment.File, cancellationToken);
mailMessage.Attachments.Add(new Attachment(emailAttachmentStream, new ContentType { Name = fileName }));
break;
}
case ExpandoObject expandoObject:
{
var dictionary = new Dictionary<string, object>(expandoObject!, StringComparer.OrdinalIgnoreCase);
var fileName = dictionary.GetValue<string>("FileName") ?? $"Attachment-{++index}";
var contentType = dictionary.GetValue<string>("ContentType") ?? "application/octet-stream";
var parsedContentType = new ContentType(contentType);
var content = dictionary.GetValue<object>("Content");
if (content is byte[] bytes)
{
var byteStream = new MemoryStream(bytes.Length);
await byteStream.WriteAsync(bytes, cancellationToken);
mailMessage.Attachments.Add(new Attachment(byteStream, new ContentType { Name = fileName }));
}
else if (content is Stream stream)
{
mailMessage.Attachments.Add(new Attachment(stream, new ContentType { Name = fileName }));
}
break;
}
default:
{
var jsonSerializer = context.GetRequiredService<IJsonSerializer>();
var json = jsonSerializer.Serialize(attachmentObject);
var fileName = $"Attachment-{++index}";
var jsonBytes = Encoding.UTF8.GetBytes(json);
var byteStream = new MemoryStream(jsonBytes.Length);
await byteStream.WriteAsync(jsonBytes, cancellationToken);
mailMessage.Attachments.Add(new Attachment(byteStream, new ContentType { Name = fileName }));
break;
}
}
}
}
private static void AttachLocalFile(MailMessage mailMessage, string path)
{
var stream = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read);
mailMessage.Attachments.Add(new Attachment(stream, new ContentType{ Name = Path.GetFileName(path) }));
}
private async static Task AttachOnlineFileAsync(ActivityExecutionContext context, MailMessage mailMessage, Uri url, CancellationToken cancellationToken)
{
var fileName = Path.GetFileName(url.LocalPath);
var downloader = context.GetRequiredService<IDownloader>();
var response = await downloader.DownloadAsync(url, cancellationToken);
var contentStream = await response.Content.ReadAsStreamAsync(cancellationToken);
var contentType = response.Content.Headers.ContentType?.MediaType ?? "application/binary";
mailMessage.Attachments.Add(new Attachment(contentStream, new ContentType(contentType) { Name = fileName }));
}
private static IEnumerable InterpretAttachmentsModel(object attachments)
{
if (attachments is byte[] bytes)
{
return new[]
{
bytes
};
}
return attachments is string text
? new[]
{
text
}
: attachments as IEnumerable ?? new[]
{
attachments
};
}
private static void SetRecipientsEmailAddresses(MailAddressCollection list, IEnumerable<string>? addresses)
{
if (addresses == null)
{
return;
}
foreach (var addresse in addresses)
{
if (MailAddress.TryCreate(addresse, out var mailAddress))
{
list.Add(mailAddress);
}
}
}
}

16
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Contracts/IDownloader.cs

@ -0,0 +1,16 @@
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.Email.Contracts;
/// <summary>
/// Download files from the Internet.
/// </summary>
public interface IDownloader
{
/// <summary>
/// Download whatever is returned at the specified URL.
/// </summary>
Task<HttpResponseMessage> DownloadAsync(Uri url, CancellationToken cancellationToken = default);
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Extensions/ModuleExtensions.cs

@ -0,0 +1,14 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.Email.Features;
using System;
namespace LINGYUN.Abp.ElsaNext.Email.Extensions;
public static class ModuleExtensions
{
public static IModule UseAbpEmail(this IModule configuration, Action<EmailFeature>? configure = null)
{
configuration.Configure(configure);
return configuration;
}
}

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Features/EmailFeature.cs

@ -0,0 +1,30 @@
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.Email.Contracts;
using LINGYUN.Abp.ElsaNext.Email.Services;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Net.Http;
namespace LINGYUN.Abp.ElsaNext.Email.Features;
public class EmailFeature : FeatureBase
{
public Action<IServiceProvider, HttpClient> ConfigureDownloaderHttpClient { get; set; } = (_, _) => { };
public EmailFeature(IModule module) : base(module)
{
}
public override void Configure()
{
Module.AddActivitiesFrom<EmailFeature>();
}
public override void Apply()
{
Services
.AddHttpClient<IDownloader, DefaultDownloader>(ConfigureDownloaderHttpClient);
}
}

12
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Localization/Resources/en.json

@ -0,0 +1,12 @@
{
"culture": "en",
"texts": {
"The sender's email address.": "The sender's email address.",
"The recipients email addresses.": "The recipients email addresses.",
"The CC recipient email addresses.": "The CC recipient email addresses.",
"The BCC recipients email addresses.": "The BCC recipients email addresses.",
"The subject of the email message.": "The subject of the email message.",
"The attachments to send with the email message. Can be (an array of) a fully-qualified file path, URL, stream, byte array or instances of EmailAttachment.": "The attachments to send with the email message. Can be (an array of) a fully-qualified file path, URL, stream, byte array or instances of EmailAttachment.",
"The body of the email message.": "The body of the email message."
}
}

12
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Localization/Resources/zh-Hans.json

@ -0,0 +1,12 @@
{
"culture": "zh-Hans",
"texts": {
"The sender's email address.": "发件人的电子邮件地址。",
"The recipients email addresses.": "收件人的电子邮件地址。",
"The CC recipient email addresses.": "CC收件人电子邮件地址。",
"The BCC recipients email addresses.": "BCC收件人邮箱地址。",
"The subject of the email message.": "邮件主题。",
"The attachments to send with the email message. Can be (an array of) a fully-qualified file path, URL, stream, byte array or instances of EmailAttachment.": "随邮件发送的附件。可以是(一个数组)完全限定的文件路径、URL、流、字节数组,或 EmailAttachment 类的实例。",
"The body of the email message.": "邮件正文。"
}
}

28
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Email/LINGYUN/Abp/ElsaNext/Email/Services/DefaultDownloader.cs

@ -0,0 +1,28 @@
using LINGYUN.Abp.ElsaNext.Email.Contracts;
using System;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.Email.Services;
/// <summary>
/// Download files from the Internet.
/// </summary>
public class DefaultDownloader : IDownloader
{
private readonly HttpClient _httpClient;
/// <summary>
/// Constructor.
/// </summary>
public DefaultDownloader(HttpClient httpClient)
{
_httpClient = httpClient;
}
/// <summary>
/// Download whatever is returned at the specified URL.
/// </summary>
public async Task<HttpResponseMessage> DownloadAsync(Uri url, CancellationToken cancellationToken = default) => await _httpClient.GetAsync(url, cancellationToken);
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

25
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/LINGYUN.Abp.ElsaNext.EntityFrameworkCore.csproj

@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.EntityFrameworkCore</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.EntityFrameworkCore</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Persistence.EFCore" VersionOverride="$(ElsaNextPackageVersion)" />
<PackageReference Include="Volo.Abp.EntityFrameworkCore" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

57
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.EntityFrameworkCore/LINGYUN/Abp/ElsaNext/EntityFrameworkCore/AbpElsaNextEntityFrameworkCoreModule.cs

@ -0,0 +1,57 @@
using Elsa.Alterations.Extensions;
using Elsa.Extensions;
using Elsa.Features.Services;
using Elsa.Persistence.EFCore.Modules.Alterations;
using Elsa.Persistence.EFCore.Modules.Identity;
using Elsa.Persistence.EFCore.Modules.Labels;
using Elsa.Persistence.EFCore.Modules.Management;
using Elsa.Persistence.EFCore.Modules.Runtime;
using Elsa.Persistence.EFCore.Modules.Tenants;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.ElsaNext.EntityFrameworkCore;
[DependsOn(typeof(AbpElsaNextModule))]
public class AbpElsaNextEntityFrameworkCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var labelFeature = context.Services.GetPreConfigureActions<EFCoreLabelPersistenceFeature>();
var alterationsFeature = context.Services.GetPreConfigureActions<EFCoreAlterationsPersistenceFeature>();
var workflowManagementFeature = context.Services.GetPreConfigureActions<WorkflowManagementPersistenceFeature>();
var workflowRuntimeFeature = context.Services.GetPreConfigureActions<EFCoreWorkflowRuntimePersistenceFeature>();
PreConfigure<IModule>(elsa =>
{
elsa.UseLabels(label =>
{
label.UseEntityFrameworkCore(efCore =>
{
labelFeature.Configure(efCore);
});
});
elsa.UseAlterations(alterations =>
{
alterations.UseEntityFrameworkCore(efCore =>
{
alterationsFeature.Configure(efCore);
});
});
elsa.UseWorkflowManagement(management =>
{
management.UseEntityFrameworkCore(efCore =>
{
workflowManagementFeature.Configure(efCore);
});
});
elsa.UseWorkflowRuntime(runtime =>
{
runtime.UseEntityFrameworkCore(efCore =>
{
workflowRuntimeFeature.Configure(efCore);
});
});
});
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

24
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN.Abp.ElsaNext.Labels.csproj

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Labels</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Labels</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Elsa.Labels" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

17
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Labels/LINGYUN/Abp/ElsaNext/Labels/AbpElsaNextLabelsModule.cs

@ -0,0 +1,17 @@
using Elsa.Extensions;
using Elsa.Features.Services;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.ElsaNext.Labels;
[DependsOn(typeof(AbpElsaNextModule))]
public class AbpElsaNextLabelsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseLabels();
});
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

26
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN.Abp.ElsaNext.Notifications.csproj

@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Notifications</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Notifications</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<Content Remove="LINGYUN\Abp\ElsaNext\Notifications\Localization\**\*.json" />
<EmbeddedResource Include="LINGYUN\Abp\ElsaNext\Notifications\Localization\**\*.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\realtime-notifications\LINGYUN.Abp.Notifications\LINGYUN.Abp.Notifications.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext\LINGYUN.Abp.ElsaNext.csproj" />
</ItemGroup>
</Project>

41
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/AbpElsaNextNotificationsModule.cs

@ -0,0 +1,41 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.Localization;
using LINGYUN.Abp.ElsaNext.Notifications.Extensions;
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ElsaNext.Notifications;
[DependsOn(
typeof(AbpNotificationsModule),
typeof(AbpElsaNextModule))]
public class AbpElsaNextNotificationsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<IModule>(elsa =>
{
elsa.UseAbpNotifications();
});
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextNotificationsModule>();
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/LINGYUN/Abp/ElsaNext/Notifications/Localization/Resources");
});
context.Services.AddNotificationHandlersFrom<AbpElsaNextNotificationsModule>();
}
}

136
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Activities/SendNotification.cs

@ -0,0 +1,136 @@
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Attributes;
using Elsa.Workflows.Models;
using Elsa.Workflows.UIHints;
using LINGYUN.Abp.ElsaNext.Notifications.UIHints;
using LINGYUN.Abp.ElsaNext.UIHints;
using LINGYUN.Abp.Notifications;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Timing;
using INotificationSender = LINGYUN.Abp.Notifications.INotificationSender;
namespace LINGYUN.Abp.ElsaNext.Notifications.Activities;
[Activity("Elsa", "Notifications", "Send an notification.", Kind = ActivityKind.Task)]
public class SendNotification : CodeActivity
{
[Input(
Description = "The name of the registered notification.",
UIHint = NotificationsUIHints.NotificationPicker)]
public Input<string> NotificationName { get; set; } = default!;
[Input(
Description = "The notification title.",
UIHint = InputUIHints.MultiLine
)]
public Input<string?> Title { get; set; } = default!;
[Input(
Description = "The notification content.",
UIHint = InputUIHints.MultiLine
)]
public Input<string?> Content { get; set; } = default!;
[Input(
Description = "The notification description.",
UIHint = InputUIHints.MultiLine
)]
public Input<string?> Description { get; set; } = default!;
[Input(
Description = "The notification template name.",
UIHint = InputUIHints.MultiLine
)]
public Input<string?> Template { get; set; } = default!;
[Input(
Description = "The notification additional attributes.",
UIHint = InputUIHints.Dictionary
)]
public Input<Dictionary<string, object?>> Propertites { get; set; } = default!;
[Input(
Description = "The tenant id for sending the notification.",
UIHint = AbpElsaUIHints.TenantPicker)]
public Input<Guid?> TenantId { get; set; } = null!;
[Input(
Description = "The recipients email addresses.",
UIHint = AbpElsaUIHints.UserPickerMultiple)]
public Input<ICollection<Guid>> To { get; set; } = null!;
[Input(
Description = "The notifications severity.",
Options = new[] { "Success", "Info", "Warn", "Error", "Fatal" },
DefaultValue = "Info",
UIHint = InputUIHints.DropDown)]
public Input<string?> Severity { get; set; } = null!;
[Output(Description = "The notification id.")]
public Output<string?> NotificationId { get; set; } = null!;
protected async override ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var notificationSender = context.GetRequiredService<INotificationSender>();
var currentTenant = context.GetRequiredService<ICurrentTenant>();
var clock = context.GetRequiredService<IClock>();
var tenantId = TenantId.GetOrDefault(context, () => currentTenant.Id);
var userIdentifiers = GetUserIdentifiers(context);
var severity = GetNotificationSeverity(context);
var propertites = Propertites.GetOrDefault(context);
var notificationName = NotificationName.Get(context);
var template = Template.GetOrDefault(context);
if (!string.IsNullOrWhiteSpace(template))
{
var notificationTemplate = new NotificationTemplate(template, data: propertites);
var notificationTemplateId = await notificationSender.SendNofiterAsync(
notificationName,
notificationTemplate,
userIdentifiers,
tenantId,
severity);
NotificationId.Set(context, notificationTemplateId);
}
else
{
var title = Title.Get(context);
var message = Content.Get(context);
var description = Description.GetOrDefault(context) ?? "";
var notificationData = new NotificationData();
notificationData.WriteStandardData(title!, message!, clock.Now, "elsa-workflow", description);
var notificationId = await notificationSender.SendNofiterAsync(
notificationName,
notificationData,
userIdentifiers,
tenantId,
severity);
NotificationId.Set(context, notificationId);
}
}
private NotificationSeverity GetNotificationSeverity(ActivityExecutionContext context)
{
var severitySet = Severity.GetOrDefault(context);
if (!string.IsNullOrWhiteSpace(severitySet))
{
if (Enum.TryParse<NotificationSeverity>(severitySet, true, out var severity))
{
return severity;
}
}
return NotificationSeverity.Info;
}
private IEnumerable<UserIdentifier>? GetUserIdentifiers(ActivityExecutionContext context)
{
var userIdentifiers = To.GetOrDefault(context);
return userIdentifiers?.Select(to => new UserIdentifier(to, to.ToString()));
}
}

14
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Extensions/ModuleExtensions.cs

@ -0,0 +1,14 @@
using Elsa.Features.Services;
using LINGYUN.Abp.ElsaNext.Notifications.Features;
using System;
namespace LINGYUN.Abp.ElsaNext.Notifications.Extensions;
public static class ModuleExtensions
{
public static IModule UseAbpNotifications(this IModule configuration, Action<NotificationsFeature>? configure = null)
{
configuration.Configure(configure);
return configuration;
}
}

17
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Features/NotificationsFeature.cs

@ -0,0 +1,17 @@
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
namespace LINGYUN.Abp.ElsaNext.Notifications.Features;
public class NotificationsFeature : FeatureBase
{
public NotificationsFeature(IModule module) : base(module)
{
}
public override void Configure()
{
Module.AddActivitiesFrom<NotificationsFeature>();
}
}

42
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Handlers/ActivityNotificationHandler.cs

@ -0,0 +1,42 @@
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Notifications;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.Notifications.Handlers;
public class ActivityNotificationHandler :
INotificationHandler<ActivityExecuting>,
INotificationHandler<ActivityExecuted>,
INotificationHandler<ActivityCancelled>,
INotificationHandler<ActivityCompleted>
{
public ILogger<ActivityNotificationHandler> Logger { protected get; set; }
public ActivityNotificationHandler()
{
Logger = NullLogger<ActivityNotificationHandler>.Instance;
}
public async virtual Task HandleAsync(ActivityExecuting notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(ActivityExecuted notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(ActivityCancelled notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(ActivityCompleted notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The activity notification: {notification} has been triggered.", notification.ToString());
}
}

53
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Handlers/WorkflowNotificationHandler.cs

@ -0,0 +1,53 @@
using Elsa.Mediator.Contracts;
using Elsa.Workflows.Notifications;
using Elsa.Workflows.Runtime.Notifications;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.ElsaNext.Notifications.Handlers;
public class WorkflowNotificationHandler :
INotificationHandler<WorkflowExecuting>,
INotificationHandler<WorkflowStarted>,
INotificationHandler<WorkflowFinished>,
INotificationHandler<WorkflowExecuted>,
INotificationHandler<WorkflowCancelling>,
INotificationHandler<WorkflowCancelled>
{
public ILogger<WorkflowNotificationHandler> Logger { protected get; set; }
public WorkflowNotificationHandler()
{
Logger = NullLogger<WorkflowNotificationHandler>.Instance;
}
public async virtual Task HandleAsync(WorkflowExecuting notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(WorkflowStarted notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(WorkflowFinished notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(WorkflowExecuted notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(WorkflowCancelling notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
public async virtual Task HandleAsync(WorkflowCancelled notification, CancellationToken cancellationToken)
{
Logger.LogDebug("The workflow notification: {notification} has been triggered.", notification.ToString());
}
}

18
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Localization/Resources/en.json

@ -0,0 +1,18 @@
{
"culture": "en",
"texts": {
"Notifications": "Notifications",
"Send Notification": "Send Notification",
"Send an notification.": "Send an notification.",
"The name of the registered notification.": "The name of the registered notification.",
"The notification title.": "The notification title.",
"The notification content.": "The notification content.",
"The notification description.": "The notification description.",
"The notification template name.": "The notification template name.",
"The notification additional attributes.": "The notification additional attributes.",
"The tenant id for sending the notification.": "The tenant id for sending the notification.",
"The recipients email addresses.": "The recipients email addresses.",
"The notifications severity.": "The notifications severity.",
"The notification id.": "The notification id."
}
}

18
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/Localization/Resources/zh-Hans.json

@ -0,0 +1,18 @@
{
"culture": "zh-Hans",
"texts": {
"Notifications": "消息通知",
"Send Notification": "发送通知",
"Send an notification.": "发送通知。",
"The name of the registered notification.": "已注册的通知名称。",
"The notification title.": "通知标题。",
"The notification content.": "通知内容。",
"The notification description.": "通知描述。",
"The notification template name.": "通知模板,使用模板消息时标题、内容、描述内容无效。",
"The notification additional attributes.": "通知属性。",
"The tenant id for sending the notification.": "将要发送通知的租户Id。",
"The recipients email addresses.": "接收通知的用户Id集合。",
"The notifications severity.": "通知严重程度。",
"The notification id.": "通知Id。"
}
}

6
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Notifications/LINGYUN/Abp/ElsaNext/Notifications/UIHints/NotificationsUIHints.cs

@ -0,0 +1,6 @@
namespace LINGYUN.Abp.ElsaNext.Notifications.UIHints;
public static class NotificationsUIHints
{
public const string NotificationPicker = "notification-picker";
}

49
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/AbpElsaNextSecretsBlazorModule.cs

@ -0,0 +1,49 @@
using Elsa.Studio.Secrets.Extensions;
using LINGYUN.Abp.ElsaNext.Localization;
using LINGYUN.Abp.ElsaNext.Secrets.Blazor.Navigation;
using LINGYUN.Abp.ElsaNext.Studio.Blazor;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.AspNetCore.Components.Web.Theming.MudBlazor.Routing;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation;
using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.ElsaNext.Secrets.Blazor;
[DependsOn(
typeof(AbpElsaNextSecretsModule),
typeof(AbpElsaNextStudioBlazorModule))]
public class AbpElsaNextSecretsBlazorModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Configuration.GetSection("Elsa:Studio");
Configure<AbpRouterOptions>(options =>
{
options.AdditionalAssemblies.Add(typeof(Elsa.Studio.Secrets.Feature).Assembly);
});
Configure<AbpNavigationOptions>(options =>
{
options.MenuContributors.Add(new ElsaStudioSecretsMenuContributor());
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpElsaNextSecretsBlazorModule>("LINGYUN.Abp.ElsaNext.Secrets.Blazor");
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<ElsaNextResource>()
.AddVirtualJson("/Localization/Resources/SecretsBlazor");
});
var elsaNextStudioBlazoeOptions = context.Services.ExecutePreConfiguredActions<AbpElsaNextStudioBlazorOptions>();
context.Services.AddSecretsModule(elsaNextStudioBlazoeOptions.BackendApiConfig);
}
}

3
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

29
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/LINGYUN.Abp.ElsaNext.Secrets.Blazor.csproj

@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Razor">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<AssemblyName>LINGYUN.Abp.ElsaNext.Secrets.Blazor</AssemblyName>
<PackageId>LINGYUN.Abp.ElsaNext.Secrets.Blazor</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<Content Remove="Localization\Resources\SecretsBlazor\*.json" />
<EmbeddedResource Include="Localization\Resources\SecretsBlazor\*.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Elsa.Studio.Secrets" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Secrets\LINGYUN.Abp.ElsaNext.Secrets.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.ElsaNext.Studio.Blazor\LINGYUN.Abp.ElsaNext.Studio.Blazor.csproj" />
</ItemGroup>
</Project>

7
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Localization/Resources/SecretsBlazor/en.json

@ -0,0 +1,7 @@
{
"culture": "en",
"texts": {
"Menu:Secrets": "Secrets",
"Secrets": "Secrets"
}
}

7
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Localization/Resources/SecretsBlazor/zh-Hans.json

@ -0,0 +1,7 @@
{
"culture": "zh-Hans",
"texts": {
"Menu:Secrets": "机密",
"Secrets": "机密"
}
}

28
aspnet-core/modules/elsa/LINGYUN.Abp.ElsaNext.Secrets.Blazor/Navigation/ElsaStudioSecretsMenuContributor.cs

@ -0,0 +1,28 @@
using LINGYUN.Abp.ElsaNext.Localization;
using LINGYUN.Abp.ElsaNext.Studio.Blazor.Navigation;
using System.Threading.Tasks;
using Volo.Abp.UI.Navigation;
namespace LINGYUN.Abp.ElsaNext.Secrets.Blazor.Navigation;
public class ElsaStudioSecretsMenuContributor : IMenuContributor
{
public Task ConfigureMenuAsync(MenuConfigurationContext context)
{
if (context.Menu.Name == StandardMenus.Main)
{
var menu = context.Menu;
var l = context.GetLocalizer<ElsaNextResource>();
var group = menu.GetMenuItemOrNull(ElsaStudioMenus.GroupName);
group?.AddItem(new ApplicationMenuItem(
ElsaStudioMenus.GroupName + ".Secrets",
l["Menu:Secrets"],
url: "/security/secrets",
icon: "fa fa-key",
order: 6));
}
return Task.CompletedTask;
}
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save