Merge pull request #362 from mikecao/dev

v1.5.0
This commit is contained in:
Mike Cao 2020-11-06 17:46:06 -08:00 committed by GitHub
commit 024e7c1942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 133 additions and 16 deletions

View File

@ -29,7 +29,7 @@ const TYPE_ICONS = {
[TYPE_EVENT]: <Bolt />, [TYPE_EVENT]: <Bolt />,
}; };
export default function RealtimeLog({ data, websites }) { export default function RealtimeLog({ data, websites, websiteId }) {
const intl = useIntl(); const intl = useIntl();
const [locale] = useLocale(); const [locale] = useLocale();
const countryNames = useCountryNames(locale); const countryNames = useCountryNames(locale);
@ -88,7 +88,7 @@ export default function RealtimeLog({ data, websites }) {
} }
function getWebsite({ website_id }) { function getWebsite({ website_id }) {
return websites.find(n => n.website_id === website_id)?.name; return websites.find(n => n.website_id === website_id);
} }
function getDetail({ function getDetail({
@ -111,7 +111,7 @@ export default function RealtimeLog({ data, websites }) {
); );
} }
if (view_id) { if (view_id) {
const domain = getWebsite({ website_id }); const domain = getWebsite({ website_id })?.domain;
return ( return (
<a <a
className={styles.link} className={styles.link}
@ -161,7 +161,9 @@ export default function RealtimeLog({ data, websites }) {
<Icon className={styles.icon} icon={getIcon(row)} /> <Icon className={styles.icon} icon={getIcon(row)} />
{getDetail(row)} {getDetail(row)}
</div> </div>
<div className={styles.website}>{getWebsite(row)}</div> {!websiteId && websites.length > 1 && (
<div className={styles.website}>{getWebsite(row)?.domain}</div>
)}
</div> </div>
); );
}; };

View File

@ -28,6 +28,15 @@ export default function RealtimeViews({ websiteId, data, websites }) {
}, },
]; ];
const renderLink = ({ x }) => {
const domain = x.startsWith('/') ? getDomain(websiteId) : '';
return (
<a href={`//${domain}${x}`} target="_blank" rel="noreferrer noopener">
{x}
</a>
);
};
const [referrers, pages] = useMemo(() => { const [referrers, pages] = useMemo(() => {
if (pageviews) { if (pageviews) {
const referrers = percentFilter( const referrers = percentFilter(
@ -55,7 +64,7 @@ export default function RealtimeViews({ websiteId, data, websites }) {
pageviews pageviews
.reduce((arr, { url, website_id }) => { .reduce((arr, { url, website_id }) => {
if (url?.startsWith('/')) { if (url?.startsWith('/')) {
if (!websiteId) { if (!websiteId && websites.length > 1) {
url = `${getDomain(website_id)}${url}`; url = `${getDomain(website_id)}${url}`;
} }
const row = arr.find(({ x }) => x === url); const row = arr.find(({ x }) => x === url);
@ -91,6 +100,7 @@ export default function RealtimeViews({ websiteId, data, websites }) {
<DataTable <DataTable
title={<FormattedMessage id="metrics.pages" defaultMessage="Pages" />} title={<FormattedMessage id="metrics.pages" defaultMessage="Pages" />}
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />} metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
renderLabel={renderLink}
data={pages} data={pages}
height={400} height={400}
/> />

View File

@ -135,7 +135,7 @@ export default function RealtimeDashboard() {
<RealtimeViews websiteId={websiteId} data={realtimeData} websites={websites} /> <RealtimeViews websiteId={websiteId} data={realtimeData} websites={websites} />
</GridColumn> </GridColumn>
<GridColumn xs={12} lg={8}> <GridColumn xs={12} lg={8}>
<RealtimeLog data={realtimeData} websites={websites} /> <RealtimeLog websiteId={websiteId} data={realtimeData} websites={websites} />
</GridColumn> </GridColumn>
</GridRow> </GridRow>
<GridRow> <GridRow>

View File

@ -3,8 +3,8 @@
"label.add-account": "Tilføj konto", "label.add-account": "Tilføj konto",
"label.add-website": "Tilføj hjemmeside", "label.add-website": "Tilføj hjemmeside",
"label.administrator": "Administrator", "label.administrator": "Administrator",
"label.all": "All", "label.all": "Alle",
"label.all-websites": "All websites", "label.all-websites": "Alle websites",
"label.back": "Tilbage", "label.back": "Tilbage",
"label.cancel": "Afvis", "label.cancel": "Afvis",
"label.change-password": "Skift adgangskode", "label.change-password": "Skift adgangskode",
@ -14,11 +14,11 @@
"label.custom-range": "Tilpasset interval", "label.custom-range": "Tilpasset interval",
"label.dashboard": "Betjeningspanel", "label.dashboard": "Betjeningspanel",
"label.date-range": "Datointerval", "label.date-range": "Datointerval",
"label.default-date-range": "Default date range", "label.default-date-range": "Standard datointerval",
"label.delete": "Slet", "label.delete": "Slet",
"label.delete-account": "Slet konto", "label.delete-account": "Slet konto",
"label.delete-website": "Slet hjemmeside", "label.delete-website": "Slet hjemmeside",
"label.dismiss": "Dismiss", "label.dismiss": "Afvis",
"label.domain": "Domæne", "label.domain": "Domæne",
"label.edit": "Rediger", "label.edit": "Rediger",
"label.edit-account": "Rediger konto", "label.edit-account": "Rediger konto",
@ -37,8 +37,8 @@
"label.password": "Adgangskode", "label.password": "Adgangskode",
"label.passwords-dont-match": "Adgangskoder matcher ikke", "label.passwords-dont-match": "Adgangskoder matcher ikke",
"label.profile": "Profil", "label.profile": "Profil",
"label.realtime": "Realtime", "label.realtime": "Realtid",
"label.realtime-logs": "Realtime logs", "label.realtime-logs": "Realtid logs",
"label.refresh": "Opdater", "label.refresh": "Opdater",
"label.required": "Påkrævet", "label.required": "Påkrævet",
"label.reset": "Reset", "label.reset": "Reset",
@ -49,7 +49,7 @@
"label.this-month": "Denne måned", "label.this-month": "Denne måned",
"label.this-week": "Denne uge", "label.this-week": "Denne uge",
"label.this-year": "Dette år", "label.this-year": "Dette år",
"label.timezone": "Timezone", "label.timezone": "Tidszone",
"label.today": "Idag", "label.today": "Idag",
"label.tracking-code": "Sporingskode", "label.tracking-code": "Sporingskode",
"label.unknown": "Ukendt", "label.unknown": "Ukendt",
@ -65,8 +65,8 @@
"message.get-tracking-code": "Få sporingskode", "message.get-tracking-code": "Få sporingskode",
"message.go-to-settings": "Gå til betjeningspanel", "message.go-to-settings": "Gå til betjeningspanel",
"message.incorrect-username-password": "Ugyldigt brugernavn/adgangskode.", "message.incorrect-username-password": "Ugyldigt brugernavn/adgangskode.",
"message.log.visitor": "Visitor from {country} using {browser} on {os} {device}", "message.log.visitor": "Besøgende fra {country} bruger {browser} på {os} {device}",
"message.new-version-available": "A new version of umami {version} is available!", "message.new-version-available": "Ny udgave af Umami {version} er tilgængelig!",
"message.no-data-available": "Ingen data tilgængelig.", "message.no-data-available": "Ingen data tilgængelig.",
"message.no-websites-configured": "Du har ikke konfigureret nogen websteder.", "message.no-websites-configured": "Du har ikke konfigureret nogen websteder.",
"message.page-not-found": "Side ikke fundet.", "message.page-not-found": "Side ikke fundet.",

99
lang/pl-PL.json Normal file
View File

@ -0,0 +1,99 @@
{
"label.accounts": "Konta",
"label.add-account": "Dodaj konto",
"label.add-website": "Dodaj witrynę",
"label.administrator": "Administrator",
"label.all": "Wszystkie",
"label.all-websites": "Wszystkie witryny",
"label.back": "Powrót",
"label.cancel": "Anuluj",
"label.change-password": "Zmień hasło",
"label.confirm-password": "Potwierdź hasło",
"label.copy-to-clipboard": "Skopiuj do schowka",
"label.current-password": "Aktualne hasło",
"label.custom-range": "Zakres niestandardowy",
"label.dashboard": "Dashboard",
"label.date-range": "Zakres dat",
"label.default-date-range": "Domyślny zakres dat",
"label.delete": "Usuń",
"label.delete-account": "Usuń konto",
"label.delete-website": "Usuń witrynę",
"label.dismiss": "Odrzuć",
"label.domain": "Domena",
"label.edit": "Edytuj",
"label.edit-account": "Edytuj konto",
"label.edit-website": "Edytuj witrynę",
"label.enable-share-url": "Włącz udostępnianie adresu URL",
"label.invalid": "Nieprawidłowy",
"label.invalid-domain": "Nieprawidłowa witryna",
"label.last-days": "Ostatnie {x} dni",
"label.last-hours": "Ostatnie {x} godzin",
"label.logged-in-as": "Zalogowano jako {username}",
"label.login": "Zaloguj sie",
"label.logout": "Wyloguj",
"label.more": "Więcej",
"label.name": "Name",
"label.new-password": "Nowe hasło",
"label.password": "Hasło",
"label.passwords-dont-match": "Hasła się nie zgadzają",
"label.profile": "Profil",
"label.realtime": "Czas rzeczywisty",
"label.realtime-logs": "Logi w czasie rzeczywistym",
"label.refresh": "Odśwież",
"label.required": "Wymagany",
"label.reset": "Zresetuj",
"label.save": "Zapisz",
"label.settings": "Ustawienia",
"label.share-url": "Udostępnij adres URL",
"label.single-day": "W tym dniu",
"label.this-month": "W tym miesiącu",
"label.this-week": "W tym tygodniu",
"label.this-year": "W tym roku",
"label.timezone": "Strefa czasowa",
"label.today": "Dzisiaj",
"label.tracking-code": "Kod śledzenia",
"label.unknown": "Nieznany",
"label.username": "Nazwa użytkownika",
"label.view-details": "Pokaż szczegóły",
"label.websites": "Witryny",
"message.active-users": "{x} aktualnie {x, plural, one {odwiedzający} other {odwiedzających}}",
"message.confirm-delete": "Czy na pewno chcesz usunąć {target}?",
"message.copied": "Skopiowano!",
"message.delete-warning": "Wszystkie powiązane dane również zostaną usunięte.",
"message.failure": "Coś poszło nie tak.",
"message.get-share-url": "Uzyskaj adres URL udostępniania",
"message.get-tracking-code": "Pobierz kod śledzenia",
"message.go-to-settings": "Przejdź do ustawień",
"message.incorrect-username-password": "Nieprawidłowa nazwa użytkownika/hasło.",
"message.log.visitor": "Odwiedzający z {country} używa {browser} na {os} {device}",
"message.new-version-available": "Nowa wersja umami {version} jest dostępna!",
"message.no-data-available": "Brak dostępnych danych.",
"message.no-websites-configured": "Nie masz skonfigurowanych żadnych witryn internetowych.",
"message.page-not-found": "Strona nie znaleziona.",
"message.powered-by": "Obsługiwane przez {name}",
"message.save-success": "Zapisano pomyślnie.",
"message.share-url": "To jest publicznie udostępniany adres URL dla {target}.",
"message.track-stats": "Aby śledzić statystyki dla {target}, umieść poniższy kod w sekcji {head} swojej witryny.",
"message.type-delete": "Wpisz {delete} w polu poniżej, aby potwierdzić.",
"metrics.actions": "Działania",
"metrics.average-visit-time": "Średni czas wizyty",
"metrics.bounce-rate": "Współczynnik odrzuceń",
"metrics.browsers": "Przeglądarki",
"metrics.countries": "Kraje",
"metrics.device.desktop": "Komputer",
"metrics.device.laptop": "Laptop",
"metrics.device.mobile": "Smartfon",
"metrics.device.tablet": "Tablet",
"metrics.devices": "Urządzenia",
"metrics.events": "Zdarzenia",
"metrics.filter.combined": "Połączone",
"metrics.filter.domain-only": "Tylko domena",
"metrics.filter.raw": "Surowe dane",
"metrics.operating-systems": "System operacyjny",
"metrics.page-views": "Wyświetlenia strony",
"metrics.pages": "Strony",
"metrics.referrers": "Źródła odsyłające",
"metrics.unique-visitors": "Unikalni odwiedzający",
"metrics.views": "Wyświetlenia",
"metrics.visitors": "Odwiedzający"
}

View File

@ -12,6 +12,7 @@ import {
ja, ja,
nb, nb,
nl, nl,
pl,
pt, pt,
ro, ro,
ru, ru,
@ -43,6 +44,7 @@ import idMessages from 'lang-compiled/id-ID.json';
import ukMessages from 'lang-compiled/uk-UA.json'; import ukMessages from 'lang-compiled/uk-UA.json';
import fiMessages from 'lang-compiled/fi-FI.json'; import fiMessages from 'lang-compiled/fi-FI.json';
import csMessages from 'lang-compiled/cs-CZ.json'; import csMessages from 'lang-compiled/cs-CZ.json';
import plMessages from 'lang-compiled/pl-PL.json';
export const messages = { export const messages = {
'en-US': enMessages, 'en-US': enMessages,
@ -67,6 +69,7 @@ export const messages = {
'uk-UA': ukMessages, 'uk-UA': ukMessages,
'fi-FI': fiMessages, 'fi-FI': fiMessages,
'cs-CZ': csMessages, 'cs-CZ': csMessages,
'pl-PL': plMessages,
}; };
export const dateLocales = { export const dateLocales = {
@ -92,6 +95,7 @@ export const dateLocales = {
'uk-UA': uk, 'uk-UA': uk,
'fi-FI': fi, 'fi-FI': fi,
'cs-CZ': cs, 'cs-CZ': cs,
'pl-PL': pl,
}; };
export const menuOptions = [ export const menuOptions = [
@ -110,6 +114,7 @@ export const menuOptions = [
{ label: 'Монгол', value: 'mn-MN', display: 'mn' }, { label: 'Монгол', value: 'mn-MN', display: 'mn' },
{ label: 'Nederlands', value: 'nl-NL', display: 'nl' }, { label: 'Nederlands', value: 'nl-NL', display: 'nl' },
{ label: 'Norsk Bokmål', value: 'nb-NO', display: 'nb' }, { label: 'Norsk Bokmål', value: 'nb-NO', display: 'nb' },
{ label: 'Polski', value: 'pl-PL', display: 'pl' },
{ label: 'Português', value: 'pt-PT', display: 'pt' }, { label: 'Português', value: 'pt-PT', display: 'pt' },
{ label: 'Русский', value: 'ru-RU', display: 'ru' }, { label: 'Русский', value: 'ru-RU', display: 'ru' },
{ label: 'Română', value: 'ro-RO', display: 'ro' }, { label: 'Română', value: 'ro-RO', display: 'ro' },

View File

@ -1,6 +1,6 @@
{ {
"name": "umami", "name": "umami",
"version": "1.4.0", "version": "1.5.0",
"description": "A simple, fast, website analytics alternative to Google Analytics. ", "description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>", "author": "Mike Cao <mike@mikecao.com>",
"license": "MIT", "license": "MIT",

View File

@ -0,0 +1 @@
{"AF":"Afganistan","AL":"Albania","DZ":"Algieria","AD":"Andora","AO":"Angola","AI":"Anguilla","AQ":"Antarktyda","AG":"Antigua i Barbuda","SA":"Arabia Saudyjska","AR":"Argentyna","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbejd\u017can","BS":"Bahamy","BH":"Bahrajn","BD":"Bangladesz","BB":"Barbados","BE":"Belgia","BZ":"Belize","BJ":"Benin","BM":"Bermudy","BT":"Bhutan","BY":"Bia\u0142oru\u015b","BO":"Boliwia","BA":"Bo\u015bnia i Hercegowina","BW":"Botswana","BR":"Brazylia","BN":"Brunei","IO":"Brytyjskie Terytorium Oceanu Indyjskiego","VG":"Brytyjskie Wyspy Dziewicze","BG":"Bu\u0142garia","BF":"Burkina Faso","BI":"Burundi","CL":"Chile","CN":"Chiny","HR":"Chorwacja","CI":"C\u00f4te d\u2019Ivoire","CW":"Cura\u00e7ao","CY":"Cypr","TD":"Czad","ME":"Czarnog\u00f3ra","CZ":"Czechy","UM":"Dalekie Wyspy Mniejsze Stan\u00f3w Zjednoczonych","DK":"Dania","CD":"Demokratyczna Republika Konga","DM":"Dominika","DO":"Dominikana","DJ":"D\u017cibuti","EG":"Egipt","EC":"Ekwador","ER":"Erytrea","EE":"Estonia","SZ":"Eswatini","ET":"Etiopia","FK":"Falklandy","FJ":"Fid\u017ci","PH":"Filipiny","FI":"Finlandia","FR":"Francja","TF":"Francuskie Terytoria Po\u0142udniowe i Antarktyczne","GA":"Gabon","GM":"Gambia","GS":"Georgia Po\u0142udniowa i Sandwich Po\u0142udniowy","GH":"Ghana","GI":"Gibraltar","GR":"Grecja","GD":"Grenada","GL":"Grenlandia","GE":"Gruzja","GU":"Guam","GG":"Guernsey","GY":"Gujana","GF":"Gujana Francuska","GP":"Gwadelupa","GT":"Gwatemala","GN":"Gwinea","GW":"Gwinea Bissau","GQ":"Gwinea R\u00f3wnikowa","HT":"Haiti","ES":"Hiszpania","NL":"Holandia","HN":"Honduras","IN":"Indie","ID":"Indonezja","IQ":"Irak","IR":"Iran","IE":"Irlandia","IS":"Islandia","IL":"Izrael","JM":"Jamajka","JP":"Japonia","YE":"Jemen","JE":"Jersey","JO":"Jordania","KY":"Kajmany","KH":"Kambod\u017ca","CM":"Kamerun","CA":"Kanada","QA":"Katar","KZ":"Kazachstan","KE":"Kenia","KG":"Kirgistan","KI":"Kiribati","CO":"Kolumbia","KM":"Komory","CG":"Kongo","KR":"Korea Po\u0142udniowa","KP":"Korea P\u00f3\u0142nocna","CR":"Kostaryka","CU":"Kuba","KW":"Kuwejt","LA":"Laos","LS":"Lesotho","LB":"Liban","LR":"Liberia","LY":"Libia","LI":"Liechtenstein","LT":"Litwa","LU":"Luksemburg","LV":"\u0141otwa","MK":"Macedonia P\u00f3\u0142nocna","MG":"Madagaskar","YT":"Majotta","MW":"Malawi","MV":"Malediwy","MY":"Malezja","ML":"Mali","MT":"Malta","MP":"Mariany P\u00f3\u0142nocne","MA":"Maroko","MQ":"Martynika","MR":"Mauretania","MU":"Mauritius","MX":"Meksyk","FM":"Mikronezja","MM":"Mjanma (Birma)","MD":"Mo\u0142dawia","MC":"Monako","MN":"Mongolia","MS":"Montserrat","MZ":"Mozambik","NA":"Namibia","NR":"Nauru","NP":"Nepal","BQ":"Niderlandy Karaibskie","DE":"Niemcy","NE":"Niger","NG":"Nigeria","NI":"Nikaragua","NU":"Niue","NF":"Norfolk","NO":"Norwegia","NC":"Nowa Kaledonia","NZ":"Nowa Zelandia","OM":"Oman","PK":"Pakistan","PW":"Palau","PA":"Panama","PG":"Papua-Nowa Gwinea","PY":"Paragwaj","PE":"Peru","PN":"Pitcairn","PF":"Polinezja Francuska","PL":"Polska","PR":"Portoryko","PT":"Portugalia","ZA":"Republika Po\u0142udniowej Afryki","CF":"Republika \u015arodkowoafryka\u0144ska","CV":"Republika Zielonego Przyl\u0105dka","RE":"Reunion","RU":"Rosja","RO":"Rumunia","RW":"Rwanda","EH":"Sahara Zachodnia","KN":"Saint Kitts i Nevis","LC":"Saint Lucia","VC":"Saint Vincent i Grenadyny","BL":"Saint-Barth\u00e9lemy","MF":"Saint-Martin","PM":"Saint-Pierre i Miquelon","SV":"Salwador","WS":"Samoa","AS":"Samoa Ameryka\u0144skie","SM":"San Marino","SN":"Senegal","RS":"Serbia","SC":"Seszele","SL":"Sierra Leone","SG":"Singapur","SX":"Sint Maarten","SK":"S\u0142owacja","SI":"S\u0142owenia","SO":"Somalia","HK":"SRA Hongkong (Chiny)","MO":"SRA Makau (Chiny)","LK":"Sri Lanka","US":"Stany Zjednoczone","SD":"Sudan","SS":"Sudan Po\u0142udniowy","SR":"Surinam","SJ":"Svalbard i Jan Mayen","SY":"Syria","CH":"Szwajcaria","SE":"Szwecja","TJ":"Tad\u017cykistan","TH":"Tajlandia","TW":"Tajwan","TZ":"Tanzania","PS":"Terytoria Palesty\u0144skie","TL":"Timor Wschodni","TG":"Togo","TK":"Tokelau","TO":"Tonga","TT":"Trynidad i Tobago","TN":"Tunezja","TR":"Turcja","TM":"Turkmenistan","TC":"Turks i Caicos","TV":"Tuvalu","UG":"Uganda","UA":"Ukraina","UY":"Urugwaj","UZ":"Uzbekistan","VU":"Vanuatu","WF":"Wallis i Futuna","VA":"Watykan","VE":"Wenezuela","HU":"W\u0119gry","GB":"Wielka Brytania","VN":"Wietnam","IT":"W\u0142ochy","BV":"Wyspa Bouveta","CX":"Wyspa Bo\u017cego Narodzenia","IM":"Wyspa Man","SH":"Wyspa \u015awi\u0119tej Heleny","AX":"Wyspy Alandzkie","CK":"Wyspy Cooka","VI":"Wyspy Dziewicze Stan\u00f3w Zjednoczonych","HM":"Wyspy Heard i McDonalda","CC":"Wyspy Kokosowe","MH":"Wyspy Marshalla","FO":"Wyspy Owcze","SB":"Wyspy Salomona","ST":"Wyspy \u015awi\u0119tego Tomasza i Ksi\u0105\u017c\u0119ca","ZM":"Zambia","ZW":"Zimbabwe","AE":"Zjednoczone Emiraty Arabskie"}