Readable command output: ANSI stripped, Copy / Wrap / Expand / .txt (#27)
CI / Lint (eslint) (pull_request) Successful in 20s
CI / Test (jest) (pull_request) Successful in 21s
CI / Security (npm audit) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 2m43s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m44s
CI / UI (playwright) (pull_request) Successful in 2m35s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 1m54s
CI / Lint (eslint) (pull_request) Successful in 20s
CI / Test (jest) (pull_request) Successful in 21s
CI / Security (npm audit) (pull_request) Successful in 15s
CI / Integration (api) (pull_request) Successful in 2m43s
CI / Scan (secrets, workflows, shell) (pull_request) Successful in 2m44s
CI / UI (playwright) (pull_request) Successful in 2m35s
CI / Deploy (pull_request) Skipped
CI / Deploy worker (pull_request) Skipped
CI / Notify (pull_request) Skipped
CI / UI screenshots (before/after) (pull_request) Successful in 1m54s
A shared output block (Pulse.output.render) now draws every command output in Executions and Quick Command: - ANSI escape codes (colours, cursor moves, titles, charset switches) are stripped, so systemctl, ls --color and docker read cleanly. - Copy and .txt use the full, clean text; .txt downloads it as a file. - Wrap turns long-line wrapping on or off for every block, remembered. - Output over 25 lines starts at 24rem high with an Expand button. - Over 100,000 characters, the display is cut with a notice saying how much is hidden; Copy and .txt still include all of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
64703482fd
commit
ecc1b447be
6 files changed
+162
-22
No files matched your search
@@ -169,7 +169,6 @@
|
||||
/* Results show here as they arrive, per worker, instead of only in Executions (#5).
|
||||
A card per run: "running" until its command_result comes in over the live
|
||||
connection, or a poll finds it finished if that event was missed. */
|
||||
const OUTPUT_MAX = 100000; // characters shown per stream
|
||||
const _runs = new Map(); // execution id -> { card, startedAt, timer }
|
||||
const _early = new Map(); // results that beat the POST response
|
||||
|
||||
@@ -210,13 +209,6 @@
|
||||
'<div class="qc-run-body"></div></div>';
|
||||
}
|
||||
|
||||
function clip(text) {
|
||||
const t = String(text || '');
|
||||
if (t.length <= OUTPUT_MAX) return esc(t);
|
||||
return esc(t.slice(0, OUTPUT_MAX)) + '\n<span class="qc-out-note">[' + (t.length - OUTPUT_MAX).toLocaleString() +
|
||||
' more characters: see the full output in Executions]</span>';
|
||||
}
|
||||
|
||||
function failureLabel(r) {
|
||||
if (r.timed_out) return 'Timed out';
|
||||
if (r.signal) return 'Killed (' + r.signal + ')';
|
||||
@@ -238,8 +230,9 @@
|
||||
const ms = typeof r.duration === 'number' ? r.duration : Date.now() - run.startedAt;
|
||||
run.card.querySelector('.qc-run-time').textContent = ms < 1000 ? ms + ' ms' : (ms / 1000).toFixed(1) + ' s';
|
||||
const parts = [];
|
||||
if (r.stdout) parts.push('<pre class="lt-log-output qc-out">' + clip(r.stdout) + '</pre>');
|
||||
if (r.stderr) parts.push('<pre class="lt-log-output qc-out-err">' + clip(r.stderr) + '</pre>');
|
||||
const name = 'pulse-' + String(executionId).slice(0, 8);
|
||||
if (r.stdout) parts.push(Pulse.output.render(r.stdout, { cls: 'qc-out', name: name }));
|
||||
if (r.stderr) parts.push(Pulse.output.render(r.stderr, { err: true, cls: 'qc-out-err', name: name + '-stderr' }));
|
||||
if (!r.success && r.error && !r.stderr) parts.push('<pre class="lt-log-output qc-out-err">' + esc(r.error) + '</pre>');
|
||||
if (!parts.length) parts.push('<div class="qc-out-note">No output</div>');
|
||||
const body = run.card.querySelector('.qc-run-body');
|
||||
|
||||
Reference in new issue
Block a user