Compare commits
25 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2b2e12f264 | ||
![]() |
17ee580d85 | ||
![]() |
fb383e2c3c | ||
![]() |
76b34bc154 | ||
![]() |
6fd0364356 | ||
![]() |
6bfc2dd266 | ||
![]() |
03ee5dadb0 | ||
![]() |
233268c5e3 | ||
![]() |
089c238126 | ||
![]() |
99fd092b24 | ||
![]() |
1e9fb7d195 | ||
![]() |
66cd518872 | ||
![]() |
b7ae3cf42e | ||
![]() |
311a886830 | ||
![]() |
3c584c3a95 | ||
![]() |
8a4066a40e | ||
![]() |
35fa68cffc | ||
![]() |
8ea53827f5 | ||
![]() |
1d63f2c585 | ||
![]() |
b0bbd40621 | ||
![]() |
5ea5c57450 | ||
![]() |
d108d99e32 | ||
![]() |
a827c8965e | ||
![]() |
88235bb283 | ||
![]() |
3c9c7531c0 |
@ -1,37 +1,44 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
# Visual Studio Version 16
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 16.0.30330.147
|
VisualStudioVersion = 17.1.31903.286
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{929BB2D7-C678-4BE8-8AA9-F271A2AE4545}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{929BB2D7-C678-4BE8-8AA9-F271A2AE4545}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IGeekFan.AspNetCore.Knife4jUI", "src\IGeekFan.AspNetCore.SwaggerUI\IGeekFan.AspNetCore.Knife4jUI.csproj", "{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22}"
|
|
||||||
EndProject
|
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{75C51574-4CBD-403B-8182-8BF2A6DCFD43}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{75C51574-4CBD-403B-8182-8BF2A6DCFD43}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic", "test\Basic\Basic.csproj", "{88972F96-96D7-40A7-90DA-ED04C9ED9B33}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Basic", "test\Basic\Basic.csproj", "{88972F96-96D7-40A7-90DA-ED04C9ED9B33}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Docs", "Docs", "{98C9AB6E-7179-4594-9703-BB0BB6D7949C}"
|
|
||||||
ProjectSection(SolutionItems) = preProject
|
|
||||||
README.md = README.md
|
|
||||||
EndProjectSection
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Knife4jUIDemo", "test\Knife4jUIDemo\Knife4jUIDemo.csproj", "{86A24FA0-E85D-4BDD-97D7-B990C50A40A9}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Knife4jUIDemo", "test\Knife4jUIDemo\Knife4jUIDemo.csproj", "{86A24FA0-E85D-4BDD-97D7-B990C50A40A9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C146A419-15E0-4475-9623-706C5E2DCE0B}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{C146A419-15E0-4475-9623-706C5E2DCE0B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwaggerUI_IndexStream_Knife4jUI_Demo", "samples\SwaggerUI_IndexStream_Knife4jUI_Demo\SwaggerUI_IndexStream_Knife4jUI_Demo.csproj", "{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SwaggerUI_IndexStream_Knife4jUI_Demo", "samples\SwaggerUI_IndexStream_Knife4jUI_Demo\SwaggerUI_IndexStream_Knife4jUI_Demo.csproj", "{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IGeekFan.AspNetCore.Knife4jUI", "src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj", "{6C784918-BE29-4FEF-8AC3-9D34A38DE822}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WebSites", "WebSites", "{86851B6C-3504-4879-8464-1DB422D46BA0}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OAuth2Integration", "test\WebSites\OAuth2Integration\OAuth2Integration.csproj", "{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA}"
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NSwag.Swagger.Knife4jUI", "test\WebSites\NSwag.Swagger.Knife4jUI\NSwag.Swagger.Knife4jUI.csproj", "{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A08844CF-E477-4104-98CB-EB6417CB1B0C}"
|
||||||
|
ProjectSection(SolutionItems) = preProject
|
||||||
|
.gitattributes = .gitattributes
|
||||||
|
.gitignore = .gitignore
|
||||||
|
LICENSE = LICENSE
|
||||||
|
README.md = README.md
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore7Api", "samples\AspNetCoreApi\AspNetCore7Api.csproj", "{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
Debug|Any CPU = Debug|Any CPU
|
Debug|Any CPU = Debug|Any CPU
|
||||||
Release|Any CPU = Release|Any CPU
|
Release|Any CPU = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{88972F96-96D7-40A7-90DA-ED04C9ED9B33}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
@ -44,15 +51,35 @@ Global
|
|||||||
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Release|Any CPU.Build.0 = Release|Any CPU
|
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{6C784918-BE29-4FEF-8AC3-9D34A38DE822}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{6C784918-BE29-4FEF-8AC3-9D34A38DE822}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{6C784918-BE29-4FEF-8AC3-9D34A38DE822}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{6C784918-BE29-4FEF-8AC3-9D34A38DE822}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(NestedProjects) = preSolution
|
GlobalSection(NestedProjects) = preSolution
|
||||||
{4589D4A2-AAC0-40BD-8A8E-2EBB2B68DA22} = {929BB2D7-C678-4BE8-8AA9-F271A2AE4545}
|
|
||||||
{88972F96-96D7-40A7-90DA-ED04C9ED9B33} = {75C51574-4CBD-403B-8182-8BF2A6DCFD43}
|
{88972F96-96D7-40A7-90DA-ED04C9ED9B33} = {75C51574-4CBD-403B-8182-8BF2A6DCFD43}
|
||||||
{86A24FA0-E85D-4BDD-97D7-B990C50A40A9} = {75C51574-4CBD-403B-8182-8BF2A6DCFD43}
|
{86A24FA0-E85D-4BDD-97D7-B990C50A40A9} = {75C51574-4CBD-403B-8182-8BF2A6DCFD43}
|
||||||
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4} = {C146A419-15E0-4475-9623-706C5E2DCE0B}
|
{1D6FD5CA-5D58-4895-8545-A93099CE1AD4} = {C146A419-15E0-4475-9623-706C5E2DCE0B}
|
||||||
|
{6C784918-BE29-4FEF-8AC3-9D34A38DE822} = {929BB2D7-C678-4BE8-8AA9-F271A2AE4545}
|
||||||
|
{86851B6C-3504-4879-8464-1DB422D46BA0} = {75C51574-4CBD-403B-8182-8BF2A6DCFD43}
|
||||||
|
{9E8D8F42-33F0-4F2D-9B56-1AB1B33DE1FA} = {86851B6C-3504-4879-8464-1DB422D46BA0}
|
||||||
|
{42B4C1C3-AE38-47C7-AAAA-FE0FDA7DADEB} = {86851B6C-3504-4879-8464-1DB422D46BA0}
|
||||||
|
{F576D6A1-D21C-4BBB-9461-8D7C6DBE5B61} = {C146A419-15E0-4475-9623-706C5E2DCE0B}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {9D77CCB4-F597-421B-9EF9-52D4B0AC382D}
|
SolutionGuid = {9D77CCB4-F597-421B-9EF9-52D4B0AC382D}
|
||||||
|
74
README.md
@ -6,8 +6,8 @@
|
|||||||
[](https://www.nuget.org/packages/IGeekFan.AspNetCore.Knife4jUI) [](https://www.nuget.org/stats/packages/IGeekFan.AspNetCore.Knife4jUI?groupby=Version) [](https://raw.githubusercontent.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI/master/LICENSE.txt)
|
[](https://www.nuget.org/packages/IGeekFan.AspNetCore.Knife4jUI) [](https://www.nuget.org/stats/packages/IGeekFan.AspNetCore.Knife4jUI?groupby=Version) [](https://raw.githubusercontent.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI/master/LICENSE.txt)
|
||||||
|
|
||||||
## 相关依赖项
|
## 相关依赖项
|
||||||
### [knife4j](https://gitee.com/xiaoym/knife4j)
|
### [knife4j](https://gitee.com/xiaoym/knife4j/tree/master/knife4j-vue)
|
||||||
- knife4j-vue-v3(不是vue3,而是swagger-ui-v3版本)
|
- knife4j-vue
|
||||||
### [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore)
|
### [Swashbuckle.AspNetCore](https://github.com/domaindrivendev/Swashbuckle.AspNetCore)
|
||||||
- Swashbuckle.AspNetCore.Swagger
|
- Swashbuckle.AspNetCore.Swagger
|
||||||
- Swashbuckle.AspNetCore.SwaggerGen
|
- Swashbuckle.AspNetCore.SwaggerGen
|
||||||
@ -20,17 +20,30 @@
|
|||||||
|
|
||||||
### 🚀安装包
|
### 🚀安装包
|
||||||
|
|
||||||
|
以下为使用Swashbuckle.AspNetCore.Swagger底层组件
|
||||||
|
|
||||||
1.Install the standard Nuget package into your ASP.NET Core application.
|
1.Install the standard Nuget package into your ASP.NET Core application.
|
||||||
|
|
||||||
```
|
```
|
||||||
Package Manager : Install-Package IGeekFan.AspNetCore.Knife4jUI
|
Package Manager :
|
||||||
CLI : dotnet add package IGeekFan.AspNetCore.Knife4jUI
|
|
||||||
|
Install-Package Swashbuckle.AspNetCore.Swagger
|
||||||
|
Install-Package Swashbuckle.AspNetCore.SwaggerGen
|
||||||
|
Install-Package IGeekFan.AspNetCore.Knife4jUI
|
||||||
|
|
||||||
|
OR
|
||||||
|
|
||||||
|
CLI :
|
||||||
|
|
||||||
|
dotnet add package Swashbuckle.AspNetCore.Swagger
|
||||||
|
dotnet add package Swashbuckle.AspNetCore.SwaggerGen
|
||||||
|
dotnet add package IGeekFan.AspNetCore.Knife4jUI
|
||||||
```
|
```
|
||||||
|
|
||||||
2.In the ConfigureServices method of Startup.cs, register the Swagger generator, defining one or more Swagger documents.
|
2.In the ConfigureServices method of Startup.cs, register the Swagger generator, defining one or more Swagger documents.
|
||||||
|
|
||||||
```
|
```
|
||||||
using System.Reflection;
|
using Microsoft.AspNetCore.Mvc.Controllers
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
using Swashbuckle.AspNetCore.SwaggerGen;
|
||||||
using IGeekFan.AspNetCore.Knife4jUI;
|
using IGeekFan.AspNetCore.Knife4jUI;
|
||||||
@ -49,7 +62,8 @@ using IGeekFan.AspNetCore.Knife4jUI;
|
|||||||
});
|
});
|
||||||
c.CustomOperationIds(apiDesc =>
|
c.CustomOperationIds(apiDesc =>
|
||||||
{
|
{
|
||||||
return apiDesc.TryGetMethodInfo(out MethodInfo methodInfo) ? methodInfo.Name : null;
|
var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
|
||||||
|
return controllerAction.ControllerName+"-"+controllerAction.ActionName;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
@ -72,11 +86,55 @@ app.UseEndpoints(endpoints =>
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
5.更多功能
|
||||||
|
|
||||||
|
为文档添加注释 在项目上右键--属性--生成
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
在AddSwaggerGen方法中添加如下代码
|
||||||
|
|
||||||
|
```
|
||||||
|
c.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, "SwaggerDemo.xml"),true);
|
||||||
|
```
|
||||||
|
最后一个参数设置为true,代表启用控制器上的注释
|
||||||
|
|
||||||
|
运行后如看不到控制器上注释显示,请点开文档管理->个性化设置,开启分组tag显示description说明属性
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### NSwag.AspNetCore
|
||||||
|
(请参考目录test/WebSites/NSwag.Swagger.Knife4jUI)
|
||||||
|
|
||||||
|
```
|
||||||
|
public void ConfigureServices(IServiceCollection services)
|
||||||
|
{
|
||||||
|
// 其它Service
|
||||||
|
services.AddOpenApiDocument();
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
|
||||||
|
{
|
||||||
|
// 其它 Use
|
||||||
|
app.UseOpenApi();
|
||||||
|
app.UseKnife4UI(c =>
|
||||||
|
{
|
||||||
|
c.RoutePrefix = "";
|
||||||
|
c.SwaggerEndpoint("/swagger/v1/swagger.json", "V1 Docs");
|
||||||
|
});
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
即可使用 Knife4jUI
|
||||||
|
|
||||||
### 🔎 效果图
|
### 🔎 效果图
|
||||||
运行项目,打开 https://localhost:5001/index.html#/home
|
运行项目,打开 https://localhost:5001/index.html#/home
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
### 更多配置请参考
|
### 更多配置请参考
|
||||||
@ -88,4 +146,4 @@ app.UseEndpoints(endpoints =>
|
|||||||
|
|
||||||
- [https://api.igeekfan.cn/swagger/index.html](https://api.igeekfan.cn/swagger/index.html)
|
- [https://api.igeekfan.cn/swagger/index.html](https://api.igeekfan.cn/swagger/index.html)
|
||||||
- [https://github.com/luoyunchong/lin-cms-dotnetcore](https://github.com/luoyunchong/lin-cms-dotnetcore)
|
- [https://github.com/luoyunchong/lin-cms-dotnetcore](https://github.com/luoyunchong/lin-cms-dotnetcore)
|
||||||

|

|
||||||
|
BIN
docs/home.jpg
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
docs/preview.jpg
Normal file
After Width: | Height: | Size: 125 KiB |
26
nuget/build-and-push.ps1
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
# 定义参数
|
||||||
|
Param(
|
||||||
|
# Nuget APIKey
|
||||||
|
[string] $apikey
|
||||||
|
)
|
||||||
|
|
||||||
|
if ($apikey -eq $null -or $apikey -eq "")
|
||||||
|
{
|
||||||
|
Write-Error "必须指定apiKey";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
rm -r ../src/IGeekFan.AspNetCore.Knife4jUI/bin/Release
|
||||||
|
dotnet build -c Release ../IGeekFan.AspNetCore.Knife4jUI.sln
|
||||||
|
|
||||||
|
|
||||||
|
$files = Get-ChildItem -Path ../src/IGeekFan.AspNetCore.Knife4jUI/bin/Release -Filter *-ns*.nupkg
|
||||||
|
foreach($file in $files)
|
||||||
|
{
|
||||||
|
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
||||||
|
}
|
||||||
|
$files = Get-ChildItem -Path ../src/IGeekFan.AspNetCore.Knife4jUI/bin/Release -Filter *-ns*.snupkg
|
||||||
|
foreach($file in $files)
|
||||||
|
{
|
||||||
|
dotnet nuget push $file.fullName --skip-duplicate --api-key $apikey --source https://api.nuget.org/v3/index.json
|
||||||
|
}
|
18
samples/AspNetCoreApi/AspNetCore7Api.csproj
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk.Web">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>net7.0</TargetFramework>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<GenerateDocumentationFile>True</GenerateDocumentationFile>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\..\src\IGeekFan.AspNetCore.Knife4jUI\IGeekFan.AspNetCore.Knife4jUI.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,95 @@
|
|||||||
|
using Knife4jUIDemo;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace AspNetCore6Api.Controllers
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 中文这是一个Get请求这是一个Get请求
|
||||||
|
/// </summary>
|
||||||
|
[ApiController]
|
||||||
|
[Route("api/WeatherForecast/[action]")]
|
||||||
|
public class WeatherForecastController : ControllerBase
|
||||||
|
{
|
||||||
|
private static readonly string[] Summaries = new[]
|
||||||
|
{
|
||||||
|
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||||
|
};
|
||||||
|
|
||||||
|
private readonly ILogger<WeatherForecastController> _logger;
|
||||||
|
|
||||||
|
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||||
|
{
|
||||||
|
_logger = logger;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 得到一个ErrorCode
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public ErrorCode GetErrorCode()
|
||||||
|
{
|
||||||
|
return ErrorCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public ErrorCode GetErrorCode2(ErrorCode errorCode)
|
||||||
|
{
|
||||||
|
return errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult GetErrorCode4(ErrorCode errorCode)
|
||||||
|
{
|
||||||
|
return new JsonResult(new PostErrorCodeDto() { Message = "a", ErrorCode = errorCode });
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 发送一个Post
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public PostErrorCodeDto PostErrorCode([FromBody] PostErrorCodeDto PostErrorCodeDto)
|
||||||
|
{
|
||||||
|
return PostErrorCodeDto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 这是一个Get请求
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpGet]
|
||||||
|
public IEnumerable<WeatherForecast> Get()
|
||||||
|
{
|
||||||
|
var rng = new Random();
|
||||||
|
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||||
|
{
|
||||||
|
Date = DateTime.Now.AddDays(index),
|
||||||
|
TemperatureC = rng.Next(-20, 55),
|
||||||
|
Summary = Summaries[rng.Next(Summaries.Length)]
|
||||||
|
})
|
||||||
|
.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 请求实体
|
||||||
|
/// </summary>
|
||||||
|
public class PostErrorCodeDto
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 异常信息
|
||||||
|
/// </summary>
|
||||||
|
public string Message { get; set; }
|
||||||
|
|
||||||
|
public WeatherForecast WeatherForecast { get; set; }
|
||||||
|
/// <summary>
|
||||||
|
/// 状态码
|
||||||
|
/// </summary>
|
||||||
|
public ErrorCode ErrorCode { get; set; }
|
||||||
|
}
|
||||||
|
}
|
81
samples/AspNetCoreApi/ErrorCode.cs
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
using System.ComponentModel;
|
||||||
|
|
||||||
|
namespace Knife4jUIDemo
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 注释ErrorCode
|
||||||
|
/// </summary>
|
||||||
|
public enum ErrorCode
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 操作成功
|
||||||
|
/// </summary>
|
||||||
|
Success = 0,
|
||||||
|
/// <summary>
|
||||||
|
/// 未知错误
|
||||||
|
/// </summary>
|
||||||
|
UnknownError = 1007,
|
||||||
|
/// <summary>
|
||||||
|
/// 服务器未知错误
|
||||||
|
/// </summary>
|
||||||
|
ServerUnknownError = 999,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 失败
|
||||||
|
/// </summary>
|
||||||
|
Error = 1000,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 认证失败
|
||||||
|
/// </summary>
|
||||||
|
AuthenticationFailed = 10000,
|
||||||
|
/// <summary>
|
||||||
|
/// 无权限
|
||||||
|
/// </summary>
|
||||||
|
NoPermission = 10001,
|
||||||
|
/// <summary>
|
||||||
|
/// 失败
|
||||||
|
/// </summary>
|
||||||
|
Fail = 9999,
|
||||||
|
/// <summary>
|
||||||
|
/// refreshToken异常
|
||||||
|
/// </summary>
|
||||||
|
RefreshTokenError = 10100,
|
||||||
|
/// <summary>
|
||||||
|
/// 资源不存在
|
||||||
|
/// </summary>
|
||||||
|
NotFound = 10020,
|
||||||
|
/// <summary>
|
||||||
|
/// 参数错误
|
||||||
|
/// </summary>
|
||||||
|
[Description("参数错误")]
|
||||||
|
ParameterError = 10030,
|
||||||
|
/// <summary>
|
||||||
|
/// 令牌失效
|
||||||
|
/// </summary>
|
||||||
|
[Description("令牌失效")]
|
||||||
|
TokenInvalidation = 10040,
|
||||||
|
/// <summary>
|
||||||
|
/// 令牌过期
|
||||||
|
/// </summary>
|
||||||
|
TokenExpired = 10050,
|
||||||
|
/// <summary>
|
||||||
|
/// 字段重复
|
||||||
|
/// </summary>
|
||||||
|
RepeatField = 10060,
|
||||||
|
/// <summary>
|
||||||
|
/// 禁止操作
|
||||||
|
/// </summary>
|
||||||
|
Inoperable = 10070,
|
||||||
|
//10080 请求方法不允许
|
||||||
|
|
||||||
|
//10110 文件体积过大
|
||||||
|
|
||||||
|
//10120 文件数量过多
|
||||||
|
|
||||||
|
//10130 文件扩展名不符合规范
|
||||||
|
|
||||||
|
//10140 请求过于频繁,请稍后重试
|
||||||
|
ManyRequests = 10140
|
||||||
|
}
|
||||||
|
}
|
43
samples/AspNetCoreApi/Program.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using IGeekFan.AspNetCore.Knife4jUI;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||||
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
|
// Add services to the container.
|
||||||
|
|
||||||
|
builder.Services.AddControllers();
|
||||||
|
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
|
||||||
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
builder.Services.AddSwaggerGen(c =>
|
||||||
|
{
|
||||||
|
c.SwaggerDoc("v1", new OpenApiInfo { Title = "API V1", Version = "v1" });
|
||||||
|
var filePath = Path.Combine(System.AppContext.BaseDirectory, "AspNetCore7Api.xml");
|
||||||
|
c.IncludeXmlComments(filePath, true);
|
||||||
|
});
|
||||||
|
|
||||||
|
var app = builder.Build();
|
||||||
|
|
||||||
|
// Configure the HTTP request pipeline.
|
||||||
|
if (app.Environment.IsDevelopment())
|
||||||
|
{
|
||||||
|
app.UseSwagger();
|
||||||
|
app.UseKnife4UI(c =>
|
||||||
|
{
|
||||||
|
c.RoutePrefix = "swagger"; // serve the UI at root
|
||||||
|
c.SwaggerEndpoint("/v1/swagger.json", "V1 Docs");
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
app.UseHttpsRedirection();
|
||||||
|
app.UseRouting();
|
||||||
|
app.UseAuthorization();
|
||||||
|
|
||||||
|
app.UseEndpoints(endpoints =>
|
||||||
|
{
|
||||||
|
endpoints.MapControllers();
|
||||||
|
endpoints.MapSwagger("/k4/{documentName}/swagger.json");
|
||||||
|
});
|
||||||
|
|
||||||
|
app.Run();
|
15
samples/AspNetCoreApi/Properties/launchSettings.json
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://json.schemastore.org/launchsettings.json",
|
||||||
|
"profiles": {
|
||||||
|
"AspNetCore7Api": {
|
||||||
|
"commandName": "Project",
|
||||||
|
"dotnetRunMessages": true,
|
||||||
|
"launchBrowser": true,
|
||||||
|
"launchUrl": "swagger",
|
||||||
|
"applicationUrl": "http://localhost:5000",
|
||||||
|
"environmentVariables": {
|
||||||
|
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
13
samples/AspNetCoreApi/WeatherForecast.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
namespace AspNetCore6Api
|
||||||
|
{
|
||||||
|
public class WeatherForecast
|
||||||
|
{
|
||||||
|
public DateTime Date { get; set; }
|
||||||
|
|
||||||
|
public int TemperatureC { get; set; }
|
||||||
|
|
||||||
|
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||||
|
|
||||||
|
public string? Summary { get; set; }
|
||||||
|
}
|
||||||
|
}
|
8
samples/AspNetCoreApi/appsettings.Development.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
9
samples/AspNetCoreApi/appsettings.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"Logging": {
|
||||||
|
"LogLevel": {
|
||||||
|
"Default": "Information",
|
||||||
|
"Microsoft.AspNetCore": "Warning"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"AllowedHosts": "*"
|
||||||
|
}
|
@ -1,17 +1,16 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Reflection;
|
|
||||||
using System.Text.Json;
|
using System.Text.Json;
|
||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc.Controllers;
|
||||||
using Microsoft.Extensions.Configuration;
|
using Microsoft.Extensions.Configuration;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.Extensions.FileProviders;
|
using Microsoft.Extensions.FileProviders;
|
||||||
using Microsoft.Extensions.Hosting;
|
using Microsoft.Extensions.Hosting;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
using Swashbuckle.AspNetCore.SwaggerGen;
|
|
||||||
using Swashbuckle.AspNetCore.SwaggerUI;
|
using Swashbuckle.AspNetCore.SwaggerUI;
|
||||||
|
|
||||||
namespace Knife4jUIDemo
|
namespace Knife4jUIDemo
|
||||||
@ -39,7 +38,8 @@ namespace Knife4jUIDemo
|
|||||||
});
|
});
|
||||||
c.CustomOperationIds(apiDesc =>
|
c.CustomOperationIds(apiDesc =>
|
||||||
{
|
{
|
||||||
return apiDesc.TryGetMethodInfo(out MethodInfo methodInfo) ? methodInfo.Name : null;
|
var controllerAction = apiDesc.ActionDescriptor as ControllerActionDescriptor;
|
||||||
|
return controllerAction.ControllerName + "-" + controllerAction.ActionName;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -7,10 +7,10 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.10.9" />
|
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.17.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.5.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="6.4.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.5.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.4.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="5.5.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerUi" Version="6.4.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,41 +1,52 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFrameworks>netstandard2.0;netcoreapp3.0</TargetFrameworks>
|
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net6.0;net7.0</TargetFrameworks>
|
||||||
<Description>Middleware to expose an embedded version of the knife4j-vue-v3 from an ASP.NET Core application</Description>
|
<Description>Middleware to expose an embedded version of the knife4j-vue from an ASP.NET Core application</Description>
|
||||||
<NoWarn>$(NoWarn);1591</NoWarn>
|
<NoWarn>$(NoWarn);1591</NoWarn>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<PackageId></PackageId>
|
<PackageId>IGeekFan.AspNetCore.Knife4jUI.NS</PackageId>
|
||||||
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore</PackageTags>
|
<PackageTags>swagger;documentation;discovery;help;webapi;aspnet;aspnetcore</PackageTags>
|
||||||
<PackageProjectUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI</PackageProjectUrl>
|
<PackageProjectUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI</PackageProjectUrl>
|
||||||
<RepositoryType>git</RepositoryType>
|
<RepositoryType>git</RepositoryType>
|
||||||
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
|
<RepositoryUrl>https://github.com/luoyunchong/IGeekFan.AspNetCore.Knife4jUI.git</RepositoryUrl>
|
||||||
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
|
<RootNamespace>IGeekFan.AspNetCore.Knife4jUI</RootNamespace>
|
||||||
<Version>0.0.2</Version>
|
<Version>0.0.15-ns3</Version>
|
||||||
<Company />
|
<Company />
|
||||||
<Authors>igeekfan;xiaoym;</Authors>
|
<Authors>igeekfan;xiaoym;</Authors>
|
||||||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
<Copyright>Apache License 2.0</Copyright>
|
<Copyright>Apache License 2.0</Copyright>
|
||||||
<PackageLicenseExpression></PackageLicenseExpression>
|
<PackageLicenseExpression></PackageLicenseExpression>
|
||||||
|
<AssemblyVersion>0.0.15.0</AssemblyVersion>
|
||||||
|
<FileVersion>0.0.15.0</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
|
<!-- Using SourceLink -->
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.1.0" />
|
<PropertyGroup>
|
||||||
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.0" />
|
<IncludeSymbols>true</IncludeSymbols>
|
||||||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="2.1.0" />
|
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
|
||||||
<PackageReference Include="System.Text.Json" Version="4.6.0" />
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' ">
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.Routing" Version="2.2.2" />
|
||||||
|
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
|
||||||
|
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="7.0.0" />
|
||||||
|
<PackageReference Include="System.Text.Json" Version="7.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">
|
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0' ">
|
||||||
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
<FrameworkReference Include="Microsoft.AspNetCore.App" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" Version="5.5.1" />
|
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="5.5.1" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="knife4j/**/*" />
|
<EmbeddedResource Include="webjars/**/*" />
|
||||||
|
<EmbeddedResource Include="oauth/*" />
|
||||||
<EmbeddedResource Include="favicon.ico" />
|
<EmbeddedResource Include="favicon.ico" />
|
||||||
<EmbeddedResource Include="index.html" />
|
<EmbeddedResource Include="index.html" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
@ -0,0 +1,37 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
|
using Microsoft.Extensions.Options;
|
||||||
|
using Microsoft.AspNetCore.Hosting;
|
||||||
|
#if NETSTANDARD2_0
|
||||||
|
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace IGeekFan.AspNetCore.Knife4jUI
|
||||||
|
{
|
||||||
|
public static class Knife4UIBuilderExtensions
|
||||||
|
{
|
||||||
|
public static IApplicationBuilder UseKnife4UI(this IApplicationBuilder app, Knife4UIOptions options)
|
||||||
|
{
|
||||||
|
return app.UseMiddleware<Knife4jUIMiddleware>(options);
|
||||||
|
}
|
||||||
|
public static IApplicationBuilder UseKnife4UI(
|
||||||
|
this IApplicationBuilder app,
|
||||||
|
Action<Knife4UIOptions> setupAction = null)
|
||||||
|
{
|
||||||
|
var options = new Knife4UIOptions();
|
||||||
|
using (var scope = app.ApplicationServices.CreateScope())
|
||||||
|
{
|
||||||
|
options = scope.ServiceProvider.GetRequiredService<IOptionsSnapshot<Knife4UIOptions>>().Value;
|
||||||
|
setupAction?.Invoke(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.ConfigObject.Urls == null)
|
||||||
|
{
|
||||||
|
var hostingEnv = app.ApplicationServices.GetRequiredService<IWebHostEnvironment>();
|
||||||
|
options.ConfigObject.Urls = new[] { new UrlDescriptor { Name = $"{hostingEnv.ApplicationName} v1", Url = "v1/swagger.json" } };
|
||||||
|
}
|
||||||
|
return app.UseKnife4UI(options);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -136,6 +136,8 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
|||||||
public string Url { get; set; }
|
public string Url { get; set; }
|
||||||
|
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string SwaggerVersion { get; set; } = "3.0";
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ModelRendering
|
public enum ModelRendering
|
@ -14,8 +14,8 @@ using System.Text.Json;
|
|||||||
using System.Text.Json.Serialization;
|
using System.Text.Json.Serialization;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
#if NETCOREAPP3_0
|
#if NETSTANDARD2_0
|
||||||
using IHostingEnvironment = Microsoft.AspNetCore.Hosting.IWebHostEnvironment;
|
using IWebHostEnvironment = Microsoft.AspNetCore.Hosting.IHostingEnvironment;
|
||||||
#endif
|
#endif
|
||||||
namespace IGeekFan.AspNetCore.Knife4jUI
|
namespace IGeekFan.AspNetCore.Knife4jUI
|
||||||
{
|
{
|
||||||
@ -29,7 +29,7 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
|||||||
|
|
||||||
public Knife4jUIMiddleware(
|
public Knife4jUIMiddleware(
|
||||||
RequestDelegate next,
|
RequestDelegate next,
|
||||||
IHostingEnvironment hostingEnv,
|
IWebHostEnvironment hostingEnv,
|
||||||
ILoggerFactory loggerFactory,
|
ILoggerFactory loggerFactory,
|
||||||
Knife4UIOptions options)
|
Knife4UIOptions options)
|
||||||
{
|
{
|
||||||
@ -45,6 +45,7 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
|||||||
|
|
||||||
public async Task Invoke(HttpContext httpContext)
|
public async Task Invoke(HttpContext httpContext)
|
||||||
{
|
{
|
||||||
|
|
||||||
var httpMethod = httpContext.Request.Method;
|
var httpMethod = httpContext.Request.Method;
|
||||||
var path = httpContext.Request.Path.Value;
|
var path = httpContext.Request.Path.Value;
|
||||||
|
|
||||||
@ -66,7 +67,7 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (httpMethod == "GET" && Regex.IsMatch(path, $"^/v3/api-docs/swagger-config$"))
|
if (httpMethod == "GET" && Regex.IsMatch(path, $"/swagger-resources$"))
|
||||||
{
|
{
|
||||||
await RespondWithConfig(httpContext.Response);
|
await RespondWithConfig(httpContext.Response);
|
||||||
return;
|
return;
|
||||||
@ -77,12 +78,12 @@ namespace IGeekFan.AspNetCore.Knife4jUI
|
|||||||
|
|
||||||
private async Task RespondWithConfig(HttpResponse response)
|
private async Task RespondWithConfig(HttpResponse response)
|
||||||
{
|
{
|
||||||
await response.WriteAsync(JsonSerializer.Serialize(_options.ConfigObject, _jsonSerializerOptions));
|
await response.WriteAsync(JsonSerializer.Serialize(_options.ConfigObject.Urls, _jsonSerializerOptions));
|
||||||
}
|
}
|
||||||
|
|
||||||
private StaticFileMiddleware CreateStaticFileMiddleware(
|
private StaticFileMiddleware CreateStaticFileMiddleware(
|
||||||
RequestDelegate next,
|
RequestDelegate next,
|
||||||
IHostingEnvironment hostingEnv,
|
IWebHostEnvironment hostingEnv,
|
||||||
ILoggerFactory loggerFactory,
|
ILoggerFactory loggerFactory,
|
||||||
Knife4UIOptions options)
|
Knife4UIOptions options)
|
||||||
{
|
{
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
BIN
src/IGeekFan.AspNetCore.Knife4jUI/img/icons/apple-touch-icon.png
Normal file
After Width: | Height: | Size: 4.6 KiB |
BIN
src/IGeekFan.AspNetCore.Knife4jUI/img/icons/favicon-16x16.png
Normal file
After Width: | Height: | Size: 799 B |
BIN
src/IGeekFan.AspNetCore.Knife4jUI/img/icons/favicon-32x32.png
Normal file
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
BIN
src/IGeekFan.AspNetCore.Knife4jUI/img/icons/mstile-150x150.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
@ -0,0 +1,149 @@
|
|||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
||||||
|
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
||||||
|
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
||||||
|
width="16.000000pt" height="16.000000pt" viewBox="0 0 16.000000 16.000000"
|
||||||
|
preserveAspectRatio="xMidYMid meet">
|
||||||
|
<metadata>
|
||||||
|
Created by potrace 1.11, written by Peter Selinger 2001-2013
|
||||||
|
</metadata>
|
||||||
|
<g transform="translate(0.000000,16.000000) scale(0.000320,-0.000320)"
|
||||||
|
fill="#000000" stroke="none">
|
||||||
|
<path d="M18 46618 c45 -75 122 -207 122 -211 0 -2 25 -45 55 -95 30 -50 55
|
||||||
|
-96 55 -102 0 -5 5 -10 10 -10 6 0 10 -4 10 -9 0 -5 73 -135 161 -288 89 -153
|
||||||
|
173 -298 187 -323 14 -25 32 -57 41 -72 88 -149 187 -324 189 -335 2 -7 8 -13
|
||||||
|
13 -13 5 0 9 -4 9 -10 0 -5 46 -89 103 -187 175 -302 490 -846 507 -876 8 -16
|
||||||
|
20 -36 25 -45 28 -46 290 -498 339 -585 13 -23 74 -129 136 -236 61 -107 123
|
||||||
|
-215 137 -240 14 -25 29 -50 33 -56 5 -5 23 -37 40 -70 18 -33 38 -67 44 -75
|
||||||
|
11 -16 21 -33 63 -109 14 -25 29 -50 33 -56 4 -5 21 -35 38 -65 55 -100 261
|
||||||
|
-455 269 -465 4 -5 14 -21 20 -35 15 -29 41 -75 103 -180 24 -41 52 -88 60
|
||||||
|
-105 9 -16 57 -100 107 -185 112 -193 362 -626 380 -660 8 -14 23 -38 33 -55
|
||||||
|
11 -16 23 -37 27 -45 4 -8 26 -46 48 -85 23 -38 53 -90 67 -115 46 -81 64
|
||||||
|
-113 178 -310 62 -107 121 -210 132 -227 37 -67 56 -99 85 -148 16 -27 32 -57
|
||||||
|
36 -65 4 -8 15 -27 25 -42 9 -15 53 -89 96 -165 44 -76 177 -307 296 -513 120
|
||||||
|
-206 268 -463 330 -570 131 -227 117 -203 200 -348 36 -62 73 -125 82 -140 10
|
||||||
|
-15 21 -34 25 -42 4 -8 20 -37 36 -65 17 -27 38 -65 48 -82 49 -85 64 -111 87
|
||||||
|
-153 13 -25 28 -49 32 -55 4 -5 78 -134 165 -285 87 -151 166 -288 176 -305
|
||||||
|
10 -16 26 -43 35 -59 9 -17 125 -217 257 -445 132 -229 253 -441 270 -471 17
|
||||||
|
-30 45 -79 64 -108 18 -29 33 -54 33 -57 0 -2 20 -37 44 -77 24 -40 123 -212
|
||||||
|
221 -383 97 -170 190 -330 205 -355 16 -25 39 -65 53 -90 13 -25 81 -144 152
|
||||||
|
-265 70 -121 137 -238 150 -260 12 -22 37 -65 55 -95 18 -30 43 -73 55 -95 12
|
||||||
|
-22 48 -85 80 -140 77 -132 163 -280 190 -330 13 -22 71 -123 130 -225 59
|
||||||
|
-102 116 -199 126 -217 10 -17 29 -50 43 -72 15 -22 26 -43 26 -45 0 -2 27
|
||||||
|
-50 60 -106 33 -56 60 -103 60 -105 0 -2 55 -98 90 -155 8 -14 182 -316 239
|
||||||
|
-414 13 -22 45 -79 72 -124 27 -46 49 -86 49 -89 0 -2 14 -24 30 -48 16 -24
|
||||||
|
30 -46 30 -49 0 -5 74 -135 100 -176 5 -8 24 -42 43 -75 50 -88 58 -101 262
|
||||||
|
-455 104 -179 199 -345 213 -370 14 -25 28 -49 32 -55 4 -5 17 -26 28 -45 10
|
||||||
|
-19 62 -109 114 -200 114 -197 133 -230 170 -295 16 -27 33 -57 38 -65 17 -28
|
||||||
|
96 -165 103 -180 4 -8 16 -28 26 -45 10 -16 77 -131 148 -255 72 -124 181
|
||||||
|
-313 243 -420 62 -107 121 -209 131 -227 35 -62 323 -560 392 -678 38 -66 83
|
||||||
|
-145 100 -175 16 -30 33 -59 37 -65 4 -5 17 -27 29 -47 34 -61 56 -100 90
|
||||||
|
-156 17 -29 31 -55 31 -57 0 -2 17 -32 39 -67 21 -35 134 -229 251 -433 117
|
||||||
|
-203 235 -407 261 -451 27 -45 49 -85 49 -88 0 -4 8 -19 19 -34 15 -21 200
|
||||||
|
-341 309 -533 10 -19 33 -58 51 -87 17 -29 31 -54 31 -56 0 -2 25 -44 55 -94
|
||||||
|
30 -50 55 -95 55 -98 0 -4 6 -15 14 -23 7 -9 27 -41 43 -71 17 -30 170 -297
|
||||||
|
342 -594 171 -296 311 -542 311 -547 0 -5 5 -9 10 -9 6 0 10 -4 10 -10 0 -5
|
||||||
|
22 -47 49 -92 27 -46 58 -99 68 -118 24 -43 81 -140 93 -160 5 -8 66 -114 135
|
||||||
|
-235 69 -121 130 -227 135 -235 12 -21 259 -447 283 -490 10 -19 28 -47 38
|
||||||
|
-62 11 -14 19 -29 19 -32 0 -3 37 -69 83 -148 99 -170 305 -526 337 -583 13
|
||||||
|
-22 31 -53 41 -70 11 -16 22 -37 26 -45 7 -14 82 -146 103 -180 14 -24 181
|
||||||
|
-311 205 -355 13 -22 46 -80 75 -130 29 -49 64 -110 78 -135 14 -25 51 -88 82
|
||||||
|
-140 31 -52 59 -102 63 -110 4 -8 18 -33 31 -55 205 -353 284 -489 309 -535
|
||||||
|
17 -30 45 -78 62 -106 18 -28 36 -60 39 -72 4 -12 12 -22 17 -22 5 0 9 -4 9
|
||||||
|
-10 0 -5 109 -197 241 -427 133 -230 250 -431 259 -448 51 -90 222 -385 280
|
||||||
|
-485 37 -63 78 -135 92 -160 14 -25 67 -117 118 -205 51 -88 101 -175 111
|
||||||
|
-193 34 -58 55 -95 149 -257 51 -88 101 -173 110 -190 9 -16 76 -131 147 -255
|
||||||
|
72 -124 140 -241 151 -260 61 -108 281 -489 355 -615 38 -66 77 -133 87 -150
|
||||||
|
35 -63 91 -161 100 -175 14 -23 99 -169 128 -220 54 -97 135 -235 142 -245 4
|
||||||
|
-5 20 -32 35 -60 26 -48 238 -416 276 -480 10 -16 26 -46 37 -65 30 -53 382
|
||||||
|
-661 403 -695 10 -16 22 -37 26 -45 4 -8 26 -48 50 -88 24 -41 43 -75 43 -77
|
||||||
|
0 -2 22 -40 50 -85 27 -45 50 -84 50 -86 0 -3 38 -69 83 -147 84 -142 302
|
||||||
|
-520 340 -587 10 -19 34 -60 52 -90 18 -30 44 -75 57 -100 14 -25 45 -79 70
|
||||||
|
-120 25 -41 56 -96 70 -121 14 -25 77 -133 138 -240 62 -107 122 -210 132
|
||||||
|
-229 25 -43 310 -535 337 -581 11 -19 26 -45 34 -59 17 -32 238 -414 266 -460
|
||||||
|
11 -19 24 -41 28 -49 3 -7 75 -133 160 -278 84 -146 153 -269 153 -274 0 -5 5
|
||||||
|
-9 10 -9 6 0 10 -4 10 -10 0 -5 82 -150 181 -322 182 -314 201 -346 240 -415
|
||||||
|
12 -21 80 -139 152 -263 71 -124 141 -245 155 -270 14 -25 28 -49 32 -55 6 -8
|
||||||
|
145 -248 220 -380 37 -66 209 -362 229 -395 11 -19 24 -42 28 -49 4 -8 67
|
||||||
|
-118 140 -243 73 -125 133 -230 133 -233 0 -2 15 -28 33 -57 19 -29 47 -78 64
|
||||||
|
-108 17 -30 53 -93 79 -139 53 -90 82 -141 157 -272 82 -142 115 -199 381
|
||||||
|
-659 142 -245 268 -463 281 -485 12 -22 71 -125 132 -230 60 -104 172 -298
|
||||||
|
248 -430 76 -132 146 -253 156 -270 11 -16 22 -36 26 -44 3 -8 30 -54 60 -103
|
||||||
|
29 -49 53 -91 53 -93 0 -3 18 -34 40 -70 22 -36 40 -67 40 -69 0 -2 37 -66 81
|
||||||
|
-142 45 -77 98 -168 119 -204 20 -36 47 -81 58 -100 12 -19 27 -47 33 -62 6
|
||||||
|
-16 15 -28 20 -28 5 0 9 -4 9 -9 0 -6 63 -118 140 -251 77 -133 140 -243 140
|
||||||
|
-245 0 -2 18 -33 41 -70 22 -37 49 -83 60 -101 10 -19 29 -51 40 -71 25 -45
|
||||||
|
109 -189 126 -218 7 -11 17 -29 22 -40 6 -11 22 -38 35 -60 14 -22 37 -62 52
|
||||||
|
-90 14 -27 35 -62 45 -77 11 -14 19 -29 19 -32 0 -3 18 -35 40 -71 22 -36 40
|
||||||
|
-67 40 -69 0 -2 19 -35 42 -72 23 -38 55 -94 72 -124 26 -47 139 -244 171
|
||||||
|
-298 6 -9 21 -36 34 -60 28 -48 37 -51 51 -19 6 12 19 36 29 52 10 17 27 46
|
||||||
|
38 65 11 19 104 181 208 360 103 179 199 345 213 370 14 25 42 74 64 109 21
|
||||||
|
34 38 65 38 67 0 2 18 33 40 69 22 36 40 67 40 69 0 3 177 310 199 346 16 26
|
||||||
|
136 234 140 244 2 5 25 44 52 88 27 44 49 81 49 84 0 2 18 34 40 70 22 36 40
|
||||||
|
67 40 69 0 2 20 36 43 77 35 58 169 289 297 513 9 17 50 86 90 155 40 69 86
|
||||||
|
150 103 180 16 30 35 62 41 70 6 8 16 24 22 35 35 64 72 129 167 293 59 100
|
||||||
|
116 199 127 220 11 20 30 53 41 72 43 72 1070 1850 1121 1940 14 25 65 113
|
||||||
|
113 195 48 83 96 166 107 185 10 19 28 50 38 68 11 18 73 124 137 235 64 111
|
||||||
|
175 303 246 427 71 124 173 299 225 390 52 91 116 202 143 248 27 45 49 85 49
|
||||||
|
89 0 4 6 14 14 22 7 9 28 43 46 76 26 47 251 436 378 655 11 19 29 51 40 70
|
||||||
|
11 19 101 176 201 348 99 172 181 317 181 323 0 5 5 9 10 9 6 0 10 5 10 11 0
|
||||||
|
6 8 23 18 37 11 15 32 52 49 82 16 30 130 228 253 440 122 212 234 405 248
|
||||||
|
430 13 25 39 70 57 100 39 65 69 117 130 225 25 44 50 87 55 95 12 19 78 134
|
||||||
|
220 380 61 107 129 224 150 260 161 277 222 382 246 425 15 28 47 83 71 123
|
||||||
|
24 41 43 78 43 83 0 5 4 9 8 9 4 0 13 12 19 28 7 15 23 45 36 67 66 110 277
|
||||||
|
478 277 483 0 3 6 13 14 21 7 9 27 41 43 71 17 30 45 80 63 110 34 57 375 649
|
||||||
|
394 685 6 11 16 27 22 35 6 8 26 42 44 75 18 33 41 74 51 90 10 17 24 41 32
|
||||||
|
55 54 97 72 128 88 152 11 14 19 28 19 30 0 3 79 141 175 308 96 167 175 305
|
||||||
|
175 308 0 3 6 13 14 21 7 9 26 39 41 66 33 60 276 483 338 587 24 40 46 80 50
|
||||||
|
88 4 8 13 24 20 35 14 23 95 163 125 215 11 19 52 91 92 160 40 69 80 139 90
|
||||||
|
155 9 17 103 179 207 360 105 182 200 346 211 365 103 181 463 802 489 845 7
|
||||||
|
11 15 27 19 35 4 8 29 51 55 95 64 110 828 1433 848 1470 9 17 24 41 33 55 9
|
||||||
|
14 29 48 45 77 15 28 52 93 82 145 30 51 62 107 71 123 17 30 231 398 400 690
|
||||||
|
51 88 103 179 115 202 12 23 26 48 32 55 6 7 24 38 40 68 17 30 61 107 98 170
|
||||||
|
37 63 84 144 103 180 19 36 41 72 48 81 8 8 14 18 14 21 0 4 27 51 59 106 32
|
||||||
|
55 72 124 89 154 16 29 71 125 122 213 51 88 104 180 118 205 13 25 28 50 32
|
||||||
|
55 4 6 17 26 28 45 11 19 45 80 77 135 31 55 66 116 77 135 11 19 88 152 171
|
||||||
|
295 401 694 620 1072 650 1125 11 19 87 152 170 295 83 143 158 273 166 288 9
|
||||||
|
16 21 36 26 45 6 9 31 52 55 96 25 43 54 94 66 115 11 20 95 164 186 321 91
|
||||||
|
157 173 299 182 315 9 17 26 46 37 65 12 19 66 114 121 210 56 96 108 186 117
|
||||||
|
200 8 14 24 40 34 59 24 45 383 664 412 713 5 9 17 29 26 45 15 28 120 210
|
||||||
|
241 419 36 61 68 117 72 125 4 8 12 23 19 34 35 57 245 420 262 453 11 20 35
|
||||||
|
61 53 90 17 29 32 54 32 56 0 3 28 51 62 108 33 57 70 119 80 138 10 19 23 42
|
||||||
|
28 50 5 8 32 53 59 100 27 47 149 258 271 470 122 212 234 405 248 430 30 53
|
||||||
|
62 108 80 135 6 11 15 27 19 35 4 8 85 150 181 315 96 165 187 323 202 350 31
|
||||||
|
56 116 202 130 225 5 8 25 42 43 75 19 33 92 159 162 280 149 257 157 271 202
|
||||||
|
350 19 33 38 67 43 75 9 14 228 392 275 475 12 22 55 96 95 165 40 69 80 139
|
||||||
|
90 155 24 42 202 350 221 383 9 15 27 47 41 72 14 25 75 131 136 236 61 106
|
||||||
|
121 210 134 232 99 172 271 470 279 482 5 8 23 40 40 70 18 30 81 141 142 245
|
||||||
|
60 105 121 210 135 235 14 25 71 124 127 220 56 96 143 247 194 335 51 88 96
|
||||||
|
167 102 175 14 24 180 311 204 355 23 43 340 590 356 615 5 8 50 87 101 175
|
||||||
|
171 301 517 898 582 1008 25 43 46 81 46 83 0 2 12 23 27 47 14 23 40 67 56
|
||||||
|
97 16 30 35 62 42 70 7 8 15 22 18 30 4 8 20 38 37 65 16 28 33 57 37 65 6 12
|
||||||
|
111 196 143 250 5 8 55 95 112 193 57 98 113 195 126 215 12 20 27 46 32 57 6
|
||||||
|
11 14 27 20 35 5 8 76 130 156 270 80 140 165 287 187 325 23 39 52 90 66 115
|
||||||
|
13 25 30 52 37 61 8 8 14 18 14 21 0 4 41 77 92 165 50 87 175 302 276 478
|
||||||
|
101 176 208 360 236 408 28 49 67 117 86 152 19 35 41 70 48 77 6 6 12 15 12
|
||||||
|
19 0 7 124 224 167 291 12 21 23 40 23 42 0 2 21 40 46 83 26 43 55 92 64 109
|
||||||
|
54 95 327 568 354 614 19 30 45 75 59 100 71 128 82 145 89 148 4 2 8 8 8 13
|
||||||
|
0 5 42 82 94 172 311 538 496 858 518 897 14 25 40 70 58 100 18 30 42 71 53
|
||||||
|
90 10 19 79 139 152 265 73 127 142 246 153 265 10 19 43 76 72 125 29 50 63
|
||||||
|
108 75 130 65 116 80 140 87 143 4 2 8 8 8 12 0 8 114 212 140 250 6 8 14 24
|
||||||
|
20 35 5 11 54 97 108 190 l100 170 -9611 3 c-5286 1 -9614 -1 -9618 -5 -5 -6
|
||||||
|
-419 -719 -619 -1068 -89 -155 -267 -463 -323 -560 -38 -66 -81 -140 -95 -165
|
||||||
|
-31 -56 -263 -457 -526 -910 -110 -190 -224 -388 -254 -440 -29 -52 -61 -109
|
||||||
|
-71 -125 -23 -39 -243 -420 -268 -465 -11 -19 -204 -352 -428 -740 -224 -388
|
||||||
|
-477 -826 -563 -975 -85 -148 -185 -322 -222 -385 -37 -63 -120 -207 -185
|
||||||
|
-320 -65 -113 -177 -306 -248 -430 -72 -124 -172 -297 -222 -385 -51 -88 -142
|
||||||
|
-245 -202 -350 -131 -226 -247 -427 -408 -705 -65 -113 -249 -432 -410 -710
|
||||||
|
-160 -278 -388 -673 -506 -877 -118 -205 -216 -373 -219 -373 -3 0 -52 82
|
||||||
|
-109 183 -58 100 -144 250 -192 332 -95 164 -402 696 -647 1120 -85 149 -228
|
||||||
|
396 -317 550 -212 365 -982 1700 -1008 1745 -10 19 -43 76 -72 125 -29 50 -64
|
||||||
|
110 -77 135 -14 25 -63 110 -110 190 -47 80 -96 165 -110 190 -14 25 -99 171
|
||||||
|
-188 325 -89 154 -174 300 -188 325 -13 25 -64 113 -112 195 -48 83 -140 242
|
||||||
|
-205 355 -65 113 -183 317 -263 454 -79 137 -152 264 -163 282 -50 89 -335
|
||||||
|
583 -354 614 -12 19 -34 58 -50 85 -15 28 -129 226 -253 440 -124 215 -235
|
||||||
|
408 -247 430 -12 22 -69 121 -127 220 -58 99 -226 389 -373 645 -148 256 -324
|
||||||
|
561 -392 678 -67 117 -134 232 -147 255 -13 23 -33 59 -46 80 l-22 37 -9615 0
|
||||||
|
-9615 0 20 -32z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 10 KiB |
15
src/IGeekFan.AspNetCore.Knife4jUI/index.html
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8"/>
|
||||||
|
<link rel="icon" href="./favicon.ico"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
||||||
|
<title></title>
|
||||||
|
<script type="module" crossorigin src="./webjars/js/index-39d45874.js"></script>
|
||||||
|
<link rel="stylesheet" href="./webjars/css/index-7ef90919.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
3
src/IGeekFan.AspNetCore.Knife4jUI/oauth/axios.min.js
vendored
Normal file
BIN
src/IGeekFan.AspNetCore.Knife4jUI/oauth/axios.min.js.gz
Normal file
104
src/IGeekFan.AspNetCore.Knife4jUI/oauth/oauth2.html
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
|
||||||
|
<title>Knife4j-OAuth2</title>
|
||||||
|
<script src="axios.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script type="text/javascript">
|
||||||
|
(function(){
|
||||||
|
function OAuth2(url){
|
||||||
|
this.url=url;
|
||||||
|
this.code=null;
|
||||||
|
this.accessToken=null;
|
||||||
|
this.tokenType=null;
|
||||||
|
this.state=null;
|
||||||
|
//缓存在localStorage中的对象
|
||||||
|
this.cacheValue=null;
|
||||||
|
}
|
||||||
|
OAuth2.prototype.init=function(){
|
||||||
|
var local=this.url;
|
||||||
|
this.code=this.getKey("code",local,"");
|
||||||
|
this.accessToken=this.getKey("access_token",local,"");
|
||||||
|
this.tokenType=this.getKey("token_type",local,"Bearer");
|
||||||
|
this.state=this.getKey("state",local);
|
||||||
|
if(window.localStorage){
|
||||||
|
var value=window.localStorage.getItem(this.state);
|
||||||
|
if(this.strNotBlank(value)){
|
||||||
|
this.cacheValue=JSON.parse(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OAuth2.prototype.auth=function(){
|
||||||
|
if(this.strNotBlank(this.code)){
|
||||||
|
this.authorizationCode();
|
||||||
|
}else{
|
||||||
|
this.implicit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
OAuth2.prototype.getKey=function(key,str,defaultValue){
|
||||||
|
var reg=new RegExp(".*?"+key+"=(.*?)(&.*)?$","ig");
|
||||||
|
var val=defaultValue;
|
||||||
|
if(reg.test(str)){
|
||||||
|
val=RegExp.$1;
|
||||||
|
}
|
||||||
|
return val;
|
||||||
|
}
|
||||||
|
OAuth2.prototype.strNotBlank=function(str){
|
||||||
|
var flag = false;
|
||||||
|
if ( str != undefined &&str != null &&str != "") {
|
||||||
|
flag = true;
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
OAuth2.prototype.implicit=function(){
|
||||||
|
this.cacheValue.accessToken=this.tokenType+" "+this.accessToken;
|
||||||
|
this.cacheValue.tokenType=this.tokenType;
|
||||||
|
this.cacheValue.granted=true;
|
||||||
|
window.localStorage.setItem(this.state,JSON.stringify(this.cacheValue))
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
OAuth2.prototype.authorizationCode=function(){
|
||||||
|
var that=this;
|
||||||
|
console.log(this.cacheValue);
|
||||||
|
var url=this.cacheValue.tokenUrl;
|
||||||
|
var params={
|
||||||
|
"grant_type":"authorization_code",
|
||||||
|
"code":this.code,
|
||||||
|
"redirect_uri":decodeURIComponent(this.cacheValue.redirectUri),
|
||||||
|
"client_id":this.cacheValue.clientId,
|
||||||
|
"client_secret":this.cacheValue.clientSecret
|
||||||
|
}
|
||||||
|
let instance=axios.create();
|
||||||
|
let requestConfig={
|
||||||
|
url: url,
|
||||||
|
method: 'post',
|
||||||
|
timeout: 0,
|
||||||
|
//此data必传,不然默认是data:undefined,https://github.com/axios/axios/issues/86
|
||||||
|
//否则axios会忽略请求头Content-Type
|
||||||
|
data: null,
|
||||||
|
params:params
|
||||||
|
}
|
||||||
|
instance.request(requestConfig).then(res=>{
|
||||||
|
let data=res.data;
|
||||||
|
if(data!=null&&data!=undefined) {
|
||||||
|
that.cacheValue.accessToken=data.token_type+" "+data.access_token;
|
||||||
|
that.cacheValue.tokenType=data.token_type;
|
||||||
|
that.cacheValue.granted=true;
|
||||||
|
window.localStorage.setItem(that.state,JSON.stringify(that.cacheValue))
|
||||||
|
window.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
var oauth=new OAuth2(window.location.href);
|
||||||
|
oauth.init();
|
||||||
|
oauth.auth();
|
||||||
|
})()
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
2
src/IGeekFan.AspNetCore.Knife4jUI/robots.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
User-agent: *
|
||||||
|
Disallow:
|
@ -0,0 +1 @@
|
|||||||
|
[data-v-ffa60634] .ant-row{position:relative;height:auto;margin-right:0;margin-left:0;zoom:1;display:block;-webkit-box-sizing:border-box;box-sizing:border-box}.method-select[data-v-ffa60634] .ant-select-selection-item{color:#fff}
|
@ -0,0 +1 @@
|
|||||||
|
.api-tab[data-v-0dd9eba4]{margin-top:15px}.api-tab .ant-tag[data-v-0dd9eba4]{height:32px;line-height:32px}.api-basic[data-v-0dd9eba4]{padding:11px}.api-basic-title[data-v-0dd9eba4]{font-size:14px;font-weight:700}.api-basic-body[data-v-0dd9eba4]{font-size:14px;font-family:-webkit-body}.api-description[data-v-0dd9eba4]{border-left:4px solid #ddd;line-height:30px}.api-body-desc[data-v-0dd9eba4]{padding:10px;min-height:35px;box-sizing:border-box;border:1px solid #e8e8e8}.ant-card-body[data-v-0dd9eba4]{padding:5px}.api-title[data-v-0dd9eba4]{margin-top:12px;margin-bottom:8px;font-size:16px;font-weight:600;height:24px;line-height:24px;border-left:4px solid #00ab6d;text-indent:8px}.content-line[data-v-0dd9eba4]{height:25px;line-height:25px}.content-line-count[data-v-0dd9eba4]{height:35px;line-height:35px}.divider[data-v-0dd9eba4]{margin:4px 0}
|
@ -0,0 +1 @@
|
|||||||
|
.api-title[data-v-3cf9f5a3]{margin-top:10px;margin-bottom:5px;font-size:16px;font-weight:600;height:30px;line-height:30px;border-left:4px solid #00ab6d;text-indent:8px}
|
@ -0,0 +1 @@
|
|||||||
|
import{l as i,B as l}from"./index-39d45874.js";var u={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M832 64H296c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h496v688c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8V96c0-17.7-14.3-32-32-32zM704 192H192c-17.7 0-32 14.3-32 32v530.7c0 8.5 3.4 16.6 9.4 22.6l173.3 173.3c2.2 2.2 4.7 4 7.4 5.5v1.9h4.2c3.5 1.3 7.2 2 11 2H704c17.7 0 32-14.3 32-32V224c0-17.7-14.3-32-32-32zM350 856.2L263.9 770H350v86.2zM664 888H414V746c0-22.1-17.9-40-40-40H232V264h432v624z"}}]},name:"copy",theme:"outlined"};const p=u;function o(n){for(var t=1;t<arguments.length;t++){var e=arguments[t]!=null?Object(arguments[t]):{},r=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(c){return Object.getOwnPropertyDescriptor(e,c).enumerable}))),r.forEach(function(c){f(n,c,e[c])})}return n}function f(n,t,e){return t in n?Object.defineProperty(n,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):n[t]=e,n}var a=function(t,e){var r=o({},t,e.attrs);return i(l,o({},r,{icon:p}),null)};a.displayName="CopyOutlined";a.inheritAttrs=!1;const d=a;export{d as C};
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as u,o as r,j as n,t as s,l as _,w as l,F as v,v as f,p as h,bV as p}from"./index-39d45874.js";const y={name:"DataType",props:{text:{type:String,default:"string",required:!0},record:{type:Object,required:!0}},data(){return{validators:[]}},created(){this.intiValidator()},methods:{intiValidator(){var a=this;const e=this.record;if(e.validateInstance!=null){a.getJsonKeyLength(e.validateInstance);for(var t in e.validateInstance){var i=t+":"+e.validateInstance[t];a.validators.push({key:t,val:i})}}},getJsonKeyLength(a){var e=0;if(a!=null)for(var t in a)a.hasOwnProperty(t)&&e++;return e}}},g={key:0},m={key:1,class:"knife4j-request-validate-jsr"};function x(a,e,t,i,c,k){const d=p;return r(),n("div",null,[t.record.validateStatus?(r(),n("span",m,[_(d,{placement:"right"},{title:l(()=>[(r(!0),n(v,null,f(c.validators,o=>(r(),n("div",{key:o.key},s(o.val),1))),128))]),default:l(()=>[h(" "+s(t.text),1)]),_:1})])):(r(),n("span",g,s(t.text==null||t.text==""?"string":t.text),1))])}const I=u(y,[["render",x]]);export{I as default};
|
@ -0,0 +1 @@
|
|||||||
|
import{a as o,V as a}from"./index-2c86cef6.js";import{m as l,a as d,t as c,e as h}from"./ext-language_tools-824bb0b4.js";import{_ as m,r as g,o as u,j as f,l as p,J as x}from"./index-39d45874.js";o.config.setModuleUrl("ace/mode/json",l);o.config.setModuleUrl("ace/mode/xml",d);o.config.setModuleUrl("ace/theme/xcode",c);o.config.setModuleUrl("ace/ext-language/tools",h);const _={name:"EditorShow",components:{editor:a},props:{value:{type:[String,Object],required:!0,default:""},xmlMode:{type:Boolean,default:!1,required:!1}},emits:["showDescription","change"],data(){return{lang:"json",editor:null,editorHeight:200}},methods:{change(e){this.$emit("change",e)},resetEditorHeight(){const e=this;setTimeout(()=>{let t=e.editor.session.getLength();t==1&&(t=10),e.editorHeight=t*16},300)},editorInit(e){const t=this;this.editor=e,this.xmlMode&&(this.lang="xml"),this.resetEditorHeight(),this.editor.renderer.on("afterRender",function(){t.$emit("showDescription","123")})}}};function v(e,t,r,E,n,i){const s=g("editor");return u(),f("div",null,[p(s,{value:r.value,onInit:i.editorInit,lang:n.lang,theme:"xcode",width:"100%",style:x({height:n.editorHeight+"px"}),onInput:i.change},null,8,["value","onInit","lang","style","onInput"])])}const y=m(_,[["render",v]]);export{y as default};
|
@ -0,0 +1 @@
|
|||||||
|
import{_ as t}from"./index-39d45874.js";const e={name:"OAuth2"};function n(r,o,s,c,_,a){return null}const u=t(e,[["render",n]]);export{u as default};
|
@ -0,0 +1 @@
|
|||||||
|
import{l as s,B as v,_ as b,d as A,a as j,b as C,c as D,f as x,u as I,m as u,r as i,o as R,j as U,w as c,k as l,t as m,p as M,M as P,y as S}from"./index-39d45874.js";import{C as V}from"./clipboard-6108ee01.js";import{a as r,V as E}from"./index-2c86cef6.js";import{m as B,a as L,t as k,e as N}from"./ext-language_tools-824bb0b4.js";import{C as T}from"./CopyOutlined-1ad6fae4.js";var $={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"download",theme:"outlined"};const J=$;function f(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?Object(arguments[e]):{},o=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable}))),o.forEach(function(a){q(n,a,t[a])})}return n}function q(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}var p=function(e,t){var o=f({},e,t.attrs);return s(v,f({},o,{icon:J}),null)};p.displayName="DownloadOutlined";p.inheritAttrs=!1;const z=p,H=""+new URL("mode-json5-ed4a693f.js",import.meta.url).href;r.config.setModuleUrl("ace/mode/json",B);r.config.setModuleUrl("ace/mode/json",H);r.config.setModuleUrl("ace/mode/xml",L);r.config.setModuleUrl("ace/theme/xcode",k);r.config.setModuleUrl("ace/ext-language/tools",N);const X={name:"Document",components:{editor:E,CopyOutlined:T,DownloadOutlined:z,EditorShow:A(()=>j(()=>import("./EditorShow-ca5e9aba.js"),["./EditorShow-ca5e9aba.js","./index-2c86cef6.js","./index-39d45874.js","..\\css\\index-7ef90919.css","./ext-language_tools-824bb0b4.js"],import.meta.url))},props:{api:{type:Object,required:!0},swaggerInstance:{type:Object,required:!0}},setup(){const n=C(),e=D(()=>n.language),{messages:t}=x();return{language:e,messages:t}},data(){return{openApiRaw:"",name:"OpenAPI.json"}},created(){this.openApiRaw=I.json5stringify(this.api.openApiRaw),this.name=this.api.summary+"_OpenAPI.json",setTimeout(()=>{this.copyOpenApi()},500)},methods:{getCurrentI18nInstance(){return this.messages[this.language]},triggerDownloadOpen(){var n=this.openApiRaw,e=document.createElement("a"),t={},o=this.name,a=window.URL.createObjectURL(new Blob([n],{type:(t.type||"text/plain")+";charset="+(t.encoding||"utf-8")}));e.href=a,e.download=o||"file",e.click(),window.URL.revokeObjectURL(a)},copyOpenApi(){const n="btnCopyOpenApi"+this.api.id,e=new V("#"+n,{text:()=>this.openApiRaw});e.on("success",()=>{const o=this.getCurrentI18nInstance().message.copy.open.success;u.info(o)}),e.on("error",t=>{console.log(t);const o=this.getCurrentI18nInstance();console.log(o);const a=o.message.copy.open.fail;u.info(a)})}}},G={class:"document"},F={style:{"margin-top":"10px"},id:"knife4jDocumentOpenApiShowEditor"};function Q(n,e,t,o,a,g){const w=i("CopyOutlined"),d=P,_=i("DownloadOutlined"),O=S,h=i("editor-show");return R(),U("div",G,[s(O,{style:{"margin-top":"10px"}},{default:c(()=>[s(d,{type:"primary",id:"btnCopyOpenApi"+t.api.id},{default:c(()=>[s(w),l("span",null,m(n.$t("open.copy")),1)]),_:1},8,["id"]),s(d,{style:{"margin-left":"10px"},onClick:g.triggerDownloadOpen},{default:c(()=>[s(_),e[1]||(e[1]=M()),l("span",null,m(n.$t("open.download")),1)]),_:1},8,["onClick"])]),_:1}),l("div",F,[s(h,{value:a.openApiRaw,"onUpdate:value":e[0]||(e[0]=y=>a.openApiRaw=y),theme:"xcode"},null,8,["value"])])])}const te=b(X,[["render",Q]]);export{te as default};
|
@ -0,0 +1 @@
|
|||||||
|
function o(e){for(var c=e.length/6|0,n=new Array(c),a=0;a<c;)n[a]="#"+e.slice(a*6,++a*6);return n}const r=o("4e79a7f28e2ce1575976b7b259a14fedc949af7aa1ff9da79c755fbab0ab");export{r as s};
|
@ -0,0 +1 @@
|
|||||||
|
import{w as ln,c as H}from"./path-53f90ab3.js";import{bD as an,bE as M,bF as w,bG as rn,bH as y,aI as on,bI as j,bJ as _,bK as un,bL as t,bM as sn,bN as tn,bO as fn}from"./index-39d45874.js";function cn(l){return l.innerRadius}function yn(l){return l.outerRadius}function gn(l){return l.startAngle}function mn(l){return l.endAngle}function pn(l){return l&&l.padAngle}function dn(l,h,E,I,v,A,J,a){var O=E-l,i=I-h,n=J-v,m=a-A,r=m*O-n*i;if(!(r*r<y))return r=(n*(h-A)-m*(l-v))/r,[l+r*O,h+r*i]}function V(l,h,E,I,v,A,J){var a=l-E,O=h-I,i=(J?A:-A)/j(a*a+O*O),n=i*O,m=-i*a,r=l+n,s=h+m,f=E+n,c=I+m,K=(r+f)/2,o=(s+c)/2,p=f-r,g=c-s,R=p*p+g*g,b=v-A,T=r*c-f*s,q=(g<0?-1:1)*j(fn(0,b*b*R-T*T)),F=(T*g-p*q)/R,G=(-T*p-g*q)/R,P=(T*g+p*q)/R,d=(-T*p+g*q)/R,x=F-K,e=G-o,u=P-K,L=d-o;return x*x+e*e>u*u+L*L&&(F=P,G=d),{cx:F,cy:G,x01:-n,y01:-m,x11:F*(v/b-1),y11:G*(v/b-1)}}function vn(){var l=cn,h=yn,E=H(0),I=null,v=gn,A=mn,J=pn,a=null,O=ln(i);function i(){var n,m,r=+l.apply(this,arguments),s=+h.apply(this,arguments),f=v.apply(this,arguments)-rn,c=A.apply(this,arguments)-rn,K=un(c-f),o=c>f;if(a||(a=n=O()),s<r&&(m=s,s=r,r=m),!(s>y))a.moveTo(0,0);else if(K>on-y)a.moveTo(s*M(f),s*w(f)),a.arc(0,0,s,f,c,!o),r>y&&(a.moveTo(r*M(c),r*w(c)),a.arc(0,0,r,c,f,o));else{var p=f,g=c,R=f,b=c,T=K,q=K,F=J.apply(this,arguments)/2,G=F>y&&(I?+I.apply(this,arguments):j(r*r+s*s)),P=_(un(s-r)/2,+E.apply(this,arguments)),d=P,x=P,e,u;if(G>y){var L=sn(G/r*w(F)),z=sn(G/s*w(F));(T-=L*2)>y?(L*=o?1:-1,R+=L,b-=L):(T=0,R=b=(f+c)/2),(q-=z*2)>y?(z*=o?1:-1,p+=z,g-=z):(q=0,p=g=(f+c)/2)}var N=s*M(p),S=s*w(p),B=r*M(b),C=r*w(b);if(P>y){var Q=s*M(g),U=s*w(g),W=r*M(R),X=r*w(R),D;if(K<an)if(D=dn(N,S,W,X,Q,U,B,C)){var Y=N-D[0],Z=S-D[1],$=Q-D[0],k=U-D[1],nn=1/w(tn((Y*$+Z*k)/(j(Y*Y+Z*Z)*j($*$+k*k)))/2),en=j(D[0]*D[0]+D[1]*D[1]);d=_(P,(r-en)/(nn-1)),x=_(P,(s-en)/(nn+1))}else d=x=0}q>y?x>y?(e=V(W,X,N,S,s,x,o),u=V(Q,U,B,C,s,x,o),a.moveTo(e.cx+e.x01,e.cy+e.y01),x<P?a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,x,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,s,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),!o),a.arc(u.cx,u.cy,x,t(u.y11,u.x11),t(u.y01,u.x01),!o))):(a.moveTo(N,S),a.arc(0,0,s,p,g,!o)):a.moveTo(N,S),!(r>y)||!(T>y)?a.lineTo(B,C):d>y?(e=V(B,C,Q,U,r,-d,o),u=V(N,S,W,X,r,-d,o),a.lineTo(e.cx+e.x01,e.cy+e.y01),d<P?a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(u.y01,u.x01),!o):(a.arc(e.cx,e.cy,d,t(e.y01,e.x01),t(e.y11,e.x11),!o),a.arc(0,0,r,t(e.cy+e.y11,e.cx+e.x11),t(u.cy+u.y11,u.cx+u.x11),o),a.arc(u.cx,u.cy,d,t(u.y11,u.x11),t(u.y01,u.x01),!o))):a.arc(0,0,r,b,R,o)}if(a.closePath(),n)return a=null,n+""||null}return i.centroid=function(){var n=(+l.apply(this,arguments)+ +h.apply(this,arguments))/2,m=(+v.apply(this,arguments)+ +A.apply(this,arguments))/2-an/2;return[M(m)*n,w(m)*n]},i.innerRadius=function(n){return arguments.length?(l=typeof n=="function"?n:H(+n),i):l},i.outerRadius=function(n){return arguments.length?(h=typeof n=="function"?n:H(+n),i):h},i.cornerRadius=function(n){return arguments.length?(E=typeof n=="function"?n:H(+n),i):E},i.padRadius=function(n){return arguments.length?(I=n==null?null:typeof n=="function"?n:H(+n),i):I},i.startAngle=function(n){return arguments.length?(v=typeof n=="function"?n:H(+n),i):v},i.endAngle=function(n){return arguments.length?(A=typeof n=="function"?n:H(+n),i):A},i.padAngle=function(n){return arguments.length?(J=typeof n=="function"?n:H(+n),i):J},i.context=function(n){return arguments.length?(a=n??null,i):a},i}export{vn as a};
|
@ -0,0 +1 @@
|
|||||||
|
function t(r){return typeof r=="object"&&"length"in r?r:Array.from(r)}export{t as a};
|
@ -0,0 +1 @@
|
|||||||
|
import{by as r,bz as a}from"./index-39d45874.js";const s=(n,o)=>r.lang.round(a.parse(n)[o]),e=s;export{e as c};
|
@ -0,0 +1,2 @@
|
|||||||
|
import{p as A,d as v,s as G}from"./styles-b83b31c9-bf7847bb.js";import{a2 as S,a7 as y,a6 as B,a8 as W,av as $,aq as M,aw as I}from"./index-39d45874.js";import{G as O}from"./graph-7116798e.js";import{l as P}from"./layout-d873a927.js";import{l as X}from"./line-0fef878c.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";let H=0;const Y=function(i,a,t,o,p){const g=function(e){switch(e){case p.db.relationType.AGGREGATION:return"aggregation";case p.db.relationType.EXTENSION:return"extension";case p.db.relationType.COMPOSITION:return"composition";case p.db.relationType.DEPENDENCY:return"dependency";case p.db.relationType.LOLLIPOP:return"lollipop"}};a.points=a.points.filter(e=>!Number.isNaN(e.y));const s=a.points,c=X().x(function(e){return e.x}).y(function(e){return e.y}).curve($),n=i.append("path").attr("d",c(s)).attr("id","edge"+H).attr("class","relation");let r="";o.arrowMarkerAbsolute&&(r=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search,r=r.replace(/\(/g,"\\("),r=r.replace(/\)/g,"\\)")),t.relation.lineType==1&&n.attr("class","relation dashed-line"),t.relation.lineType==10&&n.attr("class","relation dotted-line"),t.relation.type1!=="none"&&n.attr("marker-start","url("+r+"#"+g(t.relation.type1)+"Start)"),t.relation.type2!=="none"&&n.attr("marker-end","url("+r+"#"+g(t.relation.type2)+"End)");let f,h;const x=a.points.length;let b=M.calcLabelPosition(a.points);f=b.x,h=b.y;let u,m,w,k;if(x%2!==0&&x>1){let e=M.calcCardinalityPosition(t.relation.type1!=="none",a.points,a.points[0]),d=M.calcCardinalityPosition(t.relation.type2!=="none",a.points,a.points[x-1]);y.debug("cardinality_1_point "+JSON.stringify(e)),y.debug("cardinality_2_point "+JSON.stringify(d)),u=e.x,m=e.y,w=d.x,k=d.y}if(t.title!==void 0){const e=i.append("g").attr("class","classLabel"),d=e.append("text").attr("class","label").attr("x",f).attr("y",h).attr("fill","red").attr("text-anchor","middle").text(t.title);window.label=d;const l=d.node().getBBox();e.insert("rect",":first-child").attr("class","box").attr("x",l.x-o.padding/2).attr("y",l.y-o.padding/2).attr("width",l.width+o.padding).attr("height",l.height+o.padding)}y.info("Rendering relation "+JSON.stringify(t)),t.relationTitle1!==void 0&&t.relationTitle1!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type1").attr("x",u).attr("y",m).attr("fill","black").attr("font-size","6").text(t.relationTitle1),t.relationTitle2!==void 0&&t.relationTitle2!=="none"&&i.append("g").attr("class","cardinality").append("text").attr("class","type2").attr("x",w).attr("y",k).attr("fill","black").attr("font-size","6").text(t.relationTitle2),H++},J=function(i,a,t,o){y.debug("Rendering class ",a,t);const p=a.id,g={id:p,label:a.id,width:0,height:0},s=i.append("g").attr("id",o.db.lookUpDomId(p)).attr("class","classGroup");let c;a.link?c=s.append("svg:a").attr("xlink:href",a.link).attr("target",a.linkTarget).append("text").attr("y",t.textHeight+t.padding).attr("x",0):c=s.append("text").attr("y",t.textHeight+t.padding).attr("x",0);let n=!0;a.annotations.forEach(function(d){const l=c.append("tspan").text("«"+d+"»");n||l.attr("dy",t.textHeight),n=!1});let r=C(a);const f=c.append("tspan").text(r).attr("class","title");n||f.attr("dy",t.textHeight);const h=c.node().getBBox().height;let x,b,u;if(a.members.length>0){x=s.append("line").attr("x1",0).attr("y1",t.padding+h+t.dividerMargin/2).attr("y2",t.padding+h+t.dividerMargin/2);const d=s.append("text").attr("x",t.padding).attr("y",h+t.dividerMargin+t.textHeight).attr("fill","white").attr("class","classText");n=!0,a.members.forEach(function(l){_(d,l,n,t),n=!1}),b=d.node().getBBox()}if(a.methods.length>0){u=s.append("line").attr("x1",0).attr("y1",t.padding+h+t.dividerMargin+b.height).attr("y2",t.padding+h+t.dividerMargin+b.height);const d=s.append("text").attr("x",t.padding).attr("y",h+2*t.dividerMargin+b.height+t.textHeight).attr("fill","white").attr("class","classText");n=!0,a.methods.forEach(function(l){_(d,l,n,t),n=!1})}const m=s.node().getBBox();var w=" ";a.cssClasses.length>0&&(w=w+a.cssClasses.join(" "));const e=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",m.width+2*t.padding).attr("height",m.height+t.padding+.5*t.dividerMargin).attr("class",w).node().getBBox().width;return c.node().childNodes.forEach(function(d){d.setAttribute("x",(e-d.getBBox().width)/2)}),a.tooltip&&c.insert("title").text(a.tooltip),x&&x.attr("x2",e),u&&u.attr("x2",e),g.width=e,g.height=m.height+t.padding+.5*t.dividerMargin,g},C=function(i){let a=i.id;return i.type&&(a+="<"+I(i.type)+">"),a},Z=function(i,a,t,o){y.debug("Rendering note ",a,t);const p=a.id,g={id:p,text:a.text,width:0,height:0},s=i.append("g").attr("id",p).attr("class","classGroup");let c=s.append("text").attr("y",t.textHeight+t.padding).attr("x",0);const n=JSON.parse(`"${a.text}"`).split(`
|
||||||
|
`);n.forEach(function(x){y.debug(`Adding line: ${x}`),c.append("tspan").text(x).attr("class","title").attr("dy",t.textHeight)});const r=s.node().getBBox(),h=s.insert("rect",":first-child").attr("x",0).attr("y",0).attr("width",r.width+2*t.padding).attr("height",r.height+n.length*t.textHeight+t.padding+.5*t.dividerMargin).node().getBBox().width;return c.node().childNodes.forEach(function(x){x.setAttribute("x",(h-x.getBBox().width)/2)}),g.width=h,g.height=r.height+n.length*t.textHeight+t.padding+.5*t.dividerMargin,g},_=function(i,a,t,o){const{displayText:p,cssStyle:g}=a.getDisplayDetails(),s=i.append("tspan").attr("x",o.padding).text(p);g!==""&&s.attr("style",a.cssStyle),t||s.attr("dy",o.textHeight)},N={getClassTitleString:C,drawClass:J,drawEdge:Y,drawNote:Z};let T={};const E=20,L=function(i){const a=Object.entries(T).find(t=>t[1].label===i);if(a)return a[0]},R=function(i){i.append("defs").append("marker").attr("id","extensionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),i.append("defs").append("marker").attr("id","extensionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z"),i.append("defs").append("marker").attr("id","compositionStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","compositionEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","aggregationStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","aggregationEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","dependencyStart").attr("class","extension").attr("refX",0).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),i.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},F=function(i,a,t,o){const p=S().class;T={},y.info("Rendering diagram "+i);const g=S().securityLevel;let s;g==="sandbox"&&(s=B("#i"+a));const c=g==="sandbox"?B(s.nodes()[0].contentDocument.body):B("body"),n=c.select(`[id='${a}']`);R(n);const r=new O({multigraph:!0});r.setGraph({isMultiGraph:!0}),r.setDefaultEdgeLabel(function(){return{}});const f=o.db.getClasses(),h=Object.keys(f);for(const e of h){const d=f[e],l=N.drawClass(n,d,p,o);T[l.id]=l,r.setNode(l.id,l),y.info("Org height: "+l.height)}o.db.getRelations().forEach(function(e){y.info("tjoho"+L(e.id1)+L(e.id2)+JSON.stringify(e)),r.setEdge(L(e.id1),L(e.id2),{relation:e},e.title||"DEFAULT")}),o.db.getNotes().forEach(function(e){y.debug(`Adding note: ${JSON.stringify(e)}`);const d=N.drawNote(n,e,p,o);T[d.id]=d,r.setNode(d.id,d),e.class&&e.class in f&&r.setEdge(e.id,L(e.class),{relation:{id1:e.id,id2:e.class,relation:{type1:"none",type2:"none",lineType:10}}},"DEFAULT")}),P(r),r.nodes().forEach(function(e){e!==void 0&&r.node(e)!==void 0&&(y.debug("Node "+e+": "+JSON.stringify(r.node(e))),c.select("#"+(o.db.lookUpDomId(e)||e)).attr("transform","translate("+(r.node(e).x-r.node(e).width/2)+","+(r.node(e).y-r.node(e).height/2)+" )"))}),r.edges().forEach(function(e){e!==void 0&&r.edge(e)!==void 0&&(y.debug("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(r.edge(e))),N.drawEdge(n,r.edge(e),r.edge(e).relation,p,o))});const u=n.node().getBBox(),m=u.width+E*2,w=u.height+E*2;W(n,w,m,p.useMaxWidth);const k=`${u.x-E} ${u.y-E} ${m} ${w}`;y.debug(`viewBox ${k}`),n.attr("viewBox",k)},U={draw:F},tt={parser:A,db:v,renderer:U,styles:G,init:i=>{i.class||(i.class={}),i.class.arrowMarkerAbsolute=i.arrowMarkerAbsolute,v.clear()}};export{tt as diagram};
|
@ -0,0 +1,2 @@
|
|||||||
|
import{p as M,d as _,s as R}from"./styles-b83b31c9-bf7847bb.js";import{a7 as d,a2 as c,a6 as w,aq as B,aj as G,af as D,ai as E,ae as C,aa as A}from"./index-39d45874.js";import{G as q}from"./graph-7116798e.js";import{r as z}from"./index-01f381cb-4329afe2.js";import"./layout-d873a927.js";import"./clone-d27f3d34.js";import"./edges-066a5561-9f2960e3.js";import"./createText-ca0c5216-345c94dd.js";import"./line-0fef878c.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";const S=s=>A.sanitizeText(s,c());let k={dividerMargin:10,padding:5,textHeight:10,curve:void 0};const P=function(s,t,y,a){const e=Object.keys(s);d.info("keys:",e),d.info(s),e.forEach(function(i){var o,r;const l=s[i],p={shape:"rect",id:l.id,domId:l.domId,labelText:S(l.id),labelStyle:"",style:"fill: none; stroke: black",padding:((o=c().flowchart)==null?void 0:o.padding)??((r=c().class)==null?void 0:r.padding)};t.setNode(l.id,p),$(l.classes,t,y,a,l.id),d.info("setNode",p)})},$=function(s,t,y,a,e){const i=Object.keys(s);d.info("keys:",i),d.info(s),i.filter(o=>s[o].parent==e).forEach(function(o){var r,l;const n=s[o],p=n.cssClasses.join(" "),f=D(n.styles),h=n.label??n.id,b=0,m="class_box",u={labelStyle:f.labelStyle,shape:m,labelText:S(h),classData:n,rx:b,ry:b,class:p,style:f.style,id:n.id,domId:n.domId,tooltip:a.db.getTooltip(n.id,e)||"",haveCallback:n.haveCallback,link:n.link,width:n.type==="group"?500:void 0,type:n.type,padding:((r=c().flowchart)==null?void 0:r.padding)??((l=c().class)==null?void 0:l.padding)};t.setNode(n.id,u),e&&t.setParent(n.id,e),d.info("setNode",u)})},F=function(s,t,y,a){d.info(s),s.forEach(function(e,i){var o,r;const l=e,n="",p={labelStyle:"",style:""},f=l.text,h=0,b="note",m={labelStyle:p.labelStyle,shape:b,labelText:S(f),noteData:l,rx:h,ry:h,class:n,style:p.style,id:l.id,domId:l.id,tooltip:"",type:"note",padding:((o=c().flowchart)==null?void 0:o.padding)??((r=c().class)==null?void 0:r.padding)};if(t.setNode(l.id,m),d.info("setNode",m),!l.class||!(l.class in a))return;const u=y+i,x={id:`edgeNote${u}`,classes:"relation",pattern:"dotted",arrowhead:"none",startLabelRight:"",endLabelLeft:"",arrowTypeStart:"none",arrowTypeEnd:"none",style:"fill:none",labelStyle:"",curve:E(k.curve,C)};t.setEdge(l.id,l.class,x,u)})},H=function(s,t){const y=c().flowchart;let a=0;s.forEach(function(e){var i;a++;const o={classes:"relation",pattern:e.relation.lineType==1?"dashed":"solid",id:`id_${e.id1}_${e.id2}_${a}`,arrowhead:e.type==="arrow_open"?"none":"normal",startLabelRight:e.relationTitle1==="none"?"":e.relationTitle1,endLabelLeft:e.relationTitle2==="none"?"":e.relationTitle2,arrowTypeStart:N(e.relation.type1),arrowTypeEnd:N(e.relation.type2),style:"fill:none",labelStyle:"",curve:E(y==null?void 0:y.curve,C)};if(d.info(o,e),e.style!==void 0){const r=D(e.style);o.style=r.style,o.labelStyle=r.labelStyle}e.text=e.title,e.text===void 0?e.style!==void 0&&(o.arrowheadStyle="fill: #333"):(o.arrowheadStyle="fill: #333",o.labelpos="c",((i=c().flowchart)==null?void 0:i.htmlLabels)??c().htmlLabels?(o.labelType="html",o.label='<span class="edgeLabel">'+e.text+"</span>"):(o.labelType="text",o.label=e.text.replace(A.lineBreakRegex,`
|
||||||
|
`),e.style===void 0&&(o.style=o.style||"stroke: #333; stroke-width: 1.5px;fill:none"),o.labelStyle=o.labelStyle.replace("color:","fill:"))),t.setEdge(e.id1,e.id2,o,a)})},V=function(s){k={...k,...s}},W=async function(s,t,y,a){d.info("Drawing class - ",t);const e=c().flowchart??c().class,i=c().securityLevel;d.info("config:",e);const o=(e==null?void 0:e.nodeSpacing)??50,r=(e==null?void 0:e.rankSpacing)??50,l=new q({multigraph:!0,compound:!0}).setGraph({rankdir:a.db.getDirection(),nodesep:o,ranksep:r,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),n=a.db.getNamespaces(),p=a.db.getClasses(),f=a.db.getRelations(),h=a.db.getNotes();d.info(f),P(n,l,t,a),$(p,l,t,a),H(f,l),F(h,l,f.length+1,p);let b;i==="sandbox"&&(b=w("#i"+t));const m=i==="sandbox"?w(b.nodes()[0].contentDocument.body):w("body"),u=m.select(`[id="${t}"]`),x=m.select("#"+t+" g");if(await z(x,l,["aggregation","extension","composition","dependency","lollipop"],"classDiagram",t),B.insertTitle(u,"classTitleText",(e==null?void 0:e.titleTopMargin)??5,a.db.getDiagramTitle()),G(l,u,e==null?void 0:e.diagramPadding,e==null?void 0:e.useMaxWidth),!(e!=null&&e.htmlLabels)){const T=i==="sandbox"?b.nodes()[0].contentDocument:document,I=T.querySelectorAll('[id="'+t+'"] .edgeLabel .label');for(const g of I){const L=g.getBBox(),v=T.createElementNS("http://www.w3.org/2000/svg","rect");v.setAttribute("rx",0),v.setAttribute("ry",0),v.setAttribute("width",L.width),v.setAttribute("height",L.height),g.insertBefore(v,g.firstChild)}}};function N(s){let t;switch(s){case 0:t="aggregation";break;case 1:t="extension";break;case 2:t="composition";break;case 3:t="dependency";break;case 4:t="lollipop";break;default:t="none"}return t}const J={setConf:V,draw:W},le={parser:M,db:_,renderer:J,styles:R,init:s=>{s.class||(s.class={}),s.class.arrowMarkerAbsolute=s.arrowMarkerAbsolute,_.clear()}};export{le as diagram};
|
@ -0,0 +1 @@
|
|||||||
|
import{bC as r}from"./index-39d45874.js";var e=4;function a(o){return r(o,e)}export{a as c};
|
@ -0,0 +1 @@
|
|||||||
|
const I=""+new URL("mode-json-d377560b.js",import.meta.url).href,l=""+new URL("mode-xml-6468964d.js",import.meta.url).href,Z="data:application/javascript;base64,YWNlLmRlZmluZSgiYWNlL3RoZW1lL3hjb2RlLmNzcyIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe21vZHVsZS5leHBvcnRzID0gIi8qIFRISVMgVEhFTUUgV0FTIEFVVE9HRU5FUkFURUQgQlkgVGhlbWUudG1wbC5jc3MgKFVVSUQ6IEVFM0FEMTcwLTJCN0YtNERFMS1CNzI0LUM3NUYxM0ZFMDA4NSkgKi9cblxuLmFjZS14Y29kZSAuYWNlX2d1dHRlciB7XG4gIGJhY2tncm91bmQ6ICNlOGU4ZTg7XG4gIGNvbG9yOiAjMzMzXG59XG5cbi5hY2UteGNvZGUgLmFjZV9wcmludC1tYXJnaW4ge1xuICB3aWR0aDogMXB4O1xuICBiYWNrZ3JvdW5kOiAjZThlOGU4XG59XG5cbi5hY2UteGNvZGUge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjRkZGRkZGO1xuICBjb2xvcjogIzAwMDAwMFxufVxuXG4uYWNlLXhjb2RlIC5hY2VfY3Vyc29yIHtcbiAgY29sb3I6ICMwMDAwMDBcbn1cblxuLmFjZS14Y29kZSAuYWNlX21hcmtlci1sYXllciAuYWNlX3NlbGVjdGlvbiB7XG4gIGJhY2tncm91bmQ6ICNCNUQ1RkZcbn1cblxuLmFjZS14Y29kZS5hY2VfbXVsdGlzZWxlY3QgLmFjZV9zZWxlY3Rpb24uYWNlX3N0YXJ0IHtcbiAgYm94LXNoYWRvdzogMCAwIDNweCAwcHggI0ZGRkZGRjtcbn1cblxuLmFjZS14Y29kZSAuYWNlX21hcmtlci1sYXllciAuYWNlX3N0ZXAge1xuICBiYWNrZ3JvdW5kOiByZ2IoMTk4LCAyMTksIDE3NClcbn1cblxuLmFjZS14Y29kZSAuYWNlX21hcmtlci1sYXllciAuYWNlX2JyYWNrZXQge1xuICBtYXJnaW46IC0xcHggMCAwIC0xcHg7XG4gIGJvcmRlcjogMXB4IHNvbGlkICNCRkJGQkZcbn1cblxuLmFjZS14Y29kZSAuYWNlX21hcmtlci1sYXllciAuYWNlX2FjdGl2ZS1saW5lIHtcbiAgYmFja2dyb3VuZDogcmdiYSgwLCAwLCAwLCAwLjA3MSlcbn1cblxuLmFjZS14Y29kZSAuYWNlX2d1dHRlci1hY3RpdmUtbGluZSB7XG4gIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC4wNzEpXG59XG5cbi5hY2UteGNvZGUgLmFjZV9tYXJrZXItbGF5ZXIgLmFjZV9zZWxlY3RlZC13b3JkIHtcbiAgYm9yZGVyOiAxcHggc29saWQgI0I1RDVGRlxufVxuXG4uYWNlLXhjb2RlIC5hY2VfY29uc3RhbnQuYWNlX2xhbmd1YWdlLFxuLmFjZS14Y29kZSAuYWNlX2tleXdvcmQsXG4uYWNlLXhjb2RlIC5hY2VfbWV0YSxcbi5hY2UteGNvZGUgLmFjZV92YXJpYWJsZS5hY2VfbGFuZ3VhZ2Uge1xuICBjb2xvcjogI0M4MDBBNFxufVxuXG4uYWNlLXhjb2RlIC5hY2VfaW52aXNpYmxlIHtcbiAgY29sb3I6ICNCRkJGQkZcbn1cblxuLmFjZS14Y29kZSAuYWNlX2NvbnN0YW50LmFjZV9jaGFyYWN0ZXIsXG4uYWNlLXhjb2RlIC5hY2VfY29uc3RhbnQuYWNlX290aGVyIHtcbiAgY29sb3I6ICMyNzVBNUVcbn1cblxuLmFjZS14Y29kZSAuYWNlX2NvbnN0YW50LmFjZV9udW1lcmljIHtcbiAgY29sb3I6ICMzQTAwRENcbn1cblxuLmFjZS14Y29kZSAuYWNlX2VudGl0eS5hY2Vfb3RoZXIuYWNlX2F0dHJpYnV0ZS1uYW1lLFxuLmFjZS14Y29kZSAuYWNlX3N1cHBvcnQuYWNlX2NvbnN0YW50LFxuLmFjZS14Y29kZSAuYWNlX3N1cHBvcnQuYWNlX2Z1bmN0aW9uIHtcbiAgY29sb3I6ICM0NTAwODRcbn1cblxuLmFjZS14Y29kZSAuYWNlX2ZvbGQge1xuICBiYWNrZ3JvdW5kLWNvbG9yOiAjQzgwMEE0O1xuICBib3JkZXItY29sb3I6ICMwMDAwMDBcbn1cblxuLmFjZS14Y29kZSAuYWNlX2VudGl0eS5hY2VfbmFtZS5hY2VfdGFnLFxuLmFjZS14Y29kZSAuYWNlX3N1cHBvcnQuYWNlX2NsYXNzLFxuLmFjZS14Y29kZSAuYWNlX3N1cHBvcnQuYWNlX3R5cGUge1xuICBjb2xvcjogIzc5MEVBRFxufVxuXG4uYWNlLXhjb2RlIC5hY2Vfc3RvcmFnZSB7XG4gIGNvbG9yOiAjQzkwMEE0XG59XG5cbi5hY2UteGNvZGUgLmFjZV9zdHJpbmcge1xuICBjb2xvcjogI0RGMDAwMlxufVxuXG4uYWNlLXhjb2RlIC5hY2VfY29tbWVudCB7XG4gIGNvbG9yOiAjMDA4RTAwXG59XG5cbi5hY2UteGNvZGUgLmFjZV9pbmRlbnQtZ3VpZGUge1xuICBiYWNrZ3JvdW5kOiB1cmwoZGF0YTppbWFnZS9wbmc7YmFzZTY0LGlWQk9SdzBLR2dvQUFBQU5TVWhFVWdBQUFBRUFBQUFDQ0FZQUFBQ1pnYlluQUFBQUUwbEVRVlFJbVdQNC8vLy9mNGJMbHkvL0J3QW1WZ2QxL3cxMS9nQUFBQUJKUlU1RXJrSmdnZz09KSByaWdodCByZXBlYXQteVxufVxuXG4uYWNlLXhjb2RlIC5hY2VfaW5kZW50LWd1aWRlLWFjdGl2ZSB7XG4gIGJhY2tncm91bmQ6IHVybChcImRhdGE6aW1hZ2UvcG5nO2Jhc2U2NCxpVkJPUncwS0dnb0FBQUFOU1VoRVVnQUFBQUVBQUFBQ0NBWUFBQUNaZ2JZbkFBQUFDWEJJV1hNQUFBc1RBQUFMRXdFQW1wd1lBQUFBSUdOSVVrMEFBSG9sQUFDQWd3QUErZjhBQUlEcEFBQjFNQUFBNm1BQUFEcVlBQUFYYjVKZnhVWUFBQUFaU1VSQlZIamFZdmovLy85L2hpdkt5djhCQUFBQS8vOERBQ0xxQmhidmsrL2VBQUFBQUVsRlRrU3VRbUNDXCIpIHJpZ2h0IHJlcGVhdC15O1xufSBcbiI7Cgp9KTsKCmFjZS5kZWZpbmUoImFjZS90aGVtZS94Y29kZSIsWyJyZXF1aXJlIiwiZXhwb3J0cyIsIm1vZHVsZSIsImFjZS90aGVtZS94Y29kZS5jc3MiLCJhY2UvbGliL2RvbSJdLCBmdW5jdGlvbihyZXF1aXJlLCBleHBvcnRzLCBtb2R1bGUpe2V4cG9ydHMuaXNEYXJrID0gZmFsc2U7CmV4cG9ydHMuY3NzQ2xhc3MgPSAiYWNlLXhjb2RlIjsKZXhwb3J0cy5jc3NUZXh0ID0gcmVxdWlyZSgiLi94Y29kZS5jc3MiKTsKdmFyIGRvbSA9IHJlcXVpcmUoIi4uL2xpYi9kb20iKTsKZG9tLmltcG9ydENzc1N0cmluZyhleHBvcnRzLmNzc1RleHQsIGV4cG9ydHMuY3NzQ2xhc3MsIGZhbHNlKTsKCn0pOyAgICAgICAgICAgICAgICAoZnVuY3Rpb24oKSB7CiAgICAgICAgICAgICAgICAgICAgYWNlLnJlcXVpcmUoWyJhY2UvdGhlbWUveGNvZGUiXSwgZnVuY3Rpb24obSkgewogICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIG1vZHVsZSA9PSAib2JqZWN0IiAmJiB0eXBlb2YgZXhwb3J0cyA9PSAib2JqZWN0IiAmJiBtb2R1bGUpIHsKICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZHVsZS5leHBvcnRzID0gbTsKICAgICAgICAgICAgICAgICAgICAgICAgfQogICAgICAgICAgICAgICAgICAgIH0pOwogICAgICAgICAgICAgICAgfSkoKTsKICAgICAgICAgICAg",Y=""+new URL("ext-language_tools-ec14926a.js",import.meta.url).href;export{l as a,Y as e,I as m,Z as t};
|
@ -0,0 +1 @@
|
|||||||
|
import{p as e,f as o}from"./flowDb-c1833063-ed5895f1.js";import{f as t,g as a}from"./styles-483fbfea-7a953868.js";import{ak as i}from"./index-39d45874.js";import"./graph-7116798e.js";import"./layout-d873a927.js";import"./index-01f381cb-4329afe2.js";import"./clone-d27f3d34.js";import"./edges-066a5561-9f2960e3.js";import"./createText-ca0c5216-345c94dd.js";import"./line-0fef878c.js";import"./array-9f3ba611.js";import"./path-53f90ab3.js";import"./channel-aad847b8.js";const M={parser:e,db:o,renderer:t,styles:a,init:r=>{r.flowchart||(r.flowchart={}),r.flowchart.arrowMarkerAbsolute=r.arrowMarkerAbsolute,i({flowchart:{arrowMarkerAbsolute:r.arrowMarkerAbsolute}}),t.setConf(r.flowchart),o.clear(),o.setGen("gen-2")}};export{M as diagram};
|