mirror of
https://github.com/hansjone/netx.git
synced 2026-10-15 23:30:45 +08:00
Fix WebCRT build regression and AuditPage nullish coalescing.
Remove duplicate serializeTerminal fragment that broke WebTerminal compilation; rewrite ne.exec_batch count without mixing ?? and ||. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
3fd1e9131d
commit
a9c7e81793
2 changed files with 6 additions and 11 deletions
|
|
@ -123,16 +123,6 @@ function serializeTerminal(term: Terminal): string {
|
||||||
return lines.join("\n").replace(/\s+$/g, "");
|
return lines.join("\n").replace(/\s+$/g, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
const buf = term.buffer.active;
|
|
||||||
const lines: string[] = [];
|
|
||||||
for (let i = 0; i < buf.length; i += 1) {
|
|
||||||
const line = buf.getLine(i);
|
|
||||||
if (!line) continue;
|
|
||||||
lines.push(line.translateToString(true));
|
|
||||||
}
|
|
||||||
return lines.join("\n").replace(/\s+$/g, "");
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Line-wise search — avoids serializing the full scrollback on every Find. */
|
/** Line-wise search — avoids serializing the full scrollback on every Find. */
|
||||||
function findBufferLine(
|
function findBufferLine(
|
||||||
term: Terminal,
|
term: Terminal,
|
||||||
|
|
|
||||||
|
|
@ -80,8 +80,13 @@ export function auditSummary(
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (action === "ne.exec_batch") {
|
if (action === "ne.exec_batch") {
|
||||||
|
const neIds = Array.isArray(d.ne_ids) ? (d.ne_ids as unknown[]) : [];
|
||||||
|
const targetCount =
|
||||||
|
d.target_count != null && d.target_count !== ""
|
||||||
|
? Number(d.target_count)
|
||||||
|
: neIds.length;
|
||||||
return t("audit.summary.neExecBatch", {
|
return t("audit.summary.neExecBatch", {
|
||||||
n: String(d.target_count ?? (((d.ne_ids as unknown[]) || []).length || 0)),
|
n: String(Number.isFinite(targetCount) ? targetCount : 0),
|
||||||
ok: String(d.ok_count ?? 0),
|
ok: String(d.ok_count ?? 0),
|
||||||
fail: String(d.fail_count ?? 0),
|
fail: String(d.fail_count ?? 0),
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue