mirror of
https://github.com/FastTunnel/FastTunnel.git
synced 2025-02-08 02:39:29 +08:00
2.0.1
This commit is contained in:
parent
56bd3ecf50
commit
0ea598a134
|
@ -18,7 +18,7 @@
|
|||
<RepositoryType>git</RepositoryType>
|
||||
<PackageTags>FastTunnel.Core</PackageTags>
|
||||
<PackageReleaseNotes>FastTunnel.Core</PackageReleaseNotes>
|
||||
<Version>2.0.0</Version>
|
||||
<Version>2.0.1</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
using FastTunnel.Server.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FastTunnel.Server.Controllers
|
||||
{
|
||||
[Route("api/[controller]/[action]")]
|
||||
[ApiController]
|
||||
public class BaseController : ControllerBase
|
||||
{
|
||||
protected ApiResponse ApiResponse = new ApiResponse();
|
||||
}
|
||||
}
|
|
@ -1,78 +0,0 @@
|
|||
using FastTunnel.Core.Client;
|
||||
using FastTunnel.Server.Controllers;
|
||||
using FastTunnel.Server.Models;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FastTunnel.Server
|
||||
{
|
||||
public class SystemController : BaseController
|
||||
{
|
||||
FastTunnelServer fastTunnelServer;
|
||||
|
||||
public SystemController(FastTunnelServer fastTunnelServer)
|
||||
{
|
||||
this.fastTunnelServer = fastTunnelServer;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前等待响应的请求数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ApiResponse GetResponseTempCount()
|
||||
{
|
||||
ApiResponse.data = fastTunnelServer.ResponseTasks.Count;
|
||||
return ApiResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前映射的所有站点信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ApiResponse GetAllWebList()
|
||||
{
|
||||
ApiResponse.data = fastTunnelServer.WebList.Select(x => new { x.Key, x.Value.WebConfig.LocalIp, x.Value.WebConfig.LocalPort });
|
||||
return ApiResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取服务端配置信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ApiResponse GetServerOption()
|
||||
{
|
||||
ApiResponse.data = fastTunnelServer.ServerOption;
|
||||
return ApiResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取所有端口转发映射列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ApiResponse GetAllForwardList()
|
||||
{
|
||||
ApiResponse.data = fastTunnelServer.ForwardList.Select(x => new { x.Key, x.Value.SSHConfig.LocalIp, x.Value.SSHConfig.LocalPort, x.Value.SSHConfig.RemotePort });
|
||||
|
||||
return ApiResponse;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取当前客户端在线数量
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpGet]
|
||||
public ApiResponse GetOnlineClientCount()
|
||||
{
|
||||
ApiResponse.data = fastTunnelServer.ConnectedClientCount;
|
||||
return ApiResponse;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,13 @@
|
|||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Compile Remove="logs\**" />
|
||||
<Content Remove="logs\**" />
|
||||
<EmbeddedResource Remove="logs\**" />
|
||||
<None Remove="logs\**" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.WindowsServices" Version="5.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0-preview.4.21253.7" />
|
||||
|
@ -17,6 +24,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FastTunnel.Api\FastTunnel.Api.csproj" />
|
||||
<ProjectReference Include="..\FastTunnel.Core\FastTunnel.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FastTunnel.Server.Models
|
||||
{
|
||||
public class ApiResponse
|
||||
{
|
||||
/// <summary>
|
||||
/// 错误码
|
||||
/// 0 成功,其他为失败
|
||||
/// </summary>
|
||||
public ErrorCodeEnum errorCode { get; set; }
|
||||
|
||||
public string errorMessage { get; set; }
|
||||
|
||||
public object data { get; set; }
|
||||
}
|
||||
|
||||
public enum ErrorCodeEnum
|
||||
{
|
||||
NONE = 0,
|
||||
}
|
||||
}
|
|
@ -11,8 +11,8 @@
|
|||
"profiles": {
|
||||
"FastTunnel.Server": {
|
||||
"commandName": "Project",
|
||||
//"launchBrowser": true,
|
||||
"launchUrl": "",
|
||||
"launchBrowser": true,
|
||||
"launchUrl": "http://localhost:1270/swagger",
|
||||
"applicationUrl": "https://localhost:5001;http://localhost:5000",
|
||||
"environmentVariables": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
|
|
|
@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FastTunnel.Server", "FastTu
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core", "Core", "{0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FastTunnel.Api", "FastTunnel.Api\FastTunnel.Api.csproj", "{7D560A9A-E480-40F4-AAF7-398447438255}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
|
@ -29,12 +31,17 @@ Global
|
|||
{DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{DEF2E322-9075-4C3F-9967-7EAF0EE28CEB}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7D560A9A-E480-40F4-AAF7-398447438255}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7D560A9A-E480-40F4-AAF7-398447438255}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7D560A9A-E480-40F4-AAF7-398447438255}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7D560A9A-E480-40F4-AAF7-398447438255}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{C8ADFEB1-59DB-4CE3-8D04-5B547107BCCB} = {0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C}
|
||||
{7D560A9A-E480-40F4-AAF7-398447438255} = {0E2A9DA2-26AE-4657-B4C5-3A913E2F5A3C}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {3D9C6B44-6706-4EE8-9043-802BBE474A2E}
|
||||
|
|
Loading…
Reference in New Issue
Block a user