diff --git a/public/admin.css b/public/admin.css index 440da2c..e9dc5b0 100644 --- a/public/admin.css +++ b/public/admin.css @@ -319,6 +319,10 @@ label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; } background: #f8fbf9; white-space: nowrap; } +.visitor-summary-row .country-pill { + border-color: #d9e6df; + background: #fbfdfb; +} .visitor-summary-row .presence-dot { border: 0; padding: 0; diff --git a/public/admin.js b/public/admin.js index 1bd31f9..4f3a062 100644 --- a/public/admin.js +++ b/public/admin.js @@ -431,7 +431,7 @@ function renderActive() { ${presenceDot(conversation.visitorPresence)} - ${visitorCountry(conversation)} + ${visitorCountry(conversation)} ${formatDuration(conversation.sessionSeconds)} ${Number(conversation.pageCount || 0)} str. ${Number(conversation.visitorConversationCount || 1)}x chat @@ -507,7 +507,8 @@ function statusButtons(item) { function visitorCountry(item) { 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) { diff --git a/server.js b/server.js index 3b11e74..a508d65 100644 --- a/server.js +++ b/server.js @@ -815,6 +815,9 @@ function formatConversationSummary(row) { timezone: row.timezone, ip: row.ip, 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), lastBody: row.last_body, messageCount: row.message_count,