mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-23 03:25:56 +00:00
Phase 1/2: Tauri shell, React UI (welcome, read-only import, overview with start/stop), e2e driver
Verified in the native window against a disposable fixture: import writes only <folder>.manager + registry; start surfaces a human 'database update required' message; stop returns to Offline. Live install untouched throughout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
bbf06793ba
commit
2e8803a067
50 files changed
+7331
-9
No files matched your search
@@ -0,0 +1,24 @@
|
||||
// Drives the real Tauri window over WebView2's DevTools protocol. Usage: node cdp.mjs <expression>
|
||||
const port = process.env.CDP_PORT ?? "9222";
|
||||
const targets = await (await fetch(`http://127.0.0.1:${port}/json`)).json();
|
||||
const page = targets.find((t) => t.type === "page");
|
||||
const ws = new WebSocket(page.webSocketDebuggerUrl);
|
||||
await new Promise((r) => (ws.onopen = r));
|
||||
let id = 0;
|
||||
const pending = new Map();
|
||||
ws.onmessage = (m) => {
|
||||
const d = JSON.parse(m.data);
|
||||
if (d.id && pending.has(d.id)) pending.get(d.id)(d);
|
||||
};
|
||||
export function evaluate(expression) {
|
||||
return new Promise((resolve) => {
|
||||
const n = ++id;
|
||||
pending.set(n, resolve);
|
||||
ws.send(JSON.stringify({ id: n, method: "Runtime.evaluate", params: { expression, awaitPromise: true, returnByValue: true } }));
|
||||
});
|
||||
}
|
||||
if (process.argv[2]) {
|
||||
const r = await evaluate(process.argv[2]);
|
||||
console.log(JSON.stringify(r.result?.result?.value ?? r.result, null, 2));
|
||||
ws.close();
|
||||
}
|
||||
Reference in new issue
Block a user