Skip to content

Commit 2575cbf

Browse files
authored
Merge pull request #812 from mikecao/dev
v1.23.0
2 parents 9b1a75f + 668655e commit 2575cbf

File tree

11 files changed

+538
-486
lines changed

11 files changed

+538
-486
lines changed

hooks/useTheme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useEffect } from 'react';
77
export default function useTheme() {
88
const defaultTheme =
99
typeof window !== 'undefined'
10-
? window?.matchMedia('prefers-color-scheme: dark')?.matches
10+
? window?.matchMedia('(prefers-color-scheme: dark)')?.matches
1111
? 'dark'
1212
: 'light'
1313
: 'light';

lang/de-DE.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"label.accounts": "Konten",
3-
"label.add-account": "Konto hinzugfügen",
3+
"label.add-account": "Konto hinzufügen",
44
"label.add-website": "Webseite hinzufügen",
55
"label.administrator": "Administrator",
66
"label.all": "Alle",

lang/en-GB.json

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
{
2+
"label.accounts": "Accounts",
3+
"label.add-account": "Add account",
4+
"label.add-website": "Add website",
5+
"label.administrator": "Administrator",
6+
"label.all": "All",
7+
"label.all-websites": "All websites",
8+
"label.all-events": "All events",
9+
"label.back": "Back",
10+
"label.cancel": "Cancel",
11+
"label.change-password": "Change password",
12+
"label.confirm-password": "Confirm password",
13+
"label.copy-to-clipboard": "Copy to clipboard",
14+
"label.current-password": "Current password",
15+
"label.custom-range": "Custom range",
16+
"label.dashboard": "Dashboard",
17+
"label.date-range": "Date range",
18+
"label.default-date-range": "Default date range",
19+
"label.delete": "Delete",
20+
"label.delete-account": "Delete account",
21+
"label.delete-website": "Delete website",
22+
"label.reset-website": "Reset statistics",
23+
"label.dismiss": "Dismiss",
24+
"label.domain": "Domain",
25+
"label.edit": "Edit",
26+
"label.edit-account": "Edit account",
27+
"label.edit-website": "Edit website",
28+
"label.enable-share-url": "Enable share URL",
29+
"label.invalid": "Invalid",
30+
"label.invalid-domain": "Invalid domain",
31+
"label.last-days": "Last {x} days",
32+
"label.last-hours": "Last {x} hours",
33+
"label.logged-in-as": "Logged in as {username}",
34+
"label.login": "Login",
35+
"label.logout": "Logout",
36+
"label.more": "More",
37+
"label.name": "Name",
38+
"label.new-password": "New password",
39+
"label.password": "Password",
40+
"label.passwords-dont-match": "Passwords don't match",
41+
"label.profile": "Profile",
42+
"label.realtime": "Realtime",
43+
"label.realtime-logs": "Realtime logs",
44+
"label.refresh": "Refresh",
45+
"label.required": "Required",
46+
"label.reset": "Reset",
47+
"label.save": "Save",
48+
"label.settings": "Settings",
49+
"label.share-url": "Share URL",
50+
"label.single-day": "Single day",
51+
"label.this-month": "This month",
52+
"label.this-week": "This week",
53+
"label.this-year": "This year",
54+
"label.timezone": "Timezone",
55+
"label.today": "Today",
56+
"label.tracking-code": "Tracking code",
57+
"label.unknown": "Unknown",
58+
"label.username": "Username",
59+
"label.view-details": "View details",
60+
"label.websites": "Websites",
61+
"message.active-users": "{x} current {x, plural, one {visitor} other {visitors}}",
62+
"message.confirm-reset": "Are your sure you want to reset {target}'s statistics?",
63+
"message.confirm-delete": "Are your sure you want to delete {target}?",
64+
"message.copied": "Copied!",
65+
"message.reset-warning": "All statistics for this website will be deleted, but your tracking code will remain intact.",
66+
"message.delete-warning": "All associated data will be deleted as well.",
67+
"message.failure": "Something went wrong.",
68+
"message.get-share-url": "Get share URL",
69+
"message.get-tracking-code": "Get tracking code",
70+
"message.go-to-settings": "Go to settings",
71+
"message.incorrect-username-password": "Incorrect username/password.",
72+
"message.log.visitor": "Visitor from {country} using {browser} on {os} {device}",
73+
"message.new-version-available": "A new version of umami {version} is available!",
74+
"message.no-data-available": "No data available.",
75+
"message.no-websites-configured": "You don't have any websites configured.",
76+
"message.page-not-found": "Page not found.",
77+
"message.powered-by": "Powered by {name}",
78+
"message.save-success": "Saved successfully.",
79+
"message.share-url": "This is the publicly shared URL for {target}.",
80+
"message.track-stats": "To track stats for {target}, place the following code in the {head} section of your website.",
81+
"message.type-delete": "Type {delete} in the box below to confirm.",
82+
"metrics.actions": "Actions",
83+
"metrics.average-visit-time": "Average visit time",
84+
"metrics.bounce-rate": "Bounce rate",
85+
"metrics.browsers": "Browsers",
86+
"metrics.countries": "Countries",
87+
"metrics.device.desktop": "Desktop",
88+
"metrics.device.laptop": "Laptop",
89+
"metrics.device.mobile": "Mobile",
90+
"metrics.device.tablet": "Tablet",
91+
"metrics.devices": "Devices",
92+
"metrics.events": "Events",
93+
"metrics.filter.combined": "Combined",
94+
"metrics.filter.domain-only": "Domain only",
95+
"metrics.filter.raw": "Raw",
96+
"metrics.operating-systems": "Operating systems",
97+
"metrics.page-views": "Page views",
98+
"metrics.pages": "Pages",
99+
"metrics.referrers": "Referrers",
100+
"metrics.unique-visitors": "Unique visitors",
101+
"metrics.views": "Views",
102+
"metrics.visitors": "Visitors"
103+
}

lang/ru-RU.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"label.delete": "Удалить",
2020
"label.delete-account": "Удалить аккаунт",
2121
"label.delete-website": "Удалить сайт",
22+
"label.reset-website": "Сбросить статистику",
2223
"label.dismiss": "Отклонить",
2324
"label.domain": "Домен",
2425
"label.edit": "Редактировать",
@@ -58,8 +59,10 @@
5859
"label.view-details": "Посмотреть детали",
5960
"label.websites": "Сайты",
6061
"message.active-users": "{x} текущих посетителей",
62+
"message.confirm-reset": "Вы уверены, что хотите сбросить статистику {target}?",
6163
"message.confirm-delete": "Вы уверены, что хотите удалить {target}?",
6264
"message.copied": "Скопировано!",
65+
"message.reset-warning": "Вся статистика для этого сайта будет удалена, но ваш код отслеживания останется нетронутым.",
6366
"message.delete-warning": "Все связанные данные будут также удалены.",
6467
"message.failure": "Что-то пошло не так.",
6568
"message.get-share-url": "Получить публичную ссылку",

lib/lang.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
de,
77
el,
88
enUS,
9+
enGB,
910
es,
1011
fi,
1112
fr,
@@ -44,7 +45,8 @@ export const languages = {
4445
'cs-CZ': { label: 'Čeština', display: 'cs' },
4546
'da-DK': { label: 'Dansk', display: 'da' },
4647
'de-DE': { label: 'Deutsch', display: 'de' },
47-
'en-US': { label: 'English', display: 'en' },
48+
'en-US': { label: 'English (US)', display: 'en' },
49+
'en-GB': { label: 'English (UK)', display: 'en-GB'},
4850
'es-MX': { label: 'Español', display: 'es' },
4951
'fa-IR': { label: 'فارسی', display: 'fa' },
5052
'fo-FO': { label: 'Føroyskt', display: 'fo' },
@@ -67,7 +69,7 @@ export const languages = {
6769
'ru-RU': { label: 'Русский', display: 'ru' },
6870
'ro-RO': { label: 'Română', display: 'ro' },
6971
'sk-SK': { label: 'Slovenčina', display: 'sk' },
70-
'sl-SI': { label: 'Slovene', display: 'sl' },
72+
'sl-SI': { label: 'Slovenščina', display: 'sl' },
7173
'fi-FI': { label: 'Suomi', display: 'fi' },
7274
'sv-SE': { label: 'Svenska', display: 'sv' },
7375
'ta-IN': { label: 'தமிழ்', display: 'ta' },
@@ -80,6 +82,7 @@ export const rtlLocales = ['ar-SA', 'fa-IR'];
8082
export const dateLocales = {
8183
'ar-SA': arSA,
8284
'en-US': enUS,
85+
'en-GB': enGB,
8386
'nl-NL': nl,
8487
'zh-CN': zhCN,
8588
'zh-TW': zhTW,

lib/queries.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,21 @@ export function getEventMetrics(
465465
filters = {},
466466
) {
467467
const params = [website_id, start_at, end_at];
468-
const { url } = filters;
468+
const { url, event_type } = filters;
469469

470470
let urlFilter = '';
471+
let eventTypeFilter = '';
471472

472473
if (url) {
473474
urlFilter = `and url=$${params.length + 1}`;
474475
params.push(decodeURIComponent(url));
475476
}
476477

478+
if (event_type) {
479+
eventTypeFilter = `and event_type=$${params.length + 1}`;
480+
params.push(event_type);
481+
}
482+
477483
return rawQuery(
478484
`
479485
select
@@ -484,6 +490,7 @@ export function getEventMetrics(
484490
where website_id=$1
485491
and created_at between $2 and $3
486492
${urlFilter}
493+
${eventTypeFilter}
487494
group by 1, 2
488495
order by 2
489496
`,

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "umami",
3-
"version": "1.22.0",
3+
"version": "1.23.0",
44
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
55
"author": "Mike Cao <[email protected]>",
66
"license": "MIT",
@@ -56,10 +56,10 @@
5656
}
5757
},
5858
"dependencies": {
59-
"@fontsource/inter": "^4.5.0",
60-
"@fontsource/noto-sans-jp": "^4.5.0",
61-
"@fontsource/noto-sans-sc": "^4.5.0",
62-
"@fontsource/noto-sans-tc": "^4.5.0",
59+
"@fontsource/inter": "4.5.0",
60+
"@fontsource/noto-sans-jp": "4.5.0",
61+
"@fontsource/noto-sans-sc": "4.5.0",
62+
"@fontsource/noto-sans-tc": "4.5.0",
6363
"@prisma/client": "2.29.1",
6464
"@reduxjs/toolkit": "^1.6.1",
6565
"bcryptjs": "^2.4.3",
@@ -73,7 +73,7 @@
7373
"detect-browser": "^5.2.0",
7474
"dotenv": "^8.2.0",
7575
"formik": "^2.2.9",
76-
"immer": "^9.0.5",
76+
"immer": "^9.0.6",
7777
"ipaddr.js": "^2.0.1",
7878
"is-localhost-ip": "^1.4.0",
7979
"isbot": "^3.2.2",

pages/api/auth/login.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import { serialize } from 'cookie';
22
import { checkPassword, createSecureToken } from 'lib/crypto';
33
import { getAccountByUsername } from 'lib/queries';
44
import { AUTH_COOKIE_NAME } from 'lib/constants';
5-
import { ok, unauthorized } from 'lib/response';
5+
import { ok, unauthorized, badRequest } from 'lib/response';
66

77
export default async (req, res) => {
88
const { username, password } = req.body;
99

10+
if (!username || !password) {
11+
return badRequest(res);
12+
}
13+
1014
const account = await getAccountByUsername(username);
1115

1216
if (account && (await checkPassword(password, account.password))) {

pages/api/website/[id]/events.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default async (req, res) => {
1111
return unauthorized(res);
1212
}
1313

14-
const { id, start_at, end_at, unit, tz, url } = req.query;
14+
const { id, start_at, end_at, unit, tz, url, event_type } = req.query;
1515

1616
if (!moment.tz.zone(tz) || !unitTypes.includes(unit)) {
1717
return badRequest(res);
@@ -21,7 +21,10 @@ export default async (req, res) => {
2121
const startDate = new Date(+start_at);
2222
const endDate = new Date(+end_at);
2323

24-
const events = await getEventMetrics(websiteId, startDate, endDate, tz, unit, { url });
24+
const events = await getEventMetrics(websiteId, startDate, endDate, tz, unit, {
25+
url,
26+
event_type,
27+
});
2528

2629
return ok(res, events);
2730
}

public/country/en-GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"AF":"Afghanistan","AX":"\u00c5land Islands","AL":"Albania","DZ":"Algeria","AS":"American Samoa","AD":"Andorra","AO":"Angola","AI":"Anguilla","AQ":"Antarctica","AG":"Antigua & Barbuda","AR":"Argentina","AM":"Armenia","AW":"Aruba","AU":"Australia","AT":"Austria","AZ":"Azerbaijan","BS":"Bahamas","BH":"Bahrain","BD":"Bangladesh","BB":"Barbados","BY":"Belarus","BE":"Belgium","BZ":"Belize","BJ":"Benin","BM":"Bermuda","BT":"Bhutan","BO":"Bolivia","BA":"Bosnia & Herzegovina","BW":"Botswana","BV":"Bouvet Island","BR":"Brazil","IO":"British Indian Ocean Territory","VG":"British Virgin Islands","BN":"Brunei","BG":"Bulgaria","BF":"Burkina Faso","BI":"Burundi","KH":"Cambodia","CM":"Cameroon","CA":"Canada","CV":"Cape Verde","BQ":"Caribbean Netherlands","KY":"Cayman Islands","CF":"Central African Republic","TD":"Chad","CL":"Chile","CN":"China","CX":"Christmas Island","CC":"Cocos (Keeling) Islands","CO":"Colombia","KM":"Comoros","CG":"Congo - Brazzaville","CD":"Congo - Kinshasa","CK":"Cook Islands","CR":"Costa Rica","CI":"C\u00f4te d\u2019Ivoire","HR":"Croatia","CU":"Cuba","CW":"Cura\u00e7ao","CY":"Cyprus","CZ":"Czechia","DK":"Denmark","DJ":"Djibouti","DM":"Dominica","DO":"Dominican Republic","EC":"Ecuador","EG":"Egypt","SV":"El Salvador","GQ":"Equatorial Guinea","ER":"Eritrea","EE":"Estonia","SZ":"Eswatini","ET":"Ethiopia","FK":"Falkland Islands","FO":"Faroe Islands","FJ":"Fiji","FI":"Finland","FR":"France","GF":"French Guiana","PF":"French Polynesia","TF":"French Southern Territories","GA":"Gabon","GM":"Gambia","GE":"Georgia","DE":"Germany","GH":"Ghana","GI":"Gibraltar","GR":"Greece","GL":"Greenland","GD":"Grenada","GP":"Guadeloupe","GU":"Guam","GT":"Guatemala","GG":"Guernsey","GN":"Guinea","GW":"Guinea-Bissau","GY":"Guyana","HT":"Haiti","HM":"Heard & McDonald Islands","HN":"Honduras","HK":"Hong Kong SAR China","HU":"Hungary","IS":"Iceland","IN":"India","ID":"Indonesia","IR":"Iran","IQ":"Iraq","IE":"Ireland","IM":"Isle of Man","IL":"Israel","IT":"Italy","JM":"Jamaica","JP":"Japan","JE":"Jersey","JO":"Jordan","KZ":"Kazakhstan","KE":"Kenya","KI":"Kiribati","KW":"Kuwait","KG":"Kyrgyzstan","LA":"Laos","LV":"Latvia","LB":"Lebanon","LS":"Lesotho","LR":"Liberia","LY":"Libya","LI":"Liechtenstein","LT":"Lithuania","LU":"Luxembourg","MO":"Macao SAR China","MG":"Madagascar","MW":"Malawi","MY":"Malaysia","MV":"Maldives","ML":"Mali","MT":"Malta","MH":"Marshall Islands","MQ":"Martinique","MR":"Mauritania","MU":"Mauritius","YT":"Mayotte","MX":"Mexico","FM":"Micronesia","MD":"Moldova","MC":"Monaco","MN":"Mongolia","ME":"Montenegro","MS":"Montserrat","MA":"Morocco","MZ":"Mozambique","MM":"Myanmar (Burma)","NA":"Namibia","NR":"Nauru","NP":"Nepal","NL":"Netherlands","NC":"New Caledonia","NZ":"New Zealand","NI":"Nicaragua","NE":"Niger","NG":"Nigeria","NU":"Niue","NF":"Norfolk Island","KP":"North Korea","MK":"North Macedonia","MP":"Northern Mariana Islands","NO":"Norway","OM":"Oman","PK":"Pakistan","PW":"Palau","PS":"Palestinian Territories","PA":"Panama","PG":"Papua New Guinea","PY":"Paraguay","PE":"Peru","PH":"Philippines","PN":"Pitcairn Islands","PL":"Poland","PT":"Portugal","PR":"Puerto Rico","QA":"Qatar","RE":"R\u00e9union","RO":"Romania","RU":"Russia","RW":"Rwanda","WS":"Samoa","SM":"San Marino","ST":"S\u00e3o Tom\u00e9 & Pr\u00edncipe","SA":"Saudi Arabia","SN":"Senegal","RS":"Serbia","SC":"Seychelles","SL":"Sierra Leone","SG":"Singapore","SX":"Sint Maarten","SK":"Slovakia","SI":"Slovenia","SB":"Solomon Islands","SO":"Somalia","ZA":"South Africa","GS":"South Georgia & South Sandwich Islands","KR":"South Korea","SS":"South Sudan","ES":"Spain","LK":"Sri Lanka","BL":"St. Barth\u00e9lemy","SH":"St. Helena","KN":"St. Kitts & Nevis","LC":"St. Lucia","MF":"St. Martin","PM":"St. Pierre & Miquelon","VC":"St. Vincent & Grenadines","SD":"Sudan","SR":"Suriname","SJ":"Svalbard & Jan Mayen","SE":"Sweden","CH":"Switzerland","SY":"Syria","TW":"Taiwan","TJ":"Tajikistan","TZ":"Tanzania","TH":"Thailand","TL":"Timor-Leste","TG":"Togo","TK":"Tokelau","TO":"Tonga","TT":"Trinidad & Tobago","TN":"Tunisia","TR":"Turkey","TM":"Turkmenistan","TC":"Turks & Caicos Islands","TV":"Tuvalu","UM":"U.S. Outlying Islands","VI":"U.S. Virgin Islands","UG":"Uganda","UA":"Ukraine","AE":"United Arab Emirates","GB":"United Kingdom","US":"United States","UY":"Uruguay","UZ":"Uzbekistan","VU":"Vanuatu","VA":"Vatican City","VE":"Venezuela","VN":"Vietnam","WF":"Wallis & Futuna","EH":"Western Sahara","YE":"Yemen","ZM":"Zambia","ZW":"Zimbabwe"}

0 commit comments

Comments
 (0)