diff --git a/.gitignore b/.gitignore index 6e6a227..38e2f31 100644 --- a/.gitignore +++ b/.gitignore @@ -6,15 +6,13 @@ *.cache *.dll *.pdb -!**/wwwroot/**/*.dll # MiGu.Server 运行时数据(含敏感 token) MiGu.Server/data/*.json MiGu.Server/data/.internal-token -# 可选:若希望 wwwroot 仅 CI 产出、不入库,取消下行注释 -# MiGu.Server/wwwroot/assets/ -# MiGu.Server/wwwroot/index.html +# 前端构建产物,由 CI / npm run build 产出,不入库 +MiGu.Server/wwwroot/ # IDE / OS .vs/ diff --git a/MiGu.Server/Configs/DeploymentProfile.cs b/MiGu.Server/Configs/DeploymentProfile.cs index 47408e0..5128002 100644 --- a/MiGu.Server/Configs/DeploymentProfile.cs +++ b/MiGu.Server/Configs/DeploymentProfile.cs @@ -35,15 +35,17 @@ public record DeploymentProfile( UpdatedBy: ""); /// - /// 导航方式 → SimpleLite 场景 id 映射。与 scene.json.idSimpleCore.Navigation.NavKind + /// 导航方式 → SimpleLite 场景 id 映射。与 *.scene.json.idSimpleCore.Navigation.NavKind /// 以及内核 active-scenes.json.activeScenes 一致;这是平台与内核之间「导航选型」的契约约定。 + /// 两平台制(StandardScene 拆分落地):磁导航 → scene.mag; + /// 二维码与激光共用融合平台 scene.qrlidar(激光坐标导航 + 二维码按轨道逐段触发,可融合可单用)。 /// public static readonly IReadOnlyDictionary NavKindToSceneId = new Dictionary(StringComparer.OrdinalIgnoreCase) { - ["magnetic"] = "scene.magnetic", - ["qrcode"] = "scene.qrcode", - ["laser"] = "scene.laser", + ["magnetic"] = "scene.mag", + ["qrcode"] = "scene.qrlidar", + ["laser"] = "scene.qrlidar", }; /// diff --git a/MiGu.Server/Controllers/WizardController.cs b/MiGu.Server/Controllers/WizardController.cs index d553244..56354a4 100644 --- a/MiGu.Server/Controllers/WizardController.cs +++ b/MiGu.Server/Controllers/WizardController.cs @@ -83,7 +83,10 @@ public class WizardController : ControllerBase // 平台 → 内核联动:把导航选型写入 SimpleLite 的 plugins/active-scenes.json(下次启动选择性加载; // 已运行实例可由前端再调 POST /api/sl/projection/scenes/apply 触发增量 reload)。 - var sceneIds = profile.ToActiveSceneIds(); + // scene.device(门/充电桩/按钮盒驱动)为各类项目通用能力,向导暂无独立选项,固定并入激活集合; + // scene.vda5050 等协议插件保持按需(不在集合则不加载)。基座 StandardScene.dll 由内核按 + // 清单 requiresCore 自动 alwaysLoad,无需在此声明。 + var sceneIds = profile.ToActiveSceneIds().Concat(new[] { "scene.device" }).Distinct().ToList(); var write = _launcher.WriteActiveScenes(sceneIds, alwaysLoad: null, source: "deployment-profile"); _log.LogInformation("部署向导已保存 by={User} nav=[{Nav}] scenes=[{Scenes}] activeScenesWritten={Ok}", diff --git a/MiGu.Server/Launcher/SimpleLiteLauncher.cs b/MiGu.Server/Launcher/SimpleLiteLauncher.cs index 73669c1..d9055c5 100644 --- a/MiGu.Server/Launcher/SimpleLiteLauncher.cs +++ b/MiGu.Server/Launcher/SimpleLiteLauncher.cs @@ -261,6 +261,9 @@ public sealed class SimpleLiteLauncher : IDisposable private string BuildArguments(string displayMode, string extra) { var args = $"--display-mode={displayMode}"; + // 迷榖嵌入:平台 iframe 场景默认带 --migu,让 SimpleLite WebTerminal 默认纯画布(隐藏 ImGui panel), + // 业务 UI 由 Vue 平台前端接管;declare 时序失败时也安全回退到画布。可用 appsettings:SimpleLite:EmbeddedCanvas=false 关闭。 + if (_opts.EmbeddedCanvas) args += " --migu"; // 选择性加载:把平台写入的 plugins/active-scenes.json 同步透传为 --scenes(命令行优先级最高,与文件一致,双保险)。 var sceneArg = ReadActiveScenesArg(); if (!string.IsNullOrEmpty(sceneArg)) args += " " + sceneArg; diff --git a/MiGu.Server/Launcher/SimpleLiteOptions.cs b/MiGu.Server/Launcher/SimpleLiteOptions.cs index bf61d34..ba84c9e 100644 --- a/MiGu.Server/Launcher/SimpleLiteOptions.cs +++ b/MiGu.Server/Launcher/SimpleLiteOptions.cs @@ -57,4 +57,15 @@ public sealed class SimpleLiteOptions /// 一般只在临时联调期 / CI 流水线想自动清理时打开。 /// public bool FollowParent { get; set; } = false; + + /// + /// 平台拉起 SimpleLite 时是否以「迷榖嵌入画布」模式运行(透传命令行 --migu),默认 true。 + /// + /// true:平台 iframe 嵌入场景,SimpleLite WebTerminal 默认只显示 3D 画布、隐藏所有 ImGui panel, + /// 业务 UI 全部由 Vue 平台前端接管;declare 时序失败时也安全回退到纯画布。 + /// false:平台拉起的 SimpleLite web 端默认显示完整 panel(便于把平台拉起的实例直连 :8223 调试)。 + /// + /// 与 LaunchMode(web / web+local,是否保留本地调试窗口)正交,可任意组合。 + /// + public bool EmbeddedCanvas { get; set; } = true; }