viberadar 0.3.186 → 0.3.188

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.
@@ -1612,6 +1612,13 @@
1612
1612
  .probe-step-type { font-size: 10px; font-weight: 600; color: var(--blue); background: rgba(88,166,255,0.1); padding: 1px 5px; border-radius: 3px; min-width: 80px; text-align: center; }
1613
1613
  .probe-step-val { color: var(--text); font-family: monospace; }
1614
1614
  .probe-output-box { font-family: 'SFMono-Regular', Consolas, monospace; font-size: 11px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; white-space: pre-wrap; overflow-x: auto; max-height: 360px; overflow-y: auto; color: var(--text); line-height: 1.5; margin-top: 8px; }
1615
+ .probe-screenshots { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
1616
+ .probe-screenshot-thumb { position: relative; cursor: pointer; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); transition: border-color 0.15s; flex-shrink: 0; }
1617
+ .probe-screenshot-thumb:hover { border-color: var(--blue); }
1618
+ .probe-screenshot-thumb img { display: block; width: 180px; height: 110px; object-fit: cover; }
1619
+ .probe-screenshot-thumb .probe-screenshot-label { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.65); font-size: 10px; color: var(--muted); padding: 3px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
1620
+ .probe-screenshot-lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center; z-index: 99999; cursor: zoom-out; }
1621
+ .probe-screenshot-lightbox img { max-width: 90vw; max-height: 90vh; border-radius: 8px; box-shadow: 0 8px 40px rgba(0,0,0,0.6); }
1615
1622
 
1616
1623
  </style>
1617
1624
  </head>
@@ -3564,6 +3571,17 @@ function renderProbeDetail(c) {
3564
3571
  ? `<div style="font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:20px;margin-bottom:6px">Ошибка</div>
3565
3572
  <div class="probe-output-box" style="color:var(--red)">${escapeHtml(result.error)}</div>` : '';
3566
3573
 
3574
+ const screenshots = result?.screenshotFiles || [];
3575
+ const screenshotsHtml = screenshots.length
3576
+ ? `<div style="font-size:12px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.5px;margin-top:20px;margin-bottom:6px">📸 Скриншоты (${screenshots.length})</div>
3577
+ <div class="probe-screenshots">
3578
+ ${screenshots.map((f, i) => `
3579
+ <div class="probe-screenshot-thumb" onclick="probeShowScreenshot('/api/probe/screenshot/${escapeHtml(f)}')">
3580
+ <img src="/api/probe/screenshot/${escapeHtml(f)}" alt="step ${i+1}" loading="lazy">
3581
+ <div class="probe-screenshot-label">${escapeHtml(f.replace(/^(dsl|pw)-[^-]+-/, '').replace(/-\d{4}-\d{2}-\d{2}.*/, ''))}</div>
3582
+ </div>`).join('')}
3583
+ </div>` : '';
3584
+
3567
3585
  c.innerHTML = `
3568
3586
  <div class="probe-detail">
3569
3587
  <div class="probe-back" onclick="probeDetailCheck=null;renderContent()">← Назад к проверкам</div>
@@ -3585,26 +3603,48 @@ function renderProbeDetail(c) {
3585
3603
 
3586
3604
  ${stepsHtml}
3587
3605
  ${fileHtml}
3606
+ ${screenshotsHtml}
3588
3607
  ${outputHtml}
3589
3608
  ${errorHtml}
3590
3609
  </div>`;
3591
3610
  }
3592
3611
 
3612
+ function probeShowScreenshot(url) {
3613
+ let lb = document.getElementById('probeScreenshotLb');
3614
+ if (lb) lb.remove();
3615
+ lb = document.createElement('div');
3616
+ lb.id = 'probeScreenshotLb';
3617
+ lb.className = 'probe-screenshot-lightbox';
3618
+ lb.innerHTML = `<img src="${url}" alt="screenshot">`;
3619
+ lb.addEventListener('click', () => lb.remove());
3620
+ document.addEventListener('keydown', function esc(e) { if (e.key === 'Escape') { lb.remove(); document.removeEventListener('keydown', esc); } });
3621
+ document.body.appendChild(lb);
3622
+ }
3623
+
3593
3624
  async function probeRunNow() {
3625
+ if (!probeData) probeData = {};
3626
+ probeData.status = 'running';
3627
+ probeData.runningCheck = null;
3594
3628
  probeRunning = true;
3595
3629
  renderContent();
3596
3630
  try { await fetch('/api/probe/run', { method: 'POST', headers: {'Content-Type':'application/json'}, body: '{}' }); } catch {}
3597
3631
  }
3598
3632
 
3599
3633
  async function probeRunOne(checkName) {
3634
+ if (!probeData) probeData = {};
3635
+ probeData.runningCheck = checkName;
3636
+ renderContent();
3600
3637
  try {
3601
3638
  await fetch('/api/probe/run', {
3602
3639
  method: 'POST',
3603
3640
  headers: { 'Content-Type': 'application/json' },
3604
3641
  body: JSON.stringify({ checkName }),
3605
3642
  });
3643
+ } catch {
3644
+ // On error restore state
3645
+ probeData.runningCheck = null;
3606
3646
  renderContent();
3607
- } catch {}
3647
+ }
3608
3648
  }
3609
3649
 
3610
3650
  async function probeScheduleStart() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viberadar",
3
- "version": "0.3.186",
3
+ "version": "0.3.188",
4
4
  "description": "Live module map with test coverage for vibecoding projects",
5
5
  "main": "./dist/cli.js",
6
6
  "bin": {