Restore country flag in chat header

This commit is contained in:
rajchales-monito
2026-07-24 13:21:27 +02:00
parent 45169e8113
commit ae088821e3
3 changed files with 10 additions and 2 deletions
+4
View File
@@ -319,6 +319,10 @@ label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
background: #f8fbf9; background: #f8fbf9;
white-space: nowrap; white-space: nowrap;
} }
.visitor-summary-row .country-pill {
border-color: #d9e6df;
background: #fbfdfb;
}
.visitor-summary-row .presence-dot { .visitor-summary-row .presence-dot {
border: 0; border: 0;
padding: 0; padding: 0;
+3 -2
View File
@@ -431,7 +431,7 @@ function renderActive() {
<svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 17.5V20h2.5L17.8 8.7l-2.5-2.5L4 17.5Zm15.7-11.1a1 1 0 0 0 0-1.4L18.3 3.6a1 1 0 0 0-1.4 0l-1 1 2.5 2.5 1.3-.7Z"></path></svg> <svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 17.5V20h2.5L17.8 8.7l-2.5-2.5L4 17.5Zm15.7-11.1a1 1 0 0 0 0-1.4L18.3 3.6a1 1 0 0 0-1.4 0l-1 1 2.5 2.5 1.3-.7Z"></path></svg>
</button> </button>
${presenceDot(conversation.visitorPresence)} ${presenceDot(conversation.visitorPresence)}
<span title="Zeme">${visitorCountry(conversation)}</span> <span class="country-pill" title="Zeme">${visitorCountry(conversation)}</span>
<span title="Doba na webu">${formatDuration(conversation.sessionSeconds)}</span> <span title="Doba na webu">${formatDuration(conversation.sessionSeconds)}</span>
<span title="Navstivene stranky">${Number(conversation.pageCount || 0)} str.</span> <span title="Navstivene stranky">${Number(conversation.pageCount || 0)} str.</span>
<span title="Pocet chatu">${Number(conversation.visitorConversationCount || 1)}x chat</span> <span title="Pocet chatu">${Number(conversation.visitorConversationCount || 1)}x chat</span>
@@ -507,7 +507,8 @@ function statusButtons(item) {
function visitorCountry(item) { function visitorCountry(item) {
const countryCode = item.countryCode || countryFromLanguage(item.language) || countryFromTimezone(item.timezone); const countryCode = item.countryCode || countryFromLanguage(item.language) || countryFromTimezone(item.timezone);
return countryCode ? `${flag(countryCode)} ${escapeHtml(countryCode)}` : "zeme ?"; const countryFlag = item.countryFlag || flag(countryCode);
return countryCode ? `${countryFlag} ${escapeHtml(countryCode)}` : "zeme ?";
} }
function visitorDetails(conversation) { function visitorDetails(conversation) {
+3
View File
@@ -815,6 +815,9 @@ function formatConversationSummary(row) {
timezone: row.timezone, timezone: row.timezone,
ip: row.ip, ip: row.ip,
countryCode: row.country_code || countryFromTimezone(row.timezone) || countryFromLanguage(row.language), countryCode: row.country_code || countryFromTimezone(row.timezone) || countryFromLanguage(row.language),
countryFlag: (row.country_code || countryFromTimezone(row.timezone) || countryFromLanguage(row.language))
? flagEmoji(row.country_code || countryFromTimezone(row.timezone) || countryFromLanguage(row.language))
: "",
vpnRisk: Boolean(row.vpn_risk), vpnRisk: Boolean(row.vpn_risk),
lastBody: row.last_body, lastBody: row.last_body,
messageCount: row.message_count, messageCount: row.message_count,