mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Updated log display.
This commit is contained in:
parent
d78f8eda37
commit
894736d474
1
.gitignore
vendored
1
.gitignore
vendored
@ -23,6 +23,7 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
*.iml
|
*.iml
|
||||||
|
*.log
|
||||||
.vscode/*
|
.vscode/*
|
||||||
|
|
||||||
# debug
|
# debug
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
.container {
|
.container {
|
||||||
color: var(--gray500);
|
color: var(--gray500);
|
||||||
|
font-size: var(--font-size-normal);
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
left: 50%;
|
left: 50%;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import React, { useMemo, useState } from 'react';
|
import React, { useMemo, useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage, useIntl } from 'react-intl';
|
||||||
import { FixedSizeList } from 'react-window';
|
import { FixedSizeList } from 'react-window';
|
||||||
import firstBy from 'thenby';
|
import firstBy from 'thenby';
|
||||||
import { format } from 'date-fns';
|
import { format } from 'date-fns';
|
||||||
@ -7,6 +7,7 @@ import Icon from 'components/common/Icon';
|
|||||||
import Tag from 'components/common/Tag';
|
import Tag from 'components/common/Tag';
|
||||||
import Dot from 'components/common/Dot';
|
import Dot from 'components/common/Dot';
|
||||||
import FilterButtons from 'components/common/FilterButtons';
|
import FilterButtons from 'components/common/FilterButtons';
|
||||||
|
import { devices } from 'components/messages';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import useCountryNames from 'hooks/useCountryNames';
|
import useCountryNames from 'hooks/useCountryNames';
|
||||||
import { BROWSERS } from 'lib/constants';
|
import { BROWSERS } from 'lib/constants';
|
||||||
@ -15,6 +16,7 @@ import Visitor from 'assets/visitor.svg';
|
|||||||
import Eye from 'assets/eye.svg';
|
import Eye from 'assets/eye.svg';
|
||||||
import { stringToColor } from 'lib/format';
|
import { stringToColor } from 'lib/format';
|
||||||
import styles from './RealtimeLog.module.css';
|
import styles from './RealtimeLog.module.css';
|
||||||
|
import NoData from '../common/NoData';
|
||||||
|
|
||||||
const TYPE_ALL = 0;
|
const TYPE_ALL = 0;
|
||||||
const TYPE_PAGEVIEW = 1;
|
const TYPE_PAGEVIEW = 1;
|
||||||
@ -28,6 +30,7 @@ const TYPE_ICONS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export default function RealtimeLog({ data, websites }) {
|
export default function RealtimeLog({ data, websites }) {
|
||||||
|
const intl = useIntl();
|
||||||
const [locale] = useLocale();
|
const [locale] = useLocale();
|
||||||
const countryNames = useCountryNames(locale);
|
const countryNames = useCountryNames(locale);
|
||||||
const [filter, setFilter] = useState(TYPE_ALL);
|
const [filter, setFilter] = useState(TYPE_ALL);
|
||||||
@ -116,9 +119,9 @@ export default function RealtimeLog({ data, websites }) {
|
|||||||
defaultMessage="Visitor from {country} using {browser} on {os} {device}"
|
defaultMessage="Visitor from {country} using {browser} on {os} {device}"
|
||||||
values={{
|
values={{
|
||||||
country: <b>{countryNames[country]}</b>,
|
country: <b>{countryNames[country]}</b>,
|
||||||
browser: BROWSERS[browser],
|
browser: <b>{BROWSERS[browser]}</b>,
|
||||||
os,
|
os: <b>{os}</b>,
|
||||||
device,
|
device: <b>{intl.formatMessage(devices[device])?.toLowerCase()}</b>,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
@ -159,6 +162,7 @@ export default function RealtimeLog({ data, websites }) {
|
|||||||
<FormattedMessage id="label.realtime-logs" defaultMessage="Realtime logs" />
|
<FormattedMessage id="label.realtime-logs" defaultMessage="Realtime logs" />
|
||||||
</div>
|
</div>
|
||||||
<div className={styles.body}>
|
<div className={styles.body}>
|
||||||
|
{logs?.length === 0 && <NoData />}
|
||||||
<FixedSizeList height={400} itemCount={logs.length} itemSize={40}>
|
<FixedSizeList height={400} itemCount={logs.length} itemSize={40}>
|
||||||
{Row}
|
{Row}
|
||||||
</FixedSizeList>
|
</FixedSizeList>
|
||||||
|
@ -14,6 +14,7 @@ files.forEach(file => {
|
|||||||
const id = file.replace('.json', '');
|
const id = file.replace('.json', '');
|
||||||
|
|
||||||
console.log(chalk.yellowBright(`\n## ${file}`));
|
console.log(chalk.yellowBright(`\n## ${file}`));
|
||||||
|
let count = 0;
|
||||||
keys.forEach(key => {
|
keys.forEach(key => {
|
||||||
const orig = messages[key];
|
const orig = messages[key];
|
||||||
const check = lang[key];
|
const check = lang[key];
|
||||||
@ -21,7 +22,12 @@ files.forEach(file => {
|
|||||||
|
|
||||||
if (!ignored && (!check || check === orig)) {
|
if (!ignored && (!check || check === orig)) {
|
||||||
console.log(chalk.redBright('*'), chalk.greenBright(`${key}:`), orig);
|
console.log(chalk.redBright('*'), chalk.greenBright(`${key}:`), orig);
|
||||||
|
count++;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (count === 0) {
|
||||||
|
console.log('**👍 Complete!**');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
{
|
{
|
||||||
"de-DE": [
|
"de-DE": [
|
||||||
"label.administrator",
|
"label.administrator",
|
||||||
|
"label.domain",
|
||||||
"label.name",
|
"label.name",
|
||||||
"metrics.device.desktop",
|
"metrics.device.desktop",
|
||||||
"metrics.device.laptop",
|
"metrics.device.laptop",
|
||||||
"metrics.device.tablet",
|
"metrics.device.tablet",
|
||||||
"metrics.referrers"
|
"metrics.referrers"
|
||||||
],
|
],
|
||||||
"fr-FR": [
|
"fr-FR": ["metrics.actions", "metrics.pages"]
|
||||||
"metrics.actions",
|
|
||||||
"metrics.pages"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user