推进 INI 面板 launch persistence capabilities manifest

This commit is contained in:
2026-06-15 06:40:55 +08:00
parent 4d471a3555
commit 2dcf8095dc
6 changed files with 122 additions and 1 deletions

View File

@@ -145,6 +145,10 @@ assert.match(docText, /\blinuxCncIniPanelControlPageApi\.readControlPageStatus\b
assert.match(docText, /\bcreateIniPanelLaunchApiManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getLaunchApiManifest\b/);
assert.match(docText, /\blinuxCncIniPanelLaunchApi\.getControlPageApiMethods\b/);
assert.match(docText, /\bOPFS\/session persistence capabilities\b/);
assert.match(docText, /\bmachine files\b/);
assert.match(docText, /\bsession snapshots\b/);
assert.match(docText, /\bread-only status\b/);
for (const entry of INI_PANEL_ENTRIES) {
const escapedHref = entry.href.replace(".", "\\.");

View File

@@ -48,6 +48,23 @@ assert.deepEqual(manifest, {
},
],
controlPageApiMethods: createControlPageBrowserApiMethods(),
persistenceCapabilities: [
{
id: "machine-files",
label: "Machine text files",
scope: "opfs",
},
{
id: "session-snapshot",
label: "Machine session snapshot",
scope: "opfs",
},
{
id: "readonly-status",
label: "Read-only machine session status",
scope: "control-page",
},
],
});
assert.deepEqual(createIniPanelShellViewModel().launchApiManifest, manifest);
@@ -56,9 +73,11 @@ assert.deepEqual(getVisibleIniPanelEntries(), INI_PANEL_ENTRIES);
manifest.visibleEntries[0].title = "changed";
manifest.targetPages[0].href = "./changed.html";
manifest.controlPageApiMethods.push("changedMethod");
manifest.persistenceCapabilities[0].label = "changed";
assert.equal(INI_PANEL_ENTRIES[0].title, "Open edit and run panel");
assert.equal(createIniPanelLaunchApiManifest().targetPages[0].href, "./index.html");
assert.deepEqual(createIniPanelLaunchApiManifest().controlPageApiMethods, createControlPageBrowserApiMethods());
assert.equal(createIniPanelLaunchApiManifest().persistenceCapabilities[0].label, "Machine text files");
const customManifest = createIniPanelLaunchApiManifest([
{