v0.34.3_ht2

This commit is contained in:
Mateusz Gruszczyński committed 2026-10-20 12:36:58 +02:00
1 parent 29d9a7dd6c
commit 1fd81eaf5f
9 files changed
+80 -37

No files matched your search

+9 -3
View File
@@ -352,9 +352,15 @@ function renderCacheMix(mix, totalRequests) {
$(`cache-mix-${name}-percent`).textContent = mix ? `${fmt(pct, 1)}%` : "-";
});
$("cache-mix-headline").textContent = mix ? `${fmt(mix.percentages[0], 1)}% HIT` : "-";
$("cache-mix-caption").textContent = mix
? t("cacheMixSample").replace("{count}", fmt(mix.requests))
: unavailable;
const caption = $("cache-mix-caption");
const validTotal = Number.isSafeInteger(totalRequests) && totalRequests >= 0;
const total = validTotal ? fmt(totalRequests) : "-";
const totalLabel = validTotal
? t("cacheMixSample").replace("{count}", total)
: t("cacheMixInvalid");
caption.textContent = total;
caption.setAttribute("title", totalLabel);
caption.setAttribute("aria-label", totalLabel);
$("cache-mix-bar").setAttribute("aria-label", mix
? t("cacheMixAria").replace("{hit}", fmt(mix.counts[0]))
.replace("{miss}", fmt(mix.counts[1]))