экспорт маппинга
This commit is contained in:
@@ -89,7 +89,8 @@ def install_ui_builder(
|
||||
)
|
||||
)
|
||||
|
||||
template = (assets_dir / "index.html").read_text(encoding="utf-8")
|
||||
editor_template = (assets_dir / "index.html").read_text(encoding="utf-8")
|
||||
runtime_template = (assets_dir / "runtime.html").read_text(encoding="utf-8")
|
||||
asset_digest = hashlib.sha256()
|
||||
for asset_name in ("app.js", "styles.css"):
|
||||
asset_path = assets_dir / asset_name
|
||||
@@ -101,6 +102,9 @@ def install_ui_builder(
|
||||
|
||||
def render_page(mode: str) -> HTMLResponse:
|
||||
page_api = editor_api if mode == "editor" else runtime_api
|
||||
# Runtime has its own HTML entry point and contains no Builder DOM at all.
|
||||
# This prevents the visual editor from flashing during normal page load.
|
||||
template = editor_template if mode == "editor" else runtime_template
|
||||
html = (
|
||||
template.replace("__UI_BUILDER_ASSETS__", assets_url.rstrip("/"))
|
||||
.replace("__UI_BUILDER_ASSET_VERSION__", asset_version)
|
||||
|
||||
Reference in New Issue
Block a user