feat(server): 添加浏览器内 OpenAPI 调试页及诊断入口

* 新增 DebugConsoleController,提供 /debug 纯内嵌调试页
  - 零外部依赖,基于 Swagger JSON 自动生成各端点表单
  - 与 Swagger:Enabled 同步开关,避免生产环境误暴露
* 启用 <GenerateDocumentationFile>,将 XML 注释注入 OpenAPI
  - 调试页与 Swagger UI 共用同一份端点标题和说明
* 为 Health/Status/LegacyHttpApi 控制器添加 Tags 分组
* 补充 VS Code launch.json 与 tasks.json,支持现场调试
* 新增 DebugConsoleEndpointTests 覆盖调试页基础响应
* 同步更新 README 进度与待办清单
This commit is contained in:
2026-04-27 10:33:53 +08:00
parent 69fa3edd89
commit 0292e077ff
12 changed files with 1650 additions and 12 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -6,6 +6,7 @@ namespace Flyshot.Server.Host.Controllers;
/// 提供宿主基础探活与诊断接口。
/// </summary>
[ApiController]
[Tags("基础与状态")]
public sealed class HealthController : ControllerBase
{
/// <summary>

View File

@@ -8,6 +8,7 @@ namespace Flyshot.Server.Host.Controllers;
/// 提供对 `flyshot-uaes-interface` 既有 FastAPI HTTP 路由层的一比一 MVC 兼容控制器。
/// </summary>
[ApiController]
[Tags("ControllerClient 兼容")]
public sealed class LegacyHttpApiController : ControllerBase
{
private readonly IControllerClientCompatService _compatService;
@@ -431,6 +432,8 @@ public sealed class LegacyHttpApiController : ControllerBase
/// 兼容旧 `/execute_trajectory/` 路由,并接受两种历史请求体形状。
/// </summary>
/// <param name="waypoints">轨迹请求体。</param>
/// <param name="method">查询字符串中的 method 覆盖值(兼容历史调用方式)。</param>
/// <param name="save_traj">查询字符串中的 save_traj 覆盖值(兼容历史调用方式)。</param>
/// <returns>旧 FastAPI 层风格的状态响应。</returns>
[HttpPost("/execute_trajectory/")]
public IActionResult ExecuteTrajectory(

View File

@@ -7,6 +7,7 @@ namespace Flyshot.Server.Host.Controllers;
/// 提供只读状态监控页面和控制器状态快照 API。
/// </summary>
[ApiController]
[Tags("基础与状态")]
public sealed class StatusController : ControllerBase
{
/// <summary>
@@ -84,6 +85,30 @@ public sealed class StatusController : ControllerBase
cursor: default;
}
/* 顶部操作区按钮和外链按钮共用同一组视觉样式,便于现场顺手跳转。 */
.actions {
display: flex;
align-items: center;
gap: 10px;
}
.link-button {
display: inline-flex;
align-items: center;
min-height: 36px;
padding: 0 14px;
border: 1px solid var(--accent);
border-radius: 6px;
background: transparent;
color: var(--accent);
font: inherit;
text-decoration: none;
}
.link-button:hover {
background: rgba(0, 124, 137, 0.08);
}
main {
width: min(1180px, calc(100% - 32px));
margin: 22px auto;
@@ -216,7 +241,10 @@ public sealed class StatusController : ControllerBase
<header>
<div class="topbar">
<h1>Flyshot Replacement </h1>
<button id="refresh" type="button"></button>
<div class="actions">
<a class="link-button" href="/debug" target="_blank" rel="noopener"></a>
<button id="refresh" type="button"></button>
</div>
</div>
</header>
<main>