mirror of
https://github.com/Corfirean/coa-server-manager.git
synced 2026-11-22 11:25:56 +00:00
Phase 3: config engine (line-preserving parser, schemas, validation, atomic save, snapshots, merge, presets) and Bots/Server settings UI
Verified: 28 real config files round-trip byte-identical; native UI edit changes exactly one line in template and generated conf; snapshot restore is byte-exact. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
19024a3162
commit
5b5255cca8
18 files changed
+3668
-3
No files matched your search
+14
-1
@@ -17,8 +17,21 @@ export function evaluate(expression) {
|
||||
ws.send(JSON.stringify({ id: n, method: "Runtime.evaluate", params: { expression, awaitPromise: true, returnByValue: true } }));
|
||||
});
|
||||
}
|
||||
if (process.argv[2]) {
|
||||
if (process.argv[2] && process.argv[2] !== "-") {
|
||||
const r = await evaluate(process.argv[2]);
|
||||
console.log(JSON.stringify(r.result?.result?.value ?? r.result, null, 2));
|
||||
ws.close();
|
||||
}
|
||||
|
||||
export async function screenshot(file) {
|
||||
const r = await new Promise((resolve) => {
|
||||
const n = ++id;
|
||||
pending.set(n, resolve);
|
||||
ws.send(JSON.stringify({ id: n, method: "Page.captureScreenshot", params: { format: "png" } }));
|
||||
});
|
||||
(await import("node:fs")).writeFileSync(file, Buffer.from(r.result.data, "base64"));
|
||||
}
|
||||
if (process.argv[3]) {
|
||||
await screenshot(process.argv[3]);
|
||||
ws.close();
|
||||
}
|
||||
Reference in new issue
Block a user