viberadar 0.3.195 → 0.3.196
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/probe/runner.d.ts +1 -0
- package/dist/probe/runner.d.ts.map +1 -1
- package/dist/probe/runner.js +14 -10
- package/dist/probe/runner.js.map +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +3 -0
- package/dist/server/index.js.map +1 -1
- package/dist/ui/dashboard.html +27 -3
- package/package.json +1 -1
package/dist/ui/dashboard.html
CHANGED
|
@@ -3572,9 +3572,14 @@ function renderProbeDetail(c) {
|
|
|
3572
3572
|
? `<div style="font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px">Файл теста</div>
|
|
3573
3573
|
<code style="font-size:12px;color:var(--blue);background:var(--bg);padding:6px 10px;border-radius:4px;display:block">${escapeHtml(ch.file || '')}</code>` : '';
|
|
3574
3574
|
|
|
3575
|
-
const
|
|
3576
|
-
|
|
3577
|
-
|
|
3575
|
+
const liveOut = probeData?.liveOutput?.[ch.name] || '';
|
|
3576
|
+
const displayOutput = (isRunning && liveOut) ? liveOut : (result?.output || '');
|
|
3577
|
+
const outputHtml = (displayOutput || isRunning)
|
|
3578
|
+
? `<div style="display:flex;align-items:center;gap:8px;margin-top:20px;margin-bottom:6px">
|
|
3579
|
+
<div style="font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px">Вывод</div>
|
|
3580
|
+
${displayOutput ? `<button onclick="navigator.clipboard.writeText(document.getElementById('probeOutputBox').textContent).then(()=>{this.textContent='✓ Скопировано';setTimeout(()=>this.textContent='📋 Копировать',1500)})" title="Копировать" style="font-size:11px;padding:2px 8px;border-radius:4px;border:1px solid var(--border);background:var(--bg);color:var(--muted);cursor:pointer">📋 Копировать</button>` : ''}
|
|
3581
|
+
</div>
|
|
3582
|
+
<div class="probe-output-box" id="probeOutputBox"${isRunning ? ' data-streaming="1"' : ''}>${escapeHtml(displayOutput)}${isRunning && !displayOutput ? '<span style="opacity:0.4">Ожидание вывода…</span>' : ''}</div>` : '';
|
|
3578
3583
|
|
|
3579
3584
|
const errorHtml = result?.error && !result.output
|
|
3580
3585
|
? `<div style="font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:20px;margin-bottom:6px">Ошибка</div>
|
|
@@ -8496,6 +8501,9 @@ function connectSSE() {
|
|
|
8496
8501
|
const payload = JSON.parse(e.data || '{}');
|
|
8497
8502
|
if (!probeData) probeData = {};
|
|
8498
8503
|
probeData.runningCheck = payload.checkName;
|
|
8504
|
+
// Clear stale live output for this check
|
|
8505
|
+
if (!probeData.liveOutput) probeData.liveOutput = {};
|
|
8506
|
+
probeData.liveOutput[payload.checkName] = '';
|
|
8499
8507
|
if (contextMode === 'probe') renderContent();
|
|
8500
8508
|
});
|
|
8501
8509
|
|
|
@@ -8508,6 +8516,22 @@ function connectSSE() {
|
|
|
8508
8516
|
if (contextMode === 'probe') renderContent();
|
|
8509
8517
|
});
|
|
8510
8518
|
|
|
8519
|
+
es.addEventListener('probe-check-output', (e) => {
|
|
8520
|
+
const { checkName, chunk } = JSON.parse(e.data || '{}');
|
|
8521
|
+
if (!checkName || !chunk) return;
|
|
8522
|
+
if (!probeData) probeData = {};
|
|
8523
|
+
if (!probeData.liveOutput) probeData.liveOutput = {};
|
|
8524
|
+
probeData.liveOutput[checkName] = (probeData.liveOutput[checkName] || '') + chunk;
|
|
8525
|
+
// Direct DOM append if currently viewing this check — no full re-render needed
|
|
8526
|
+
if (contextMode === 'probe' && probeDetailCheck === checkName) {
|
|
8527
|
+
const box = document.getElementById('probeOutputBox');
|
|
8528
|
+
if (box) {
|
|
8529
|
+
box.textContent = probeData.liveOutput[checkName];
|
|
8530
|
+
box.scrollTop = box.scrollHeight;
|
|
8531
|
+
}
|
|
8532
|
+
}
|
|
8533
|
+
});
|
|
8534
|
+
|
|
8511
8535
|
es.addEventListener('probe-run-done', (e) => {
|
|
8512
8536
|
const payload = JSON.parse(e.data || '{}');
|
|
8513
8537
|
if (!probeData) probeData = {};
|