Add region badge to tool panel (THE-116)

Adds a region badge that always shows in the tool details panel.
Defaults to "Global" when the region field is absent or set to "global".
Accepts a two-letter country code string (uppercased) or an array of
country codes (joined as "US, UK"). Badge is styled green (#2e7d32).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
s0lray
2026-03-26 15:04:12 -04:00
co-authored by Paperclip
parent 591ded3875
commit 05997513b5
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -342,6 +342,7 @@
.badge-invitation-only { background: #b87800; }
.badge-deprecated { background: #8b3030; }
.badge-nsfw { background: #9b2b9b; }
.badge-region { background: #2e7d32; }
/* OPSEC row layout */
.opsec-row {
+11
View File
@@ -464,6 +464,17 @@ function openPanel(d) {
badgeHtml += ' <span class="badge-pill badge-nsfw">NSFW</span>';
}
var region = d.data.region;
var regionLabel;
if (!region || region === "global") {
regionLabel = "Global";
} else if (Array.isArray(region)) {
regionLabel = region.map(function(r) { return r.toUpperCase(); }).join(", ");
} else {
regionLabel = String(region).toUpperCase();
}
badgeHtml += ' <span class="badge-pill badge-region">' + escapeHtml(regionLabel) + '</span>';
badgesEl.innerHTML = badgeHtml;
badgesEl.classList.remove("empty");
}