mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-25 14:44:01 +00:00
fix: hash size badge colors — 1B orange, 2B pale green, 3B bright green
1-byte is worst (most collisions), 3-byte is best (least collisions). Colors now reflect quality: orange → pale green → bright green.
This commit is contained in:
+3
-2
@@ -185,8 +185,9 @@
|
||||
if (n.hash_size_inconsistent && p.payload_type === 4 && p.raw_hex) {
|
||||
const pb = parseInt(p.raw_hex.slice(2, 4), 16);
|
||||
const hs = ((pb >> 6) & 0x3) + 1;
|
||||
const isDefault = hs === n.hash_size;
|
||||
hashSizeBadge = ` <span class="badge" style="background:${isDefault ? 'var(--surface-2)' : 'var(--status-yellow)'};color:${isDefault ? 'var(--text-muted)' : '#000'};font-size:9px;font-family:var(--mono)">${hs}B</span>`;
|
||||
const hsColor = hs >= 3 ? '#16a34a' : hs === 2 ? '#86efac' : '#f97316';
|
||||
const hsFg = hs === 2 ? '#064e3b' : '#fff';
|
||||
hashSizeBadge = ` <span class="badge" style="background:${hsColor};color:${hsFg};font-size:9px;font-family:var(--mono)">${hs}B</span>`;
|
||||
}
|
||||
return `<div class="node-activity-item">
|
||||
<span class="node-activity-time">${timeAgo(p.timestamp)}</span>
|
||||
|
||||
Reference in New Issue
Block a user