- YARP: map-edit/ai-config 全方法、reflection 写方法挂 PlatformScope, reflection/selection 单独放行(运营端 3D 高亮),堵住运营账号直达地图编辑/反射调用 - goto-site 探测改用不存在的 car/-1(消除健康检查真实派车风险)并加 60s 缓存 - Config PUT 按 scope 收紧:RCSMonitor 仅可写 ops 节;wizard 写操作与 simplelite/restart-for-update 限 PlatformScope;/api/health 去除虚假端口表 - 修复 wms 模块菜单裁剪失效(admin-config-location → admin-config-facility) - vrHost 默认 location.hostname:8223(新增 utils/vrender.ts),远程访问 3D 视口可用 - /status 页改接真实 /api/health* 诊断;uploadAsset 移除矛盾 multipart 头; mapsApi.merge 对齐 save 的 409 冲突处理;JWT 验签参数改启动期 DI 一次性配置 - 清理死代码:ProjectionController、DataTablePro、useClipboard、CadToolbarView、 AppShell 未用导入;lint 脚本替换为 typecheck;日志窗口 List 改 Queue
50 lines
1.8 KiB
C#
50 lines
1.8 KiB
C#
using Microsoft.AspNetCore.Authorization;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using MiGu.Server.Launcher;
|
|
|
|
namespace MiGu.Server.Controllers;
|
|
|
|
[ApiController]
|
|
[Route("api/health")]
|
|
public class HealthController : ControllerBase
|
|
{
|
|
private static readonly DateTimeOffset StartTime = DateTimeOffset.UtcNow;
|
|
private readonly SimpleLiteLauncher _launcher;
|
|
|
|
public HealthController(SimpleLiteLauncher launcher) => _launcher = launcher;
|
|
|
|
/// <summary>匿名存活探针:仅返回进程级状态,不暴露端口拓扑等部署细节。</summary>
|
|
[HttpGet]
|
|
public IActionResult Get()
|
|
{
|
|
return Ok(new
|
|
{
|
|
status = "ok",
|
|
startTime = StartTime,
|
|
uptimeSec = (long)(DateTimeOffset.UtcNow - StartTime).TotalSeconds
|
|
});
|
|
}
|
|
|
|
/// <summary>
|
|
/// SimpleLite 拉起配置诊断:查看当前 ExecutablePath、解析结果、端口是否已有服务。
|
|
/// 配置位置:<c>MiGu.Server/appsettings.json</c> → <c>SimpleLite</c> 节点。
|
|
/// 含服务器本地路径等敏感信息,要求登录。
|
|
/// </summary>
|
|
[HttpGet("simplelite")]
|
|
[Authorize]
|
|
public IActionResult GetSimpleLiteDiagnostics() => Ok(_launcher.GetDiagnostics());
|
|
|
|
/// <summary>
|
|
/// 关闭 SimpleLite、同步最新 DLL、重新拉起。用于「前往站点」API 缺失时一键更新。
|
|
/// 会终止本机全部 SimpleLite 进程并重启,仅 Platform 管理端可调。
|
|
/// </summary>
|
|
[HttpPost("simplelite/restart-for-update")]
|
|
[Authorize(Policy = "PlatformScope")]
|
|
public IActionResult RestartSimpleLiteForUpdate([FromQuery] string launchMode = "webonly")
|
|
{
|
|
var result = _launcher.RestartForUpdate(launchMode);
|
|
var diag = _launcher.GetDiagnostics();
|
|
return Ok(new { restart = result, diagnostics = diag });
|
|
}
|
|
}
|