viberadar 0.3.129 → 0.3.131
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/ui/dashboard.html +50 -8
- package/package.json +1 -1
package/dist/ui/dashboard.html
CHANGED
|
@@ -1798,6 +1798,15 @@ let agentRunning = false;
|
|
|
1798
1798
|
const agentRunningPaths = new Set(); // paths of files currently being processed by agent
|
|
1799
1799
|
const agentQueuedPaths = new Set(); // paths of files waiting in queue
|
|
1800
1800
|
let agentQueueState = [];
|
|
1801
|
+
let docActualizeRunningKey = null; // featureKey currently being actualized
|
|
1802
|
+
|
|
1803
|
+
function setDocActualizeStatus(key, html) {
|
|
1804
|
+
docActualizeRunningKey = key;
|
|
1805
|
+
const el = document.getElementById('docActualizeStatus');
|
|
1806
|
+
if (!el) return;
|
|
1807
|
+
if (html) { el.style.display = 'block'; el.innerHTML = html; }
|
|
1808
|
+
else { el.style.display = 'none'; el.innerHTML = ''; }
|
|
1809
|
+
}
|
|
1801
1810
|
let agentRunsState = [];
|
|
1802
1811
|
let agentActiveRun = null;
|
|
1803
1812
|
let currentRunId = null;
|
|
@@ -4756,11 +4765,16 @@ async function renderDocFeatureDetail(c) {
|
|
|
4756
4765
|
const featResult = D.features?.find(x => x.key === drillFeatureKey);
|
|
4757
4766
|
const featRoutes = featResult?.routes;
|
|
4758
4767
|
const hasRoutes = featRoutes && featRoutes.length > 0;
|
|
4759
|
-
const
|
|
4760
|
-
|
|
4761
|
-
|
|
4762
|
-
|
|
4763
|
-
|
|
4768
|
+
const isFirstGen = !f.docExists;
|
|
4769
|
+
// First generation + routes → Playwright runs automatically, show info
|
|
4770
|
+
// Re-actualization + routes → show checkbox (opt-in)
|
|
4771
|
+
const screenshotUiHtml = hasRoutes
|
|
4772
|
+
? isFirstGen
|
|
4773
|
+
? `<div style="margin-top:8px;font-size:12px;color:var(--muted)">📸 Playwright автоматически захватит скриншоты (${featRoutes.length} маршрут${featRoutes.length < 5 ? 'а' : 'ов'}: ${featRoutes.join(', ')})</div>`
|
|
4774
|
+
: `<label style="display:flex;align-items:center;gap:6px;margin-top:8px;font-size:12px;color:var(--muted);cursor:pointer">
|
|
4775
|
+
<input type="checkbox" id="docCaptureScreenshots" style="cursor:pointer">
|
|
4776
|
+
📸 Переснять скриншоты (${featRoutes.length} маршрут${featRoutes.length < 5 ? 'а' : 'ов'}: ${featRoutes.join(', ')})
|
|
4777
|
+
</label>`
|
|
4764
4778
|
: '';
|
|
4765
4779
|
const detailActionsHtml = `
|
|
4766
4780
|
<div class="doc-detail-actions">
|
|
@@ -4768,8 +4782,11 @@ async function renderDocFeatureDetail(c) {
|
|
|
4768
4782
|
<div>
|
|
4769
4783
|
<div class="doc-step-label">${detailActualizeLabel}</div>
|
|
4770
4784
|
<div class="doc-step-hint">${detailActualizeHint}</div>
|
|
4771
|
-
<
|
|
4772
|
-
|
|
4785
|
+
<div style="display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:8px">
|
|
4786
|
+
<button class="agent-card-btn doc-detail-agent-btn" data-task="actualize-docs" data-key="${f.key}" data-first-gen="${isFirstGen ? '1' : '0'}">Актуализировать документацию → v${nextVersion}</button>
|
|
4787
|
+
</div>
|
|
4788
|
+
${screenshotUiHtml}
|
|
4789
|
+
<div id="docActualizeStatus" style="display:none;margin-top:10px;padding:8px 12px;border-radius:6px;background:rgba(88,166,255,0.08);border:1px solid rgba(88,166,255,0.2);font-size:12px;color:var(--blue)"></div>
|
|
4773
4790
|
${versionsHtml}
|
|
4774
4791
|
</div>
|
|
4775
4792
|
</div>
|
|
@@ -4825,8 +4842,16 @@ async function renderDocFeatureDetail(c) {
|
|
|
4825
4842
|
|
|
4826
4843
|
c.querySelectorAll('.doc-detail-agent-btn').forEach(btn => {
|
|
4827
4844
|
btn.addEventListener('click', () => {
|
|
4845
|
+
const isFirstGen = btn.dataset.firstGen === '1';
|
|
4828
4846
|
const cb = document.getElementById('docCaptureScreenshots');
|
|
4829
|
-
|
|
4847
|
+
// First gen → always capture if routes exist (info shown, no checkbox)
|
|
4848
|
+
// Re-actualization → only if checkbox checked
|
|
4849
|
+
const captureScreenshots = isFirstGen || (cb && cb.checked);
|
|
4850
|
+
const meta = captureScreenshots ? { captureScreenshots: true } : undefined;
|
|
4851
|
+
btn.disabled = true;
|
|
4852
|
+
setDocActualizeStatus(btn.dataset.key,
|
|
4853
|
+
`⏳ Агент актуализирует документацию…${captureScreenshots ? ' (📸 + скриншоты)' : ''}`
|
|
4854
|
+
);
|
|
4830
4855
|
runAgentTask(btn.dataset.task, btn.dataset.key, null, null, meta);
|
|
4831
4856
|
});
|
|
4832
4857
|
});
|
|
@@ -6394,6 +6419,14 @@ function connectSSE() {
|
|
|
6394
6419
|
} else {
|
|
6395
6420
|
appendTerminalLine(line, !!isError, !!isDim);
|
|
6396
6421
|
}
|
|
6422
|
+
// Update doc actualize status bar with latest line
|
|
6423
|
+
if (docActualizeRunningKey) {
|
|
6424
|
+
const el = document.getElementById('docActualizeStatus');
|
|
6425
|
+
if (el && el.style.display !== 'none' && line && !isDim) {
|
|
6426
|
+
const clean = line.replace(/</g, '<').replace(/>/g, '>');
|
|
6427
|
+
el.innerHTML = `⏳ ${clean}`;
|
|
6428
|
+
}
|
|
6429
|
+
}
|
|
6397
6430
|
});
|
|
6398
6431
|
|
|
6399
6432
|
es.addEventListener('agent-done', () => {
|
|
@@ -6407,6 +6440,10 @@ function connectSSE() {
|
|
|
6407
6440
|
}
|
|
6408
6441
|
runningSessionId = null;
|
|
6409
6442
|
}
|
|
6443
|
+
if (docActualizeRunningKey) {
|
|
6444
|
+
setDocActualizeStatus(null, null);
|
|
6445
|
+
docActualizeRunningKey = null;
|
|
6446
|
+
}
|
|
6410
6447
|
renderContent();
|
|
6411
6448
|
});
|
|
6412
6449
|
|
|
@@ -6460,6 +6497,11 @@ function connectSSE() {
|
|
|
6460
6497
|
if (!runId) setAgentRunning(false);
|
|
6461
6498
|
agentRunningPaths.clear();
|
|
6462
6499
|
agentQueuedPaths.clear();
|
|
6500
|
+
if (docActualizeRunningKey) {
|
|
6501
|
+
const el = document.getElementById('docActualizeStatus');
|
|
6502
|
+
if (el) { el.style.background = 'rgba(248,81,73,0.08)'; el.style.borderColor = 'rgba(248,81,73,0.2)'; el.style.color = 'var(--red)'; el.innerHTML = `✗ Ошибка: ${escapeHtml(message || 'агент завершился с ошибкой')}`; }
|
|
6503
|
+
docActualizeRunningKey = null;
|
|
6504
|
+
}
|
|
6463
6505
|
renderContent();
|
|
6464
6506
|
|
|
6465
6507
|
// Build error node (plain text or auth/install box)
|