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
1015 B
useCommandProgress 设计
目标
把 MonitorView 内指令进度状态机(COMMAND_STATUS、commandProgress、轮询、起停、按钮状态文案)抽到 src/composables/useCommandProgress.js。runCommand 一并迁入,依赖通过参数注入。
非目标
- 不改 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
实现
- 新建 composable;MonitorView 删除内联命令块并接线
- Commit:
refactor: 抽取 useCommandProgress 指令进度逻辑 - 冒烟:打开浮层(evaluate start 或 mock 下发)+ 关闭
约束
精确 git add;中文 commit;新建 src/composables/