|
571 | 571 | var connCount = connPanel ? connPanel.dataset.conns : ''; |
572 | 572 | if (connCount === 'best') connCount = row.querySelector('.lb-conns').textContent.replace(/,/g, '').trim(); |
573 | 573 | var baseUrl = '{{ "logs" | relURL }}'; |
574 | | - var repoHtml = repo ? '<a class="lb-popup-link" href="' + repo + '" target="_blank" rel="noreferrer">View source →</a>' : ''; |
575 | | - var benchHtml = '<a class="lb-popup-link" href="https://github.com/MDA2AV/HttpArena/tree/main/frameworks/' + encodeURIComponent(name) + '" target="_blank" rel="noreferrer">Benchmark implementation →</a>'; |
576 | | - var logHtml = (profile && connCount) ? '<a class="lb-popup-link" href="' + baseUrl + '/' + profile + '/' + connCount + '/' + encodeURIComponent(name) + '.log" target="_blank" rel="noreferrer">Docker logs →</a>' : ''; |
| 574 | + var fwMetaRef = (lbH2GwCurrentMeta && lbH2GwCurrentMeta[name]) || {}; |
| 575 | + var dirName = fwMetaRef.dir || name; |
| 576 | + var variantsList = [{ dir: dirName, description: fwMetaRef.description || desc, repo: fwMetaRef.repo || repo }]; |
| 577 | + if (Array.isArray(fwMetaRef.variants)) { |
| 578 | + fwMetaRef.variants.forEach(function(v) { |
| 579 | + variantsList.push({ dir: v.dir, description: v.description || '', repo: v.repo || '' }); |
| 580 | + }); |
| 581 | + } |
| 582 | + var variantsHtml = variantsList.map(function(v) { |
| 583 | + var vHeader = variantsList.length > 1 |
| 584 | + ? '<div style="font-size:0.75rem; font-weight:600; color:#64748b; text-transform:uppercase; letter-spacing:0.04em; margin-top:0.5rem;">' + v.dir + '</div>' |
| 585 | + : ''; |
| 586 | + var vDesc = v.description ? '<div class="lb-popup-desc" style="margin-top:0.2rem;">' + v.description + '</div>' : ''; |
| 587 | + var vRepo = v.repo ? '<a class="lb-popup-link" href="' + v.repo + '" target="_blank" rel="noreferrer">View source →</a>' : ''; |
| 588 | + var vBench = '<a class="lb-popup-link" href="https://github.com/MDA2AV/HttpArena/tree/main/frameworks/' + encodeURIComponent(v.dir) + '" target="_blank" rel="noreferrer">Benchmark implementation →</a>'; |
| 589 | + return vHeader + vDesc + '<div class="lb-popup-links" style="margin-top:0.35rem;">' + vRepo + vBench + '</div>'; |
| 590 | + }).join(''); |
| 591 | + var logHtml = (profile && connCount) ? '<a class="lb-popup-link" href="' + baseUrl + '/' + profile + '/' + connCount + '/' + encodeURIComponent(dirName) + '.log" target="_blank" rel="noreferrer">Docker logs →</a>' : ''; |
577 | 592 | var statusHtml = s2xx > 0 |
578 | 593 | ? '2xx: ' + s2xx.toLocaleString() + ', 3xx: ' + s3xx.toLocaleString() + ', 4xx: ' + s4xx.toLocaleString() + ', 5xx: ' + s5xx.toLocaleString() |
579 | 594 | : '\u2014'; |
|
584 | 599 | '<button class="lb-popup-close" aria-label="Close">×</button>' + |
585 | 600 | '<div class="lb-popup-name">' + name + '</div>' + |
586 | 601 | '<div class="lb-popup-lang">' + lang + ' (HTTP/2)</div>' + |
587 | | - '<div class="lb-popup-desc">' + desc + '</div>' + |
| 602 | + variantsHtml + |
588 | 603 | '<div class="lb-popup-stats">' + |
589 | 604 | '<div><div class="lb-popup-stat-label">Req/s</div><div class="lb-popup-stat-value">' + rps + '</div></div>' + |
590 | 605 | '<div><div class="lb-popup-stat-label">Connections</div><div class="lb-popup-stat-value">' + conns + '</div></div>' + |
|
595 | 610 | (cpuBreakdown ? '<div style="grid-column:1/-1"><div class="lb-popup-stat-label">Per-service CPU</div><div class="lb-popup-stat-value" style="font-size:0.85rem;">' + cpuBreakdown.replace(/\|/g, ' | ') + '</div></div>' : '') + |
596 | 611 | '<div style="grid-column:1/-1"><div class="lb-popup-stat-label">Status Codes</div><div class="lb-popup-stat-value">' + statusHtml + '</div></div>' + |
597 | 612 | '</div>' + |
598 | | - '<div class="lb-popup-links">' + repoHtml + benchHtml + logHtml + '</div>' + |
| 613 | + (logHtml ? '<div class="lb-popup-links" style="margin-top:0.5rem;">' + logHtml + '</div>' : '') + |
599 | 614 | '</div>'; |
600 | 615 | document.body.appendChild(overlay); |
601 | 616 | function close() { overlay.remove(); } |
|
0 commit comments