viberadar 0.3.217 → 0.3.219

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.
@@ -7757,6 +7757,33 @@ function updateLoadLiveStats() {
7757
7757
  if (fill) fill.style.width = `${stats.progressPct}%`;
7758
7758
  }
7759
7759
 
7760
+ async function copyLoadLog(btn) {
7761
+ const text = (loadLogLines || []).join('\n');
7762
+ if (!text.trim()) return;
7763
+ const original = btn ? btn.textContent : '';
7764
+ try {
7765
+ if (navigator.clipboard && window.isSecureContext) {
7766
+ await navigator.clipboard.writeText(text);
7767
+ } else {
7768
+ const ta = document.createElement('textarea');
7769
+ ta.value = text;
7770
+ ta.style.position = 'fixed';
7771
+ ta.style.left = '-9999px';
7772
+ document.body.appendChild(ta);
7773
+ ta.focus();
7774
+ ta.select();
7775
+ document.execCommand('copy');
7776
+ ta.remove();
7777
+ }
7778
+ if (btn) {
7779
+ btn.textContent = 'Скопировано';
7780
+ setTimeout(() => { btn.textContent = original || 'Копировать лог'; }, 1400);
7781
+ }
7782
+ } catch (e) {
7783
+ alert('Не удалось скопировать лог: ' + e.message);
7784
+ }
7785
+ }
7786
+
7760
7787
  function drawLoadChart(id, buckets, valFn, color, label) {
7761
7788
  const canvas = document.getElementById(id);
7762
7789
  if (!canvas) return;
@@ -8257,13 +8284,16 @@ function renderLoad(c) {
8257
8284
  <div class="load-btns" style="margin-top:12px">
8258
8285
  <button class="load-btn" style="background:#1a2a3a;border-color:var(--blue);color:var(--blue)" onclick="loadAiAnalysis()">🤖 AI-анализ результатов</button>
8259
8286
  </div>
8260
- </div>` : ''}
8261
-
8262
- <div class="load-section">
8263
- <div class="load-section-title">Лог k6</div>
8264
- <div class="load-log" id="loadLogContent">
8265
- ${loadLogLines.map(l => `<div class="load-log-line">${escapeHtml(l)}</div>`).join('')}
8266
- </div>
8287
+ </div>` : ''}
8288
+
8289
+ <div class="load-section">
8290
+ <div class="load-section-title" style="display:flex;align-items:center;justify-content:space-between;gap:10px">
8291
+ <span>Лог k6</span>
8292
+ <button class="load-btn" style="padding:4px 10px;text-transform:none;letter-spacing:0;font-weight:500" onclick="copyLoadLog(this)" ${loadLogLines.length ? '' : 'disabled'}>Копировать лог</button>
8293
+ </div>
8294
+ <div class="load-log" id="loadLogContent">
8295
+ ${loadLogLines.map(l => `<div class="load-log-line">${escapeHtml(l)}</div>`).join('')}
8296
+ </div>
8267
8297
  </div>
8268
8298
 
8269
8299
  </div>`;
@@ -8572,17 +8602,21 @@ async function loadSaveScript() {
8572
8602
  const duration = (document.getElementById('loadDuration')?.value || loadDurationDraft || '30s').trim();
8573
8603
  const dataDir = (document.getElementById('loadDataDir')?.value || loadDataDirDraft || '').trim();
8574
8604
  const resultDir = (document.getElementById('loadResultDir')?.value || loadResultDirDraft || '').trim();
8605
+ const accountsRaw = document.getElementById('loadAccountsJson')?.value || loadAccountsJsonDraft || '';
8606
+ const accountsInfo = normalizeAccountsJson(accountsRaw);
8607
+ if (accountsInfo.error) { alert(accountsInfo.error); return; }
8575
8608
  loadScriptNameDraft = name;
8576
8609
  loadBaseUrlDraft = baseUrl;
8577
8610
  loadVusDraft = vus;
8578
8611
  loadDurationDraft = duration;
8579
8612
  loadDataDirDraft = dataDir;
8580
8613
  loadResultDirDraft = resultDir;
8614
+ loadAccountsJsonDraft = accountsRaw;
8581
8615
  try {
8582
8616
  const r = await fetch('/api/load/scripts', {
8583
8617
  method: 'POST',
8584
8618
  headers: { 'Content-Type': 'application/json' },
8585
- body: JSON.stringify({ name, script, baseUrl, vus, duration, dataDir, resultDir }),
8619
+ body: JSON.stringify({ name, script, baseUrl, vus, duration, dataDir, resultDir, accountsJson: accountsInfo.text }),
8586
8620
  });
8587
8621
  if (!r.ok) { const d = await r.json().catch(() => ({})); alert('Ошибка: ' + (d.error || r.status)); return; }
8588
8622
  await loadRefreshScripts();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viberadar",
3
- "version": "0.3.217",
3
+ "version": "0.3.219",
4
4
  "description": "Live module map with test coverage for vibecoding projects",
5
5
  "main": "./dist/cli.js",
6
6
  "bin": {