mirror of https://github.com/openclaw/openclaw.git
Canvas Host: build default status with DOM nodes (#58266)
This commit is contained in:
parent
e95f786aa2
commit
df0e136bc7
|
|
@ -145,6 +145,8 @@ describe("canvas host", () => {
|
|||
expect(html).toContain("Interactive test page");
|
||||
expect(html).toContain("openclawSendUserAction");
|
||||
expect(html).toContain(CANVAS_WS_PATH);
|
||||
expect(html).toContain('document.createElement("span")');
|
||||
expect(html).not.toContain("statusEl.innerHTML");
|
||||
} finally {
|
||||
await server.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,11 +121,18 @@ function defaultIndexHTML() {
|
|||
typeof window.openclawCanvasA2UIAction.postMessage === "function")
|
||||
);
|
||||
const hasHelper = () => typeof window.openclawSendUserAction === "function";
|
||||
statusEl.innerHTML =
|
||||
"Bridge: " +
|
||||
(hasHelper() ? "<span class='ok'>ready</span>" : "<span class='bad'>missing</span>") +
|
||||
" · iOS=" + (hasIOS() ? "yes" : "no") +
|
||||
" · Android=" + (hasAndroid() ? "yes" : "no");
|
||||
const helperReady = hasHelper();
|
||||
statusEl.textContent = "";
|
||||
statusEl.appendChild(document.createTextNode("Bridge: "));
|
||||
const bridgeStatus = document.createElement("span");
|
||||
bridgeStatus.className = helperReady ? "ok" : "bad";
|
||||
bridgeStatus.textContent = helperReady ? "ready" : "missing";
|
||||
statusEl.appendChild(bridgeStatus);
|
||||
statusEl.appendChild(
|
||||
document.createTextNode(
|
||||
" · iOS=" + (hasIOS() ? "yes" : "no") + " · Android=" + (hasAndroid() ? "yes" : "no"),
|
||||
),
|
||||
);
|
||||
|
||||
const onStatus = (ev) => {
|
||||
const d = ev && ev.detail || {};
|
||||
|
|
|
|||
Loading…
Reference in New Issue