diff --git a/web/studio/README.md b/web/studio/README.md new file mode 100644 index 0000000..3525448 --- /dev/null +++ b/web/studio/README.md @@ -0,0 +1,39 @@ +# web/studio — iAOP 模板配置台 UI + +issue #132 / PRD 5.7「⑤.7 模板配置台」。纯静态单页应用(无构建链), +覆盖 PRD 5.7 关键页面线框:导入页 / 超参配置页 / 驾驶舱编排页 / 版本页, +三级 RBAC(Viewer / Editor / Publisher)。 + +## 使用 + +```bash +cd web/studio && python -m http.server 8081 +# 浏览器打开 http://localhost:8081 (Chrome / Edge 最新两版) +``` + +## 页面与后端语义对齐 + +配置台后端内核 `core/template-console/` 是纯标准库引擎(暂无 HTTP 服务), +本 UI 在前端镜像其语义;配置与版本持久化在浏览器 localStorage(Demo 级)。 + +| 页面 | 能力 | 对齐内核模块 | +|------|------|--------------| +| ① 点位导入 | CSV 上传/粘贴、校验进度条、错误列表(行号+原因)、下载错误模板 | `point_importer.py`(表头列序/必填/数据类型/采样率/重复点号/OPC 节点/模板量纲收窄) | +| ② 模型超参 | 左树 4 类模型(质量预测/异常检测/工艺优化/跨工序关联)、右表单(默认值/单位/范围)、实时 JSON 预览 | `config_store.py`(ConfigKind.MODEL_PARAM)、`core/model-framework` 示例 | +| ③ 驾驶舱编排 | 组件库(5 种 widget)/ 12 列画布 / 数据源绑定面板,产出 `iAOP-cockpit-layout-v1` JSON | `config_store.py`(ConfigKind.LAYOUT)、`core/cockpit/layout.py` | +| ④ 版本发布 | 版本列表(状态/时间/作者)、diff 视图、回滚(不删历史、事件可追溯)、导出模板资产包 | `release.py`(快照固化 / semver 单调递增 / 回滚可追溯) | + +## RBAC(对齐 core/template-console/rbac.py) + +- **Viewer(readonly)**:只读预览,全部编辑/发布按钮禁用; +- **Editor(engineer)**:可配置(导入校验/超参/编排),不可发布与回滚; +- **Publisher(admin)**:可配置 + 发布 + 回滚。 + +顶栏角色切换即切换权限视图(Demo 级,未接认证——认证由 issue #134 覆盖)。 + +## 耦合边界 + +配置台唯一产出物是「模板资产包」JSON(版本页导出, +`pack_schema: iAOP-template-pack-v1`,含版本快照:超参/布局/点位校验报告), +供内核灰度推送(对齐 `push_channel.py` 的 PushManifest 语义), +不直接改内核运行时。 diff --git a/web/studio/index.html b/web/studio/index.html new file mode 100644 index 0000000..faab1f9 --- /dev/null +++ b/web/studio/index.html @@ -0,0 +1,150 @@ + + +
+ + +字段规范对齐 PRD 5.1 / core/edge-gateway/point_dict: + device_id, point_id, name, unit, dataType, sampleRate, qualityCode, opcNode, protocol
+| 行号 | 级别 | 字段 | 原因 |
|---|
发布 = 固化当前超参 + 布局 + 校验结果为快照(对齐 core/template-console/release.py); + 配置台只产出模板资产包,不直接改内核运行时。
+| 版本 | 状态 | 时间 | 作者 | 操作 |
|---|