You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1015 B

useCommandProgress 设计

目标

把 MonitorView 内指令进度状态机(COMMAND_STATUScommandProgress、轮询、起停、按钮状态文案)抽到 src/composables/useCommandProgress.jsrunCommand 一并迁入,依赖通过参数注入。

非目标

  • 不改 CommandProgressFloat UI
  • 不改 devices.sendCommand API
  • 不抽直播 / 地图

契约

const {
  commandProgress,
  commandProgressTerminalLabel,
  buttonStatusText,
  startCommandProgress,
  closeCommandProgress,
  runCommand,
} = useCommandProgress({
  getRecord: () => record.value,
  ui,
  devices,
  reload,
})
  • Escape / onUnmounted 仍由页面调 closeCommandProgress
  • 轮询仍用 request + urls.COMMAND

实现

  1. 新建 composable;MonitorView 删除内联命令块并接线
  2. Commit: refactor: 抽取 useCommandProgress 指令进度逻辑
  3. 冒烟:打开浮层(evaluate start 或 mock 下发)+ 关闭

约束

精确 git add;中文 commit;新建 src/composables/