推进 INI 面板 launch entry

This commit is contained in:
2026-06-14 23:12:22 +08:00
parent 59ffacb64e
commit c18aa21d70
5 changed files with 203 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>LinuxCNC INI Launch Smoke</title>
</head>
<body>
<pre id="status">running</pre>
<script type="module">
function assertEqual(actual, expected, label) {
if (actual !== expected) {
throw new Error(`${label}: expected ${expected}, got ${actual}`);
}
}
async function loadLaunchFrame() {
const frame = document.createElement("iframe");
frame.src = "../../runtime/ui/ini-panel/launch.html";
document.body.appendChild(frame);
await new Promise((resolve, reject) => {
frame.addEventListener("load", resolve, { once: true });
frame.addEventListener("error", reject, { once: true });
});
return frame.contentDocument;
}
try {
const launchDoc = await loadLaunchFrame();
assertEqual(
launchDoc.querySelector('a[href="./index.html"]').textContent,
"Open edit and run panel",
"launch panel edit link",
);
assertEqual(
launchDoc.querySelector('a[href="./control-page.html"]').textContent,
"Open read-only control view",
"launch panel control link",
);
status.textContent = "browser_ini_launch_smoke=ok";
console.log("browser_ini_launch_smoke=ok");
} catch (error) {
status.textContent = `browser_ini_launch_smoke=failed: ${error.message}`;
console.error(error);
throw error;
}
</script>
</body>
</html>