Guides integration of 7 DJI Cloud API 2 frontend components (WaylineEditor, WaylineView, UranusDeviceManagerApp, FH2.loadCockpit, FlyDataReplay, DJILivePlayer, FH2.loadDeviceWindow) into Vue 3 or standalone HTML projects, covering init, auth, config, events, error codes, and CORS debugging.
Ships in cloudapi2. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
帮集成商开发者在 skeleton/web(Vue 3 + Vite + TypeScript) 项目或 独立 HTML 页面 中正确接入 DJI Cloud API 2 7 大组件,并准确处理初始化、鉴权、销毁、跨域等关键细节。
| 组件 | SDK 全局名 | 是否依赖 paas.js | 用途 |
|---|---|---|---|
| 航线编辑 | window.WaylineEditor | ❌ 自包含 | 航线创建 / 编辑 / 拼接 |
| 航线预览 | window.WaylineView | ❌ 自包含 | 航线只读预览(多航线同时渲染) |
| 设备管理 | window.UranusDeviceManagerApp | ❌ 自包含 | 设备列表、状态、管理 |
| 驾驶舱 | window.FH2.loadCockpit | ✅ 需要 paas.js | 实时视频直播 + 飞行控制 |
| 飞行记录 | window.FlyDataReplay | ❌ 自包含 | 飞行轨迹回放与分析 |
| 直播大屏 | window.DJILivePlayer | ❌ 完全独立 | 多路直播网格展示 |
| 设备小窗 | window.FH2.loadDeviceWindow | ✅ 需要 paas.js | 设备直播小窗浮层 |
useFH2、ensureFH2Init、CockpitView、WaylineView、useSDKLoader)WaylineEditor / WaylineView / FlyDataReplay / UranusDeviceManagerApp / DJILivePlayer / FH2.loadCockpit / FH2.loadDevice / FH2.loadDeviceWindow 的用法initConfig / frontHost / serverHost / wssHost / paas.js 加载cockpitConfig / setCockpitConfig / 驾驶舱模块显隐setupDeviceManager / mountDeviceList / 设备管理模块化挂载concatWayline / 航线拼接setTheme / setCockpitTheme / 主题 tokenshowDeviceTopo / map.topo不触发:通用前端问题(React/Vue/Webpack 之类)、DJI Mobile SDK、其他非 FH2 的 SDK。
本 Skill 遵循 skills/_shared/sop-template.md 定义的 7 章节 SOP。
根据用户请求自动选择执行深度(L1/L2/L3)。
IF 用户在 skeleton/web 项目中工作 → Vue 集成模式
ELIF 用户需要独立 HTML 页面 → 独立 HTML 模式
ELSE → 先问清楚
Vue 集成模式:参考 references/skeleton-integration.md,使用现有 composable 模式。
独立 HTML 模式:参考 snippets/standalone-html-template.html + 各组件 reference,输出完整 HTML。
弄清楚 3 个地址(缺一不可,自包含 SDK 除外):
| 信息 | 例子 | 说明 |
|---|---|---|
frontHost | http://<your-server> | 前端服务地址,能访问到 /paas.js 和 SDK 资源 |
serverHost | http://<your-server>:30812 | 后端接口地址(一般 frontHost + :30812) |
wssHost | ws://<your-server>:30812/... | WebSocket 地址 |
自包含 SDK(WaylineEditor / WaylineView / FlyDataReplay / DeviceManager / DJILivePlayer)不需要 paas.js,但仍需 serverHost(api.baseUrl)和 wssHost(ws.url)。
如果用户没提供,先问。不要编造 IP / 端口 / token。
Vue 模式下这些通过 .env 环境变量配置(VITE_FH2_ADDRESS / VITE_FH2_PORT),参考 useFH2Config.ts。
references/wayline-editor.mdreferences/wayline-view.mdreferences/device-manager.mdreferences/cockpit.mdreferences/fly-data-replay.mdreferences/multi-stream.mdreferences/device-window.mdreferences/theme.mdshowDeviceTopo / map.topo)→ 参考当前使用组件的 reference(wayline-editor.md 第八节 / wayline-view.md / fly-data-replay.md 第十节)references/api-overview.mdreferences/skeleton-integration.mdreferences/troubleshooting.md输出代码时必须附带以下提醒(constraints.yaml 中 critical 级别):
https:// + wss://,HTTP 用 http:// + ws://paas.js 先于 initConfig,initConfig 先于 loadXxxpaas.js,不调 initConfigdestroy() 旧实例destroy() 后重建)。DJILivePlayer 除外,它就是多实例拼网格hostUrl 字段不是废弃字段,是必填(non-optional)字段,必须传入前端服务地址;runtimeDepsBasePath + map.env.cesiumBaseUrl 是额外新增的依赖资源路径配置,与 hostUrl 同时传入,不是替代关系,不要删除 hostUrl报错或行为异常时查 references/troubleshooting.md(错误码表 + 常见坑 + Whistle 调试)。
参见 constraints.yaml,所有 level: critical 的规则在生成代码时必须满足。
在 skeleton/web 中添加新 FH2 组件页面的标准步骤:
src/views/ 创建新 View 组件ensureFH2Init() 确保 FH2 初始化(仅 paas.js 依赖组件)FH2.loadXxx(containerId, options) 或 new XxxSDK(options) 挂载onUnmounted 中执行 destroy() + 取消事件订阅src/router/ 注册路由详见 references/skeleton-integration.md。
references/ 下的内容是DJI Cloud API 2 7 大组件集成商接入的完整向导。
snippets/ 下有 Vue 组件模板和独立 HTML 模板供参考。
commands/ 下有 6 个快捷命令可直接调用。
本 Skill 的 constraints.yaml 仅包含前端领域特有规则;通用 SDK 约束见
skills/_shared/constraints-common.yaml(生成代码时需同时遵守)。 跨 Skill 路由规则见skills/_shared/skill-routing.md。当发现用户意图属于其他 Skill 职责时,按转交协议切换。 输出格式见skills/_shared/output-format.md。Reference 按需懒加载,不要一次性读取所有 references/。
README.md (opens in a new tab)commands/cockpit.md (opens in a new tab)commands/device-window.md (opens in a new tab)commands/device.md (opens in a new tab)commands/multi-stream.md (opens in a new tab)commands/replay.md (opens in a new tab)commands/wayline.md (opens in a new tab)constraints.yaml (opens in a new tab)references/api-overview.md (opens in a new tab)references/cockpit.md (opens in a new tab)references/device-manager.md (opens in a new tab)references/device-window.md (opens in a new tab)references/fly-data-replay.md (opens in a new tab)references/multi-stream.md (opens in a new tab)references/skeleton-integration.md (opens in a new tab)references/theme.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/wayline-editor.md (opens in a new tab)references/wayline-view.md (opens in a new tab)snippets/standalone-html-template.html (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/cloudapi2:cloudapi2-frontend-componentfrom cloudapi2
npx claudepluginhub dji-sdk/cloud-api-2 --plugin cloudapi213 skills in this plugin
/cloudapi2-aiDJI Cloud API 2 AI 域 SDK 接入助手。当用户要编写 Java 代码管理 AI Box 应用、机载 AI 识别/跟踪/告警、
AI Inside 机载算法生命周期、或 AI 目标检测告警配置与查询时调用。
触发词:AIBoxModule、OnboardAiModule、AIInsideManageModule、AiAlertModule、AI Box、机载 AI、
AI 识别、AIIdentifySet、AIModelSelect、DrcAISpotlightZoom、AI 跟踪、DrcAIAlarm、AI 主动告警、
AI Inside、机载算法、algorithmType、operateAIInsideModel、uploadAlgorithmFile、
AI 告警配置、postDeviceSetting、postAlgorithmSetting、getAiAlertFlights、getAiAlertRecords、
目标检测告警、fetchAIBoxInfo、installApp、operateApp。
不触发:调用 MCP Server 的 fh_* 工具做运维操作(→ cloudapi2-mcp-guide)、
通用 SDK 规则/飞行控制/航线任务(→ cloudapi2-sdk-core)、地图域(→ cloudapi2-map)、
PSDK 负载控制(探照灯/喊话器/Widget,→ cloudapi2-payload)、
设备生命周期与固件升级(→ cloudapi2-device-management)、SEI/OSD 遥测(→ cloudapi2-sei-osd)。
/cloudapi2-device-managementDJI Cloud API 2 SDK 设备管理模块接入助手。当用户要在 skeleton 后端项目中扩展设备管理功能(设备列表、设备状态订阅、HMS 告警、设备上下线、固件升级、控制权获取等),或新建自定义 feature 模块时调用;也覆盖设备运维类模块的 Java 调用代码(机场空调/补光灯/充电/舱盖控制、设备调试、日志管理、维修工单、设备自诊断、RTK 标定、网络测试)。触发词:设备管理、设备列表、设备状态订阅、HMS 告警、固件升级、设备上下线、DeviceOnlineEvent、DeviceOfflineEvent、OsdUpdateEvent、HmsAlertEvent、DeviceStatusService、feature 模块、KernelEvent、EventListener、listen/cancel、getDroneInstance、getDockInstance、DockControlModule、DeviceDebugModule、LogManagementModule、MaintenanceManagementModule、DiagnosisManagementModule、RtkCalibrationModule、NetworkTestModule。Other plugins' skills for the same job