mofang-page-builder — mofang-page-构建器
v1.1.0Build Magicflu/Mofang 网页-table custom pages from the jsonv2 records API. Use when users ask for Magicflu/Mofang forms, records, 列出s, 创建/edit/detAIl/admin CRUD pages, H5 扩展 pages, React/Vue/vanilla JS examples, local jsonv2 mock/proxy 调试ging, or same-origin publishing to Magicflu 网页sites. Works as a standalone 技能 for Codex/OpenAI, OpenClaw, Claude Code, Trae, and Trae CN.
运行时依赖
安装命令
点击复制本土化适配说明
mofang-page-builder — mofang-page-构建器 安装说明: 安装命令:["openclaw skills install mofang-page-builder"]
技能文档
魔方网表页面生成
Use this 技能 to 生成 and publish Magicflu/Mofang 网页-table pages. The safe path is:
Confirm spaceId, formId, and page type. Fetch or 导入 the real fielddef. 生成 page code using only field name values from fielddef.fields[]. Test with local mock-jsonv2 or proxy. 设置 CONFIG.APIBase to '' before same-origin publishing. 安装 Locations
Copy the whole mofang-page-构建器/ folder, not only 技能.md.
命令行工具ent Project 安装 Global 安装 Claude Code .claude/技能s/mofang-page-构建器/ ~/.claude/技能s/mofang-page-构建器/ Trae .trae/技能s/mofang-page-构建器/ ~/.trae/技能s/mofang-page-构建器/ Trae CN .trae/技能s/mofang-page-构建器/ ~/.trae-cn/技能s/mofang-page-构建器/
Keep these directories with the 技能: examples/, as设置s/, references/, and scripts/.
Required 工作流
Never guess real form field names from Chinese labels. For real data:
Ask for or identify spaceId and formId. If only a space name is known, resolve it with /magicflu/服务/json/spaces/feed. To traverse all spaces, use /magicflu/服务/json/spaces/feed?启动=0&limit=-1&bq=(创建d,orderby,desc). If only a form label is known, resolve it with /magicflu/服务/s/json/{spaceId}/forms/feed. 运行 scripts/fetch-form-spec.mjs, or ask the user for an 导出ed fielddef JSON and 导入 it. Use only fielddef.fields[].name as API keys, submit keys, and 过滤器 field names. Use fielddef.fields[].label only for UI text. Test locally before 部署ment.
Example fields in examples/ and as设置s/mock-data/ are demos only.
Page Contract
生成d pages must include:
const CONFIG = { APIBase: '', // local 调试: 'http://127.0.0.1:3847'; same-origin production: '' spaceId: 'YOUR_SPACE_ID', formId: 'YOUR_FORM_ID', };
function APIUrl(path) {
const origin = CONFIG.APIBase ? CONFIG.APIBase.replace(/\/$/, '') : '';
return ${origin}${path};
}
Same-origin pages rely on browser Cookie auth. Do not 设置 an Authorization header in page code.
API Summary
Read references/API-summary.md when you need 端点 detAIls, bq syntax, 响应 shape, or field value 格式化s.
Core paths:
Capability Method Path 列出 all spaces 获取 /magicflu/服务/json/spaces/feed?启动=0&limit=-1&bq=(创建d,orderby,desc) Find spaces by label 获取 /magicflu/服务/json/spaces/feed?启动=0&limit=10&bq=(label,eq,{spaceLabel}) 列出 forms in a space 获取 /magicflu/服务/s/json/{spaceId}/forms/feed?启动=0&limit=-1 Find forms by label 获取 /magicflu/服务/s/json/{spaceId}/forms/feed?启动=0&limit=10&bq=(label,eq,{formLabel}) Field definition 获取 /magicflu/服务/s/jsonv2/{spaceId}/forms/{formId}?selector=fielddef&lng=en 列出 records 获取 /magicflu/服务/s/jsonv2/{spaceId}/forms/{formId}/records/entry 创建 record POST /magicflu/服务/s/jsonv2/{spaceId}/forms/{formId}/records 更新 record PUT /magicflu/服务/s/jsonv2/{spaceId}/forms/{formId}/records/entry/{recordId} 删除 record 删除 /magicflu/服务/s/jsonv2/{spaceId}/forms/{formId}/records/entry/{recordId}
Use the spaces 端点 when the user gives only a space name. The returned space id is items[].id; the display name is items[].label. Use the form-列出 端点 when the user gives only a spaceId or form label. The returned form id is feed.entry[].id; the display name is feed.entry[].content.form.label; the English form key is feed.entry[].content.form.name.
Field rules:
API payload keys must be name, not label. Omit empty values before submit. Never submit "" for number fields. Do not submit 系统, serial, secondary reference, image, attachment, location, 网页page, comment, or external field-group fields. Fetch Field Definitions
Account/password:
BASE_URL="http://应用dev.com.magicflu.com:9999" \ MOFANG_USERNAME="你的账号" \ MOFANG_PASSWORD='你的密码' \ node scripts/fetch-form-spec.mjs \ --spaceId <空间UUID> \ --formId <表单UUID> \ --out ./mock-data
If only names are known, resolve and fetch in one command:
BASE_URL="http://应用dev.com.magicflu.com:9999" \ MOFANG_USERNAME="你的账号" \ MOFANG_PASSWORD='你的密码' \ node scripts/fetch-form-spec.mjs \ --spaceLabel "空间名称" \ --formLabel "表单名称" \ --out ./mock-data
Cookie:
node scripts/fetch-form-spec.mjs \ --baseUrl https://你的魔方域名 \ --spaceId <空间UUID> \ --formId <表单UUID> \ --out ./mock-data \ --cookie "浏览器 Cookie"
Offline 导入:
node scripts/fetch-form-spec.mjs \ --spaceId <空间UUID> \ --formId <表单UUID> \ --out ./mock-data \ --导入-json ./fielddef-导出.json
输出: mock-data/manifest.json, mock-data//fielddef.json, records.种子.json, typesnippets.md, and API-outline.md.
Local 调试
Use the bundled demo data:
cp -R as设置s/mock-data ./mock-data node scripts/mock-jsonv2.mjs --port 3847 --dir ./mock-data
设置 page config:
CONFIG.APIBase = 'http://127.0.0.1:3847';
Proxy to a real 环境 only when the user explicitly wants real data behavior:
BASE_URL="http://应用dev.com.magicflu.com:9999" \ MOFANG_USERNAME="你的账号" \ MOFANG_PASSWORD='你的密码' \ node scripts/mock-jsonv2.mjs --mode proxy --port 3847
Pro