Merge pull request #459 from mikecao/dev

v1.12.0
This commit is contained in:
Mike Cao 2021-02-01 23:03:02 -08:00 committed by GitHub
commit 30ebf7b266
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 442 additions and 1806 deletions

View File

@ -29,7 +29,7 @@ export default function DropDown({
}
useDocumentClick(e => {
if (!ref.current.contains(e.target)) {
if (!ref.current?.contains(e.target)) {
setShowMenu(false);
}
});

View File

@ -30,7 +30,7 @@ export default function MenuButton({
}
useDocumentClick(e => {
if (!ref.current.contains(e.target)) {
if (!ref.current?.contains(e.target)) {
setShowMenu(false);
}
});

View File

@ -10,12 +10,23 @@ import Arrow from 'assets/arrow-right.svg';
import styles from './WebsiteHeader.module.css';
export default function WebsiteHeader({ websiteId, title, domain, showLink = false }) {
const header = showLink ? (
<>
<Favicon domain={domain} />
<Link href="/website/[...id]" as={`/website/${websiteId}/${title}`}>
{title}
</Link>
</>
) : (
<div>
<Favicon domain={domain} />
{title}
</div>
);
return (
<PageHeader>
<div className={styles.title}>
<Favicon domain={domain} />
{title}
</div>
<div className={styles.title}>{header}</div>
<ActiveUsers className={styles.active} websiteId={websiteId} />
<ButtonLayout align="right">
<RefreshButton websiteId={websiteId} />

View File

@ -29,14 +29,13 @@ export default function AccountSettings() {
const Checkmark = ({ is_admin }) => (is_admin ? <Icon icon={<Check />} size="medium" /> : null);
const DashboardLink = row =>
row.is_admin ? null : (
<Link href={`/dashboard/${row.user_id}/${row.username}`}>
<a>
<Icon icon={<LinkIcon />} />
</a>
</Link>
);
const DashboardLink = row => (
<Link href={`/dashboard/${row.user_id}/${row.username}`}>
<a>
<Icon icon={<LinkIcon />} />
</a>
</Link>
);
const Buttons = row =>
row.username !== 'admin' ? (

View File

@ -1,7 +1,7 @@
.menu {
display: flex;
flex-flow: row wrap;
min-width: 500px;
min-width: 560px;
max-width: 100vw;
padding: 10px;
}

View File

@ -32,7 +32,7 @@
"label.login": "Zaloguj sie",
"label.logout": "Wyloguj",
"label.more": "Więcej",
"label.name": "Name",
"label.name": "Nazwa",
"label.new-password": "Nowe hasło",
"label.password": "Hasło",
"label.passwords-dont-match": "Hasła się nie zgadzają",

99
lang/pt-BR.json Normal file
View File

@ -0,0 +1,99 @@
{
"label.accounts": "Contas",
"label.add-account": "Adicionar conta",
"label.add-website": "Adicionar site",
"label.administrator": "Administrador",
"label.all": "Todos",
"label.all-websites": "Todos os sites",
"label.back": "Voltar",
"label.cancel": "Cancelar",
"label.change-password": "Alterar a senha",
"label.confirm-password": "Confirme a nova senha",
"label.copy-to-clipboard": "Copiar para a área de transferência",
"label.current-password": "Senha atual",
"label.custom-range": "Intervalo personalizado",
"label.dashboard": "Painel",
"label.date-range": "Intervalo de datas",
"label.default-date-range": "Intervalo de datas predefinido",
"label.delete": "Remover",
"label.delete-account": "Remover conta",
"label.delete-website": "Remover site",
"label.dismiss": "Dispensar",
"label.domain": "Domínio",
"label.edit": "Editar",
"label.edit-account": "Editar conta",
"label.edit-website": "Editar site",
"label.enable-share-url": "Ativar link de compartilhamento",
"label.invalid": "Inválido",
"label.invalid-domain": "Domínio inválido",
"label.last-days": "Últimos {x} dias",
"label.last-hours": "Últimas {x} horas",
"label.logged-in-as": "Sessão iniciada como {username}",
"label.login": "Iniciar sessão",
"label.logout": "Sair",
"label.more": "Mais",
"label.name": "Nome",
"label.new-password": "Nova senha",
"label.password": "Senha",
"label.passwords-dont-match": "As senhas não correspondem",
"label.profile": "Perfil",
"label.realtime": "Tempo real",
"label.realtime-logs": "Relatório em tempo real",
"label.refresh": "Atualizar",
"label.required": "Obrigatório",
"label.reset": "Redefinir",
"label.save": "Salvar",
"label.settings": "Configurações",
"label.share-url": "Link de compartilhamento",
"label.single-day": "Dia específico",
"label.this-month": "Este mês",
"label.this-week": "Esta semana",
"label.this-year": "Este ano",
"label.timezone": "Fuso horário",
"label.today": "Hoje",
"label.tracking-code": "Código de rastreamento",
"label.unknown": "Desconhecido",
"label.username": "Nome de usuário",
"label.view-details": "Ver detalhes",
"label.websites": "Sites",
"message.active-users": "{x} {x, plural, one {visitante} other {visitantes}} neste momento",
"message.confirm-delete": "Deseja realmente remover {target}?",
"message.copied": "Copiado!",
"message.delete-warning": "Todos os dados associados também serão eliminados.",
"message.failure": "Ocorreu um erro.",
"message.get-share-url": "Obter link de compartilhamento",
"message.get-tracking-code": "Obter código de rastreamento",
"message.go-to-settings": "Ir para as configurações",
"message.incorrect-username-password": "O nome de usuário e/ou senha está incorreto.",
"message.log.visitor": "Visitante de {country} usando {browser} no {device} {os}",
"message.new-version-available": "Uma nova versão de umami {version} está disponível!",
"message.no-data-available": "Sem dados disponíveis.",
"message.no-websites-configured": "Nenhum site foi configurado ainda.",
"message.page-not-found": "Página não encontrada.",
"message.powered-by": "Distribuído por {name}",
"message.save-success": "Salvo com sucesso.",
"message.share-url": "Este é o link público de compartilhamento para {target}.",
"message.track-stats": "Para gerar estatística para {target}, coloque o seguinte código no {head} do html do seu site.",
"message.type-delete": "Escreva {delete} abaixo para continuar.",
"metrics.actions": "Ações",
"metrics.average-visit-time": "Tempo médio da visita",
"metrics.bounce-rate": "Taxa de rejeição",
"metrics.browsers": "Navegadores",
"metrics.countries": "Países",
"metrics.device.desktop": "Computador",
"metrics.device.laptop": "Notebook",
"metrics.device.mobile": "Celular",
"metrics.device.tablet": "Tablet",
"metrics.devices": "Dispositivos",
"metrics.events": "Eventos",
"metrics.filter.combined": "Combinado",
"metrics.filter.domain-only": "Apenas domínio",
"metrics.filter.raw": "Dados brutos",
"metrics.operating-systems": "Sistemas operacionais",
"metrics.page-views": "Visualizações de página",
"metrics.pages": "Páginas",
"metrics.referrers": "Referências",
"metrics.unique-visitors": "Visitantes únicos",
"metrics.views": "Visualizações",
"metrics.visitors": "Visitantes"
}

View File

@ -116,7 +116,7 @@ export const BROWSERS = {
edge: 'Edge',
'edge-ios': 'Edge (iOS)',
yandexbrowser: 'Yandex',
kakaotalk: 'KKaoTalk',
kakaotalk: 'KaKaoTalk',
samsung: 'Samsung',
silk: 'Silk',
miui: 'MIUI',

View File

@ -17,6 +17,7 @@ import {
nl,
pl,
pt,
ptBR,
ro,
ru,
sv,
@ -42,6 +43,7 @@ import svMessages from 'lang-compiled/sv-SE.json';
import grMessages from 'lang-compiled/el-GR.json';
import foMessages from 'lang-compiled/fo-FO.json';
import ptMessages from 'lang-compiled/pt-PT.json';
import ptBRMessages from 'lang-compiled/pt-BR.json';
import roMessages from 'lang-compiled/ro-RO.json';
import nbNOMessages from 'lang-compiled/nb-NO.json';
import idMessages from 'lang-compiled/id-ID.json';
@ -71,6 +73,7 @@ export const messages = {
'el-GR': grMessages,
'fo-FO': foMessages,
'pt-PT': ptMessages,
'pt-BR': ptBRMessages,
'ro-RO': roMessages,
'nb-NO': nbNOMessages,
'id-ID': idMessages,
@ -101,6 +104,7 @@ export const dateLocales = {
'el-GR': el,
'fo-FO': da,
'pt-PT': pt,
'pt-BR': ptBR,
'ro-RO': ro,
'nb-NO': nb,
'id-ID': id,
@ -135,6 +139,7 @@ export const menuOptions = [
{ 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 do Brasil', value: 'pt-BR', display: 'pt-BR' },
{ label: 'Русский', value: 'ru-RU', display: 'ru' },
{ label: 'Română', value: 'ro-RO', display: 'ro' },
{ label: 'Suomi', value: 'fi-FI', display: 'fi' },

View File

@ -1,6 +1,6 @@
{
"name": "umami",
"version": "1.11.0",
"version": "1.12.0",
"description": "A simple, fast, website analytics alternative to Google Analytics. ",
"author": "Mike Cao <mike@mikecao.com>",
"license": "MIT",
@ -56,7 +56,7 @@
}
},
"dependencies": {
"@prisma/client": "2.14.0",
"@prisma/client": "2.15.0",
"@reduxjs/toolkit": "^1.5.0",
"bcrypt": "^5.0.0",
"chalk": "^4.1.0",
@ -69,17 +69,17 @@
"detect-browser": "^5.2.0",
"dotenv": "^8.2.0",
"formik": "^2.2.6",
"immer": "^8.0.0",
"immer": "^8.0.1",
"is-localhost-ip": "^1.4.0",
"isbot-fast": "^1.2.0",
"jose": "2.0.3",
"maxmind": "^4.3.1",
"moment-timezone": "^0.5.32",
"next": "^10.0.5",
"next": "^10.0.6",
"prompts": "2.4.0",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-intl": "^5.10.16",
"react-intl": "^5.12.0",
"react-redux": "^7.2.2",
"react-simple-maps": "^2.3.0",
"react-spring": "^8.0.27",
@ -97,21 +97,21 @@
},
"devDependencies": {
"@formatjs/cli": "^2.13.16",
"@prisma/cli": "2.14.0",
"@prisma/cli": "2.15.0",
"@rollup/plugin-buble": "^0.21.3",
"@rollup/plugin-node-resolve": "^11.0.1",
"@rollup/plugin-node-resolve": "^11.1.1",
"@rollup/plugin-replace": "^2.3.4",
"@svgr/webpack": "^5.5.0",
"cross-env": "^7.0.3",
"del": "^6.0.0",
"dotenv-cli": "^4.0.0",
"eslint": "^7.17.0",
"eslint-config-prettier": "^7.1.0",
"eslint": "^7.19.0",
"eslint-config-prettier": "^7.2.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"extract-react-intl-messages": "^4.1.1",
"husky": "^4.3.7",
"husky": "^4.3.8",
"lint-staged": "^10.5.3",
"loadtest": "5.1.2",
"npm-run-all": "^4.1.5",
@ -120,10 +120,10 @@
"postcss-preset-env": "^6.7.0",
"prettier": "^2.2.1",
"prettier-eslint": "^12.0.0",
"rollup": "^2.36.1",
"rollup": "^2.38.3",
"rollup-plugin-hashbang": "^2.2.2",
"rollup-plugin-terser": "^7.0.2",
"stylelint": "^13.8.0",
"stylelint": "^13.9.0",
"stylelint-config-css-modules": "^2.2.0",
"stylelint-config-prettier": "^8.0.1",
"stylelint-config-recommended": "^3.0.0",

File diff suppressed because one or more lines are too long

View File

@ -25,7 +25,7 @@ const commandlineOptions = {
maxRequests: 1,
},
// Heavy can saturate CPU which leads to requests stalling depending on machine
// Keep an eye if --verbose logs pause, or if node CPU in top is > 100.
// Keep an eye if --verbose logs pause, or if node CPU in top is > 100.
// https://github.com/alexfernandez/loadtest#usage-donts
heavy: {
concurrency: 10,
@ -51,7 +51,6 @@ const options = {
const message = JSON.stringify(mockPageView());
options.headers['Content-Length'] = message.length;
options.headers['Content-Type'] = 'application/json';
options.headers['user-agent'] = 'User-Agent: Mozilla/5.0 LoadTest';
options.body = message;
options.path = '/api/collect';
const request = client(options, callback);
@ -95,15 +94,14 @@ loadtest.loadTest(options, (error, results) => {
if (results.errorCodes && Object.keys(results.errorCodes).length) {
console.log(chalk.redBright('*'), chalk.red('Error Codes:'), results.errorCodes);
}
// console.log(results);
});
/**
* Create a new object for each request. Note, we could randomize values here if desired.
* Create a new object for each request. Note, we could randomize values here if desired.
*
* TODO: Need a better way of passing in websiteId, hostname, URL.
* TODO: Need a better way of passing in websiteId, hostname, URL.
*
* @param {object} payload pageview payload same as sent via tracker
* @param {object} payload pageview payload same as sent via tracker
*/
function mockPageView(
payload = {
@ -121,6 +119,9 @@ function mockPageView(
// If you pass in --verbose, this function is called
function statusCallback(error, result, latency) {
if (error) {
return console.error(chalk.redBright(error));
}
console.log(
chalk.yellowBright(`\n## req #${result.requestIndex + 1} of ${latency.totalRequests}`),
);

View File

@ -133,6 +133,8 @@ import { removeTrailingSlash } from '../lib/url';
/* Handle history changes */
const handlePush = (state, title, url) => {
if (!url) return;
removeEvents();
currentRef = currentUrl;
@ -144,7 +146,9 @@ import { removeTrailingSlash } from '../lib/url';
currentUrl = newUrl;
}
trackView(currentUrl, currentRef);
if (currentUrl !== currentRef) {
trackView(currentUrl, currentRef);
}
setTimeout(addEvents, 300);
};

2056
yarn.lock

File diff suppressed because it is too large Load Diff