mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-20 00:03:40 +01:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
77d2e348b6
19
.github/stale.yml
vendored
Normal file
19
.github/stale.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Number of days of inactivity before an issue becomes stale
|
||||||
|
daysUntilStale: 60
|
||||||
|
# Number of days of inactivity before a stale issue is closed
|
||||||
|
daysUntilClose: 7
|
||||||
|
# Issues with these labels will never be considered stale
|
||||||
|
exemptLabels:
|
||||||
|
- pinned
|
||||||
|
- security
|
||||||
|
- enhancement
|
||||||
|
- bug
|
||||||
|
# Label to use when marking an issue as stale
|
||||||
|
staleLabel: wontfix
|
||||||
|
# Comment to post when marking an issue as stale. Set to `false` to disable
|
||||||
|
markComment: >
|
||||||
|
This issue has been automatically marked as stale because it has not had
|
||||||
|
recent activity. It will be closed if no further activity occurs. Thank you
|
||||||
|
for your contributions.
|
||||||
|
# Comment to post when closing a stale issue. Set to `false` to disable
|
||||||
|
closeComment: false
|
1
assets/external-link.svg
Normal file
1
assets/external-link.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M497.6,0,334.4.17A14.4,14.4,0,0,0,320,14.57V47.88a14.4,14.4,0,0,0,14.69,14.4l73.63-2.72,2.06,2.06L131.52,340.49a12,12,0,0,0,0,17l23,23a12,12,0,0,0,17,0L450.38,101.62l2.06,2.06-2.72,73.63A14.4,14.4,0,0,0,464.12,192h33.31a14.4,14.4,0,0,0,14.4-14.4L512,14.4A14.4,14.4,0,0,0,497.6,0ZM432,288H416a16,16,0,0,0-16,16V458a6,6,0,0,1-6,6H54a6,6,0,0,1-6-6V118a6,6,0,0,1,6-6H208a16,16,0,0,0,16-16V80a16,16,0,0,0-16-16H48A48,48,0,0,0,0,112V464a48,48,0,0,0,48,48H400a48,48,0,0,0,48-48V304A16,16,0,0,0,432,288Z"/></svg>
|
After Width: | Height: | Size: 575 B |
@ -1 +1,2 @@
|
|||||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 428 389.11"><defs><style>.cls-1{fill:#fff;stroke:#000;stroke-miterlimit:10;stroke-width:20px;}</style></defs><g id="Layer_2" data-name="Layer 2"><g id="Layer_4" data-name="Layer 4"><circle class="cls-1" cx="214.15" cy="181" r="171"/><path d="M413,134.11H15.29a15,15,0,0,0-15,15v15.3C.12,168,0,171.52,0,175.11c0,118.19,95.81,214,214,214,116.4,0,211.1-92.94,213.93-208.67,0-.44.07-.88.07-1.33v-30A15,15,0,0,0,413,134.11Z"/></g></g></svg>
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 428 389.11">
|
||||||
|
<circle cx="214.15" cy="181" r="171" fill="none" stroke="currentColor" stroke-miterlimit="10" stroke-width="20"/><path d="M413,134.11H15.29a15,15,0,0,0-15,15v15.3C.12,168,0,171.52,0,175.11c0,118.19,95.81,214,214,214,116.4,0,211.1-92.94,213.93-208.67,0-.44.07-.88.07-1.33v-30A15,15,0,0,0,413,134.11Z"/></svg>
|
Before Width: | Height: | Size: 488 B After Width: | Height: | Size: 377 B |
1
assets/moon.svg
Normal file
1
assets/moon.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1399.98 1400"><path d="M562.44,837.55C335.89,611,288.08,273.54,418.71,0A734.31,734.31,0,0,0,215.54,143.73c-287.39,287.39-287.39,753.33,0,1040.72s753.33,287.4,1040.74,0A733.8,733.8,0,0,0,1400,981.29C1126.45,1111.92,789,1064.09,562.44,837.55Z"/></svg>
|
After Width: | Height: | Size: 302 B |
1
assets/sun.svg
Normal file
1
assets/sun.svg
Normal file
@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1400 1400"><path d="M367.43,422.13a54.44,54.44,0,0,1-38.66-16L205,282.35A54.69,54.69,0,0,1,282.37,205L406.11,328.79a54.68,54.68,0,0,1-38.68,93.34Z"/><path d="M1156.3,1211a54.51,54.51,0,0,1-38.67-16L993.89,1071.21a54.68,54.68,0,1,1,77.34-77.33L1195,1117.65A54.7,54.7,0,0,1,1156.3,1211Z"/><path d="M243.7,1211A54.7,54.7,0,0,1,205,1117.65L328.74,993.89a54.69,54.69,0,0,1,77.36,77.32L282.37,1195A54.51,54.51,0,0,1,243.7,1211Z"/><path d="M1032.57,422.13a54.68,54.68,0,0,1-38.68-93.34L1117.61,205A54.69,54.69,0,0,1,1195,282.35L1071.23,406.11A54.44,54.44,0,0,1,1032.57,422.13Z"/><path d="M229.69,754.69h-175a54.69,54.69,0,0,1,0-109.38h175a54.69,54.69,0,0,1,0,109.38Z"/><path d="M1345.31,754.69h-175a54.69,54.69,0,0,1,0-109.38h175a54.69,54.69,0,0,1,0,109.38Z"/><path d="M700,1400a54.68,54.68,0,0,1-54.69-54.69v-175a54.69,54.69,0,0,1,109.38,0v175A54.68,54.68,0,0,1,700,1400Z"/><path d="M700,284.38a54.7,54.7,0,0,1-54.69-54.69v-175a54.69,54.69,0,0,1,109.38,0v175A54.7,54.7,0,0,1,700,284.38Z"/><circle cx="700" cy="700" r="306.25"/></svg>
|
After Width: | Height: | Size: 1.1 KiB |
@ -1,5 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import WebsiteChart from 'components/metrics/WebsiteChart';
|
import WebsiteChart from 'components/metrics/WebsiteChart';
|
||||||
import WorldMap from 'components/common/WorldMap';
|
import WorldMap from 'components/common/WorldMap';
|
||||||
@ -19,12 +20,29 @@ import EventsChart from './metrics/EventsChart';
|
|||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
import Loading from 'components/common/Loading';
|
import Loading from 'components/common/Loading';
|
||||||
|
|
||||||
export default function WebsiteDetails({ websiteId }) {
|
const views = {
|
||||||
const { data } = useFetch(`/api/website/${websiteId}`);
|
url: PagesTable,
|
||||||
|
referrer: ReferrersTable,
|
||||||
|
browser: BrowsersTable,
|
||||||
|
os: OSTable,
|
||||||
|
device: DevicesTable,
|
||||||
|
country: CountriesTable,
|
||||||
|
event: EventsTable,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default function WebsiteDetails({ websiteId, token }) {
|
||||||
|
const router = useRouter();
|
||||||
|
const { data } = useFetch(`/api/website/${websiteId}`, { token });
|
||||||
const [chartLoaded, setChartLoaded] = useState(false);
|
const [chartLoaded, setChartLoaded] = useState(false);
|
||||||
const [countryData, setCountryData] = useState();
|
const [countryData, setCountryData] = useState();
|
||||||
const [eventsData, setEventsData] = useState();
|
const [eventsData, setEventsData] = useState();
|
||||||
const [expand, setExpand] = useState();
|
const {
|
||||||
|
query: { id, view },
|
||||||
|
basePath,
|
||||||
|
asPath,
|
||||||
|
} = router;
|
||||||
|
|
||||||
|
const path = `${basePath}/${asPath.split('/')[1]}/${id.join('/')}`;
|
||||||
|
|
||||||
const BackButton = () => (
|
const BackButton = () => (
|
||||||
<Button
|
<Button
|
||||||
@ -32,7 +50,7 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
className={styles.backButton}
|
className={styles.backButton}
|
||||||
icon={<Arrow />}
|
icon={<Arrow />}
|
||||||
size="xsmall"
|
size="xsmall"
|
||||||
onClick={() => setExpand(null)}
|
onClick={() => router.push(path)}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="button.back" defaultMessage="Back" />
|
<FormattedMessage id="button.back" defaultMessage="Back" />
|
||||||
@ -46,53 +64,43 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.pages" defaultMessage="Pages" />,
|
label: <FormattedMessage id="metrics.pages" defaultMessage="Pages" />,
|
||||||
value: 'url',
|
value: `${path}?view=url`,
|
||||||
component: PagesTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.referrers" defaultMessage="Referrers" />,
|
label: <FormattedMessage id="metrics.referrers" defaultMessage="Referrers" />,
|
||||||
value: 'referrer',
|
value: `${path}?view=referrer`,
|
||||||
component: ReferrersTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.browsers" defaultMessage="Browsers" />,
|
label: <FormattedMessage id="metrics.browsers" defaultMessage="Browsers" />,
|
||||||
value: 'browser',
|
value: `${path}?view=browser`,
|
||||||
component: BrowsersTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.operating-systems" defaultMessage="Operating system" />,
|
label: <FormattedMessage id="metrics.operating-systems" defaultMessage="Operating system" />,
|
||||||
value: 'os',
|
value: `${path}?view=os`,
|
||||||
component: OSTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.devices" defaultMessage="Devices" />,
|
label: <FormattedMessage id="metrics.devices" defaultMessage="Devices" />,
|
||||||
value: 'device',
|
value: `${path}?view=device`,
|
||||||
component: DevicesTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.countries" defaultMessage="Countries" />,
|
label: <FormattedMessage id="metrics.countries" defaultMessage="Countries" />,
|
||||||
value: 'country',
|
value: `${path}?view=country`,
|
||||||
component: CountriesTable,
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="metrics.events" defaultMessage="Events" />,
|
label: <FormattedMessage id="metrics.events" defaultMessage="Events" />,
|
||||||
value: 'event',
|
value: `${path}?view=event`,
|
||||||
component: EventsTable,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const tableProps = {
|
const tableProps = {
|
||||||
websiteId,
|
websiteId,
|
||||||
|
token,
|
||||||
websiteDomain: data?.domain,
|
websiteDomain: data?.domain,
|
||||||
limit: 10,
|
limit: 10,
|
||||||
onExpand: handleExpand,
|
onExpand: handleExpand,
|
||||||
};
|
};
|
||||||
|
|
||||||
const DetailsComponent = expand?.component;
|
const DetailsComponent = views[view];
|
||||||
|
|
||||||
function getSelectedMenuOption(value) {
|
|
||||||
return menuOptions.find(e => e.value === value);
|
|
||||||
}
|
|
||||||
|
|
||||||
function handleDataLoad() {
|
function handleDataLoad() {
|
||||||
if (!chartLoaded) {
|
if (!chartLoaded) {
|
||||||
@ -101,11 +109,7 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function handleExpand(value) {
|
function handleExpand(value) {
|
||||||
setExpand(getSelectedMenuOption(value));
|
router.push(`${path}?view=${value}`);
|
||||||
}
|
|
||||||
|
|
||||||
function handleMenuSelect(value) {
|
|
||||||
setExpand(getSelectedMenuOption(value));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
@ -118,6 +122,7 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
<div className={classNames(styles.chart, 'col')}>
|
<div className={classNames(styles.chart, 'col')}>
|
||||||
<WebsiteChart
|
<WebsiteChart
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
title={data.name}
|
title={data.name}
|
||||||
onDataLoad={handleDataLoad}
|
onDataLoad={handleDataLoad}
|
||||||
showLink={false}
|
showLink={false}
|
||||||
@ -126,7 +131,7 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{!chartLoaded && <Loading />}
|
{!chartLoaded && <Loading />}
|
||||||
{chartLoaded && !expand && (
|
{chartLoaded && !view && (
|
||||||
<>
|
<>
|
||||||
<div className={classNames(styles.row, 'row')}>
|
<div className={classNames(styles.row, 'row')}>
|
||||||
<div className="col-md-12 col-lg-6">
|
<div className="col-md-12 col-lg-6">
|
||||||
@ -162,19 +167,17 @@ export default function WebsiteDetails({ websiteId }) {
|
|||||||
<EventsTable {...tableProps} onDataLoad={setEventsData} />
|
<EventsTable {...tableProps} onDataLoad={setEventsData} />
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-md-12 col-lg-8 pt-5 pb-5">
|
<div className="col-12 col-md-12 col-lg-8 pt-5 pb-5">
|
||||||
<EventsChart websiteId={websiteId} />
|
<EventsChart websiteId={websiteId} token={token} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{expand && (
|
{view && (
|
||||||
<MenuLayout
|
<MenuLayout
|
||||||
className={styles.expand}
|
className={styles.view}
|
||||||
menuClassName={styles.menu}
|
menuClassName={styles.menu}
|
||||||
optionClassName={styles.option}
|
contentClassName={styles.content}
|
||||||
menu={menuOptions}
|
menu={menuOptions}
|
||||||
selectedOption={expand.value}
|
|
||||||
onMenuSelect={handleMenuSelect}
|
|
||||||
>
|
>
|
||||||
<DetailsComponent {...tableProps} limit={false} />
|
<DetailsComponent {...tableProps} limit={false} />
|
||||||
</MenuLayout>
|
</MenuLayout>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.expand {
|
.view {
|
||||||
border-top: 1px solid var(--gray300);
|
border-top: 1px solid var(--gray300);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,8 +10,9 @@
|
|||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
}
|
}
|
||||||
|
|
||||||
.menu .option {
|
.content {
|
||||||
font-size: var(--font-size-small);
|
min-height: 600px;
|
||||||
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.backButton {
|
.backButton {
|
||||||
@ -30,7 +31,7 @@
|
|||||||
|
|
||||||
.row > [class*='col-'] {
|
.row > [class*='col-'] {
|
||||||
border-left: 1px solid var(--gray300);
|
border-left: 1px solid var(--gray300);
|
||||||
padding: 0 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row > [class*='col-']:first-child {
|
.row > [class*='col-']:first-child {
|
||||||
|
@ -11,7 +11,7 @@ import styles from './WebsiteList.module.css';
|
|||||||
|
|
||||||
export default function WebsiteList({ userId }) {
|
export default function WebsiteList({ userId }) {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { data } = useFetch('/api/websites', { userId });
|
const { data } = useFetch('/api/websites', { user_id: userId });
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
return null;
|
return null;
|
||||||
@ -28,17 +28,14 @@ export default function WebsiteList({ userId }) {
|
|||||||
<EmptyPlaceholder
|
<EmptyPlaceholder
|
||||||
msg={
|
msg={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="placeholder.message.no-websites-configured"
|
id="message.no-websites-configured"
|
||||||
defaultMessage="You don't have any websites configured."
|
defaultMessage="You don't have any websites configured."
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Button icon={<Arrow />} size="medium" onClick={() => router.push('/settings')}>
|
<Button icon={<Arrow />} size="medium" onClick={() => router.push('/settings')}>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage
|
<FormattedMessage id="message.go-to-settings" defaultMessage="Go to settings" />
|
||||||
id="placeholder.message.go-to-settings"
|
|
||||||
defaultMessage="Go to settings"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</EmptyPlaceholder>
|
</EmptyPlaceholder>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: var(--font-size-normal);
|
font-size: var(--font-size-normal);
|
||||||
|
color: var(--gray900);
|
||||||
background: var(--gray100);
|
background: var(--gray100);
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
@ -18,7 +19,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.button:active {
|
.button:active {
|
||||||
color: initial;
|
color: var(--gray900);
|
||||||
}
|
}
|
||||||
|
|
||||||
.large {
|
.large {
|
||||||
@ -56,11 +57,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.light {
|
.light {
|
||||||
background: var(--gray50);
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.light:hover {
|
.light:hover {
|
||||||
background: var(--gray75);
|
background: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button:disabled {
|
.button:disabled {
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
.group .button {
|
.group .button {
|
||||||
border-radius: 0;
|
border-radius: 0;
|
||||||
|
color: var(--gray800);
|
||||||
background: var(--gray50);
|
background: var(--gray50);
|
||||||
border-left: 1px solid var(--gray500);
|
border-left: 1px solid var(--gray500);
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
@ -24,6 +25,7 @@
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected {
|
.group .button.selected {
|
||||||
|
color: var(--gray900);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ export default function Calendar({ date, minDate, maxDate, onChange }) {
|
|||||||
<Icon className={styles.icon} icon={selectYear ? <Cross /> : <Chevron />} size="small" />
|
<Icon className={styles.icon} icon={selectYear ? <Cross /> : <Chevron />} size="small" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className={styles.body}>
|
||||||
{!selectMonth && !selectYear && (
|
{!selectMonth && !selectYear && (
|
||||||
<DaySelector
|
<DaySelector
|
||||||
date={date}
|
date={date}
|
||||||
@ -99,13 +100,14 @@ export default function Calendar({ date, minDate, maxDate, onChange }) {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => {
|
const DaySelector = ({ date, minDate, maxDate, locale, onSelect }) => {
|
||||||
const startWeek = startOfWeek(date);
|
const startWeek = startOfWeek(date);
|
||||||
const startMonth = startOfMonth(date);
|
const startMonth = startOfMonth(date);
|
||||||
const startDay = subDays(startMonth, startMonth.getDay() + 1);
|
const startDay = subDays(startMonth, startMonth.getDay());
|
||||||
const month = date.getMonth();
|
const month = date.getMonth();
|
||||||
const year = date.getFullYear();
|
const year = date.getFullYear();
|
||||||
|
|
||||||
@ -220,14 +222,16 @@ const YearSelector = ({ date, minDate, maxDate, onSelect }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.pager}>
|
<div className={styles.pager}>
|
||||||
|
<div className={styles.left}>
|
||||||
<Button
|
<Button
|
||||||
icon={<Chevron />}
|
icon={<Chevron />}
|
||||||
size="small"
|
size="small"
|
||||||
className={styles.left}
|
|
||||||
onClick={handlePrevClick}
|
onClick={handlePrevClick}
|
||||||
disabled={years[0] <= minYear}
|
disabled={years[0] <= minYear}
|
||||||
variant="light"
|
variant="light"
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={styles.middle}>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
{chunk(years, 5).map((row, i) => (
|
{chunk(years, 5).map((row, i) => (
|
||||||
@ -248,14 +252,16 @@ const YearSelector = ({ date, minDate, maxDate, onSelect }) => {
|
|||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
<div className={styles.right}>
|
||||||
<Button
|
<Button
|
||||||
icon={<Chevron />}
|
icon={<Chevron />}
|
||||||
size="small"
|
size="small"
|
||||||
className={styles.right}
|
|
||||||
onClick={handleNextClick}
|
onClick={handleNextClick}
|
||||||
disabled={years[years.length - 1] > maxYear}
|
disabled={years[years.length - 1] > maxYear}
|
||||||
variant="light"
|
variant="light"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -3,11 +3,12 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
flex: 1;
|
flex: 1;
|
||||||
min-height: 285px;
|
min-height: 306px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar table {
|
.calendar table {
|
||||||
flex: 1;
|
width: 100%;
|
||||||
|
border-spacing: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar td {
|
.calendar td {
|
||||||
@ -16,12 +17,14 @@
|
|||||||
text-align: center;
|
text-align: center;
|
||||||
vertical-align: center;
|
vertical-align: center;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
min-width: 40px;
|
width: 40px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
border: 1px solid transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar td:hover {
|
.calendar td:hover {
|
||||||
background: var(--gray100);
|
border: 1px solid var(--gray300);
|
||||||
|
background: var(--gray75);
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar td.faded {
|
.calendar td.faded {
|
||||||
@ -45,6 +48,7 @@
|
|||||||
.calendar td.disabled:hover {
|
.calendar td.disabled:hover {
|
||||||
cursor: default;
|
cursor: default;
|
||||||
background: var(--gray75);
|
background: var(--gray75);
|
||||||
|
border-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar td.faded.disabled {
|
.calendar td.faded.disabled {
|
||||||
@ -60,18 +64,34 @@
|
|||||||
font-size: var(--font-size-normal);
|
font-size: var(--font-size-normal);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.body {
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
.selector {
|
.selector {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pager {
|
.pager {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.pager button {
|
.pager button {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.middle {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left,
|
||||||
|
.right {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
.left svg {
|
.left svg {
|
||||||
transform: rotate(90deg);
|
transform: rotate(90deg);
|
||||||
}
|
}
|
||||||
@ -83,3 +103,9 @@
|
|||||||
.icon {
|
.icon {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 992px) {
|
||||||
|
.calendar table {
|
||||||
|
max-width: calc(100vw - 30px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { endOfYear } from 'date-fns';
|
import { endOfYear, isSameDay } from 'date-fns';
|
||||||
import Modal from './Modal';
|
import Modal from './Modal';
|
||||||
import DropDown from './DropDown';
|
import DropDown from './DropDown';
|
||||||
import DatePickerForm from 'components/forms/DatePickerForm';
|
import DatePickerForm from 'components/forms/DatePickerForm';
|
||||||
@ -112,7 +112,8 @@ const CustomRange = ({ startDate, endDate, onClick }) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Icon icon={<Calendar />} className="mr-2" onClick={handleClick} />
|
<Icon icon={<Calendar />} className="mr-2" onClick={handleClick} />
|
||||||
{`${dateFormat(startDate, 'd LLL y', locale)} — ${dateFormat(endDate, 'd LLL y', locale)}`}
|
{dateFormat(startDate, 'd LLL y', locale)}
|
||||||
|
{!isSameDay(startDate, endDate) && ` — ${dateFormat(endDate, 'd LLL y', locale)}`}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -15,6 +15,7 @@ export default function DropDown({
|
|||||||
}) {
|
}) {
|
||||||
const [showMenu, setShowMenu] = useState(false);
|
const [showMenu, setShowMenu] = useState(false);
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
|
const selectedOption = options.find(e => e.value === value);
|
||||||
|
|
||||||
function handleShowMenu() {
|
function handleShowMenu() {
|
||||||
setShowMenu(state => !state);
|
setShowMenu(state => !state);
|
||||||
@ -40,7 +41,13 @@ export default function DropDown({
|
|||||||
<Icon icon={<Chevron />} className={styles.icon} size="small" />
|
<Icon icon={<Chevron />} className={styles.icon} size="small" />
|
||||||
</div>
|
</div>
|
||||||
{showMenu && (
|
{showMenu && (
|
||||||
<Menu className={menuClassName} options={options} onSelect={handleSelect} float="bottom" />
|
<Menu
|
||||||
|
className={menuClassName}
|
||||||
|
options={options}
|
||||||
|
selectedOption={selectedOption}
|
||||||
|
onSelect={handleSelect}
|
||||||
|
float="bottom"
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -20,5 +20,5 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
padding-left: 10px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
|
@ -1,65 +0,0 @@
|
|||||||
import React, { useState, useRef } from 'react';
|
|
||||||
import Head from 'next/head';
|
|
||||||
import Globe from 'assets/globe.svg';
|
|
||||||
import useDocumentClick from 'hooks/useDocumentClick';
|
|
||||||
import Menu from './Menu';
|
|
||||||
import Button from './Button';
|
|
||||||
import { menuOptions } from 'lib/lang';
|
|
||||||
import styles from './LanguageButton.module.css';
|
|
||||||
import useLocale from '../../hooks/useLocale';
|
|
||||||
|
|
||||||
export default function LanguageButton({ menuPosition = 'bottom', menuAlign = 'left' }) {
|
|
||||||
const [showMenu, setShowMenu] = useState(false);
|
|
||||||
const [locale, setLocale] = useLocale();
|
|
||||||
const ref = useRef();
|
|
||||||
const selectedLocale = menuOptions.find(e => e.value === locale)?.display;
|
|
||||||
|
|
||||||
function handleSelect(value) {
|
|
||||||
setLocale(value);
|
|
||||||
window.localStorage.setItem('locale', value);
|
|
||||||
setShowMenu(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleMenu() {
|
|
||||||
setShowMenu(state => !state);
|
|
||||||
}
|
|
||||||
|
|
||||||
useDocumentClick(e => {
|
|
||||||
if (!ref.current.contains(e.target)) {
|
|
||||||
setShowMenu(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<Head>
|
|
||||||
{locale === 'zh-CN' && (
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
{locale === 'ja-JP' && (
|
|
||||||
<link
|
|
||||||
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap"
|
|
||||||
rel="stylesheet"
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</Head>
|
|
||||||
<div ref={ref} className={styles.container}>
|
|
||||||
<Button icon={<Globe />} onClick={toggleMenu} size="small">
|
|
||||||
<div className={locale}>{selectedLocale}</div>
|
|
||||||
</Button>
|
|
||||||
{showMenu && (
|
|
||||||
<Menu
|
|
||||||
className={styles.menu}
|
|
||||||
options={menuOptions}
|
|
||||||
onSelect={handleSelect}
|
|
||||||
float={menuPosition}
|
|
||||||
align={menuAlign}
|
|
||||||
/>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
position: relative;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu {
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
@ -1,23 +1,23 @@
|
|||||||
.link,
|
a.link,
|
||||||
.link:active,
|
a.link:active,
|
||||||
.link:visited {
|
a.link:visited {
|
||||||
position: relative;
|
position: relative;
|
||||||
color: #2c2c2c;
|
color: var(--gray900);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link:before {
|
a.link:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -2px;
|
bottom: -2px;
|
||||||
width: 0;
|
width: 0;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
background: #2680eb;
|
background: var(--primary400);
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
transition: width 100ms;
|
transition: width 100ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
.link:hover:before {
|
a.link:hover:before {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
transition: width 100ms;
|
transition: width 100ms;
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,8 @@ export default function Menu({
|
|||||||
<div
|
<div
|
||||||
key={value}
|
key={value}
|
||||||
className={classNames(styles.option, optionClassName, customClassName, {
|
className={classNames(styles.option, optionClassName, customClassName, {
|
||||||
[selectedClassName]: selectedOption === value,
|
[selectedClassName]: selectedOption === option,
|
||||||
|
[styles.selected]: selectedOption === option,
|
||||||
[styles.divider]: divider,
|
[styles.divider]: divider,
|
||||||
})}
|
})}
|
||||||
onClick={e => onSelect(value, e)}
|
onClick={e => onSelect(value, e)}
|
||||||
|
@ -8,14 +8,14 @@
|
|||||||
.option {
|
.option {
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
background: #fff;
|
background: var(--gray50);
|
||||||
padding: 4px 16px;
|
padding: 4px 16px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.option:hover {
|
.option:hover {
|
||||||
background: #f5f5f5;
|
background: var(--gray100);
|
||||||
}
|
}
|
||||||
|
|
||||||
.float {
|
.float {
|
||||||
@ -44,3 +44,7 @@
|
|||||||
.divider {
|
.divider {
|
||||||
border-top: 1px solid var(--gray300);
|
border-top: 1px solid var(--gray300);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.selected {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
58
components/common/MenuButton.js
Normal file
58
components/common/MenuButton.js
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import React, { useState, useRef } from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import Menu from 'components/common/Menu';
|
||||||
|
import Button from 'components/common/Button';
|
||||||
|
import useDocumentClick from 'hooks/useDocumentClick';
|
||||||
|
import styles from './MenuButton.module.css';
|
||||||
|
|
||||||
|
export default function MenuButton({
|
||||||
|
icon,
|
||||||
|
value,
|
||||||
|
options,
|
||||||
|
menuPosition = 'bottom',
|
||||||
|
menuAlign = 'right',
|
||||||
|
onSelect,
|
||||||
|
renderValue,
|
||||||
|
}) {
|
||||||
|
const [showMenu, setShowMenu] = useState(false);
|
||||||
|
const ref = useRef();
|
||||||
|
const selectedOption = options.find(e => e.value === value);
|
||||||
|
|
||||||
|
function handleSelect(value) {
|
||||||
|
onSelect(value);
|
||||||
|
setShowMenu(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleMenu() {
|
||||||
|
setShowMenu(state => !state);
|
||||||
|
}
|
||||||
|
|
||||||
|
useDocumentClick(e => {
|
||||||
|
if (!ref.current.contains(e.target)) {
|
||||||
|
setShowMenu(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={styles.container} ref={ref}>
|
||||||
|
<Button
|
||||||
|
icon={icon}
|
||||||
|
className={classNames(styles.button, { [styles.open]: showMenu })}
|
||||||
|
onClick={toggleMenu}
|
||||||
|
variant="light"
|
||||||
|
>
|
||||||
|
<div className={styles.text}>{renderValue ? renderValue(selectedOption) : value}</div>
|
||||||
|
</Button>
|
||||||
|
{showMenu && (
|
||||||
|
<Menu
|
||||||
|
className={styles.menu}
|
||||||
|
options={options}
|
||||||
|
selectedOption={selectedOption}
|
||||||
|
onSelect={handleSelect}
|
||||||
|
float={menuPosition}
|
||||||
|
align={menuAlign}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
24
components/common/MenuButton.module.css
Normal file
24
components/common/MenuButton.module.css
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
.container {
|
||||||
|
display: flex;
|
||||||
|
position: relative;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
border: 1px solid transparent;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu {
|
||||||
|
z-index: 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: var(--font-size-small);
|
||||||
|
}
|
||||||
|
|
||||||
|
.open,
|
||||||
|
.open:hover {
|
||||||
|
background: var(--gray50);
|
||||||
|
border: 1px solid var(--gray500);
|
||||||
|
}
|
@ -16,8 +16,8 @@
|
|||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
background: var(--gray900);
|
background: #000;
|
||||||
opacity: 0.1;
|
opacity: 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content {
|
.content {
|
||||||
|
32
components/common/NavMenu.js
Normal file
32
components/common/NavMenu.js
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
|
import classNames from 'classnames';
|
||||||
|
import styles from './NavMenu.module.css';
|
||||||
|
|
||||||
|
export default function NavMenu({ options = [], className, onSelect = () => {} }) {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classNames(styles.menu, className)}>
|
||||||
|
{options
|
||||||
|
.filter(({ hidden }) => !hidden)
|
||||||
|
.map(option => {
|
||||||
|
const { label, value, className: customClassName, render } = option;
|
||||||
|
|
||||||
|
return render ? (
|
||||||
|
render(option)
|
||||||
|
) : (
|
||||||
|
<div
|
||||||
|
key={value}
|
||||||
|
className={classNames(styles.option, customClassName, {
|
||||||
|
[styles.selected]: router.asPath === value,
|
||||||
|
})}
|
||||||
|
onClick={e => onSelect(value, e)}
|
||||||
|
>
|
||||||
|
{label}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
22
components/common/NavMenu.module.css
Normal file
22
components/common/NavMenu.module.css
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
.menu {
|
||||||
|
color: var(--gray800);
|
||||||
|
border: 1px solid var(--gray500);
|
||||||
|
border-radius: 4px;
|
||||||
|
overflow: hidden;
|
||||||
|
z-index: 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option {
|
||||||
|
padding: 8px 16px;
|
||||||
|
cursor: pointer;
|
||||||
|
border-radius: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.option:hover {
|
||||||
|
background: var(--gray75);
|
||||||
|
}
|
||||||
|
|
||||||
|
.selected {
|
||||||
|
color: var(--gray900);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
@ -1,15 +1,16 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { setDateRange } from 'redux/actions/websites';
|
import { setDateRange } from 'redux/actions/websites';
|
||||||
import Button from './Button';
|
import Button from './Button';
|
||||||
import Refresh from 'assets/redo.svg';
|
import Refresh from 'assets/redo.svg';
|
||||||
import Dots from 'assets/ellipsis-h.svg';
|
import Dots from 'assets/ellipsis-h.svg';
|
||||||
import { useDateRange } from 'hooks/useDateRange';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
import { getDateRange } from '../../lib/date';
|
import { getDateRange } from '../../lib/date';
|
||||||
|
|
||||||
export default function RefreshButton({ websiteId }) {
|
export default function RefreshButton({ websiteId }) {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const dateRange = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const completed = useSelector(state => state.queries[`/api/website/${websiteId}/metrics`]);
|
const completed = useSelector(state => state.queries[`/api/website/${websiteId}/metrics`]);
|
||||||
|
|
||||||
@ -24,5 +25,13 @@ export default function RefreshButton({ websiteId }) {
|
|||||||
setLoading(false);
|
setLoading(false);
|
||||||
}, [completed]);
|
}, [completed]);
|
||||||
|
|
||||||
return <Button icon={loading ? <Dots /> : <Refresh />} size="small" onClick={handleClick} />;
|
return (
|
||||||
|
<Button
|
||||||
|
icon={loading ? <Dots /> : <Refresh />}
|
||||||
|
tooltip={<FormattedMessage id="button.refresh" defaultMessage="Refresh" />}
|
||||||
|
tooltipId="button-refresh"
|
||||||
|
size="small"
|
||||||
|
onClick={handleClick}
|
||||||
|
/>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
color: var(--gray50);
|
color: var(--msgColor);
|
||||||
background: var(--green400);
|
background: var(--green400);
|
||||||
margin: auto;
|
margin: auto;
|
||||||
z-index: 2;
|
z-index: 2;
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
.container {
|
|
||||||
display: flex;
|
|
||||||
position: relative;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
display: flex;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.username {
|
|
||||||
border-bottom: 1px solid var(--gray500);
|
|
||||||
}
|
|
||||||
|
|
||||||
.username:hover {
|
|
||||||
background: var(--gray50);
|
|
||||||
}
|
|
||||||
|
|
||||||
.menu {
|
|
||||||
z-index: 100;
|
|
||||||
}
|
|
@ -1,44 +1,57 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState, useMemo } from 'react';
|
||||||
import ReactTooltip from 'react-tooltip';
|
import ReactTooltip from 'react-tooltip';
|
||||||
|
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
import { ComposableMap, Geographies, Geography, ZoomableGroup } from 'react-simple-maps';
|
import useTheme from 'hooks/useTheme';
|
||||||
|
import { THEME_COLORS } from 'lib/constants';
|
||||||
import styles from './WorldMap.module.css';
|
import styles from './WorldMap.module.css';
|
||||||
|
|
||||||
const geoUrl = '/world-110m.json';
|
const geoUrl = '/world-110m.json';
|
||||||
|
|
||||||
export default function WorldMap({
|
export default function WorldMap({ data, className }) {
|
||||||
data,
|
|
||||||
className,
|
|
||||||
baseColor = '#e9f3fd',
|
|
||||||
fillColor = '#f5f5f5',
|
|
||||||
strokeColor = '#2680eb',
|
|
||||||
hoverColor = '#2680eb',
|
|
||||||
}) {
|
|
||||||
const [tooltip, setTooltip] = useState();
|
const [tooltip, setTooltip] = useState();
|
||||||
|
const [theme] = useTheme();
|
||||||
|
const colors = useMemo(
|
||||||
|
() => ({
|
||||||
|
baseColor: THEME_COLORS[theme].primary,
|
||||||
|
fillColor: THEME_COLORS[theme].gray100,
|
||||||
|
strokeColor: THEME_COLORS[theme].primary,
|
||||||
|
hoverColor: THEME_COLORS[theme].primary,
|
||||||
|
}),
|
||||||
|
[theme],
|
||||||
|
);
|
||||||
|
|
||||||
function getFillColor(code) {
|
function getFillColor(code) {
|
||||||
if (code === 'AQ') return '#ffffff';
|
if (code === 'AQ') return;
|
||||||
const country = data?.find(({ x }) => x === code);
|
const country = data?.find(({ x }) => x === code);
|
||||||
return country ? tinycolor(baseColor).darken(country.z) : fillColor;
|
|
||||||
|
if (!country) {
|
||||||
|
return colors.fillColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStrokeColor(code) {
|
return tinycolor(colors.baseColor)[theme === 'light' ? 'lighten' : 'darken'](
|
||||||
return code === 'AQ' ? '#ffffff' : strokeColor;
|
40 * (1.0 - country.z / 100),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHoverColor(code) {
|
function getOpacity(code) {
|
||||||
return code === 'AQ' ? '#ffffff' : hoverColor;
|
return code === 'AQ' ? 0 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleHover({ ISO_A2: code, NAME: name }) {
|
function handleHover({ ISO_A2: code, NAME: name }) {
|
||||||
|
if (code === 'AQ') return;
|
||||||
const country = data?.find(({ x }) => x === code);
|
const country = data?.find(({ x }) => x === code);
|
||||||
setTooltip(`${name}: ${country?.y || 0} visitors`);
|
setTooltip(`${name}: ${country?.y || 0} visitors`);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.container, className)}>
|
<div
|
||||||
<ComposableMap data-tip="" projection="geoMercator">
|
className={classNames(styles.container, className)}
|
||||||
|
data-tip=""
|
||||||
|
data-for="world-map-tooltip"
|
||||||
|
>
|
||||||
|
<ComposableMap projection="geoMercator">
|
||||||
<ZoomableGroup zoom={0.8} minZoom={0.7} center={[0, 40]}>
|
<ZoomableGroup zoom={0.8} minZoom={0.7} center={[0, 40]}>
|
||||||
<Geographies geography={geoUrl}>
|
<Geographies geography={geoUrl}>
|
||||||
{({ geographies }) => {
|
{({ geographies }) => {
|
||||||
@ -50,10 +63,11 @@ export default function WorldMap({
|
|||||||
key={geo.rsmKey}
|
key={geo.rsmKey}
|
||||||
geography={geo}
|
geography={geo}
|
||||||
fill={getFillColor(code)}
|
fill={getFillColor(code)}
|
||||||
stroke={getStrokeColor(code)}
|
stroke={colors.strokeColor}
|
||||||
|
opacity={getOpacity(code)}
|
||||||
style={{
|
style={{
|
||||||
default: { outline: 'none' },
|
default: { outline: 'none' },
|
||||||
hover: { outline: 'none', fill: getHoverColor(code) },
|
hover: { outline: 'none', fill: colors.hoverColor },
|
||||||
pressed: { outline: 'none' },
|
pressed: { outline: 'none' },
|
||||||
}}
|
}}
|
||||||
onMouseOver={() => handleHover(geo.properties)}
|
onMouseOver={() => handleHover(geo.properties)}
|
||||||
@ -65,7 +79,7 @@ export default function WorldMap({
|
|||||||
</Geographies>
|
</Geographies>
|
||||||
</ZoomableGroup>
|
</ZoomableGroup>
|
||||||
</ComposableMap>
|
</ComposableMap>
|
||||||
<ReactTooltip>{tooltip}</ReactTooltip>
|
<ReactTooltip id="world-map-tooltip">{tooltip}</ReactTooltip>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
.container {
|
.container {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
background: #fff;
|
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,15 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { isAfter } from 'date-fns';
|
import { isAfter, isBefore, isSameDay } from 'date-fns';
|
||||||
import Calendar from 'components/common/Calendar';
|
import Calendar from 'components/common/Calendar';
|
||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import { FormButtons } from 'components/layout/FormLayout';
|
import { FormButtons } from 'components/layout/FormLayout';
|
||||||
import { getDateRangeValues } from 'lib/date';
|
import { getDateRangeValues } from 'lib/date';
|
||||||
import styles from './DatePickerForm.module.css';
|
import styles from './DatePickerForm.module.css';
|
||||||
|
import ButtonGroup from 'components/common/ButtonGroup';
|
||||||
|
|
||||||
|
const FILTER_DAY = 0;
|
||||||
|
const FILTER_RANGE = 1;
|
||||||
|
|
||||||
export default function DatePickerForm({
|
export default function DatePickerForm({
|
||||||
startDate: defaultStartDate,
|
startDate: defaultStartDate,
|
||||||
@ -15,21 +19,59 @@ export default function DatePickerForm({
|
|||||||
onChange,
|
onChange,
|
||||||
onClose,
|
onClose,
|
||||||
}) {
|
}) {
|
||||||
|
const [selected, setSelected] = useState(
|
||||||
|
isSameDay(defaultStartDate, defaultEndDate) ? FILTER_DAY : FILTER_RANGE,
|
||||||
|
);
|
||||||
|
const [date, setDate] = useState(defaultStartDate);
|
||||||
const [startDate, setStartDate] = useState(defaultStartDate);
|
const [startDate, setStartDate] = useState(defaultStartDate);
|
||||||
const [endDate, setEndDate] = useState(defaultEndDate);
|
const [endDate, setEndDate] = useState(defaultEndDate);
|
||||||
|
|
||||||
|
const disabled =
|
||||||
|
selected === FILTER_DAY
|
||||||
|
? isAfter(minDate, date) && isBefore(maxDate, date)
|
||||||
|
: isAfter(startDate, endDate);
|
||||||
|
|
||||||
|
const buttons = [
|
||||||
|
{
|
||||||
|
label: <FormattedMessage id="button.single-day" defaultMessage="Single day" />,
|
||||||
|
value: FILTER_DAY,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: <FormattedMessage id="button.date-range" defaultMessage="Date range" />,
|
||||||
|
value: FILTER_RANGE,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
function handleSave() {
|
function handleSave() {
|
||||||
|
if (selected === FILTER_DAY) {
|
||||||
|
onChange({ ...getDateRangeValues(date, date), value: 'custom' });
|
||||||
|
} else {
|
||||||
onChange({ ...getDateRangeValues(startDate, endDate), value: 'custom' });
|
onChange({ ...getDateRangeValues(startDate, endDate), value: 'custom' });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.container}>
|
<div className={styles.container}>
|
||||||
|
<div className={styles.filter}>
|
||||||
|
<ButtonGroup size="small" items={buttons} selectedItem={selected} onClick={setSelected} />
|
||||||
|
</div>
|
||||||
<div className={styles.calendars}>
|
<div className={styles.calendars}>
|
||||||
<Calendar date={startDate} minDate={minDate} maxDate={endDate} onChange={setStartDate} />
|
{selected === FILTER_DAY ? (
|
||||||
|
<Calendar date={date} minDate={minDate} maxDate={maxDate} onChange={setDate} />
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<Calendar
|
||||||
|
date={startDate}
|
||||||
|
minDate={minDate}
|
||||||
|
maxDate={endDate}
|
||||||
|
onChange={setStartDate}
|
||||||
|
/>
|
||||||
<Calendar date={endDate} minDate={startDate} maxDate={maxDate} onChange={setEndDate} />
|
<Calendar date={endDate} minDate={startDate} maxDate={maxDate} onChange={setEndDate} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
<FormButtons>
|
<FormButtons>
|
||||||
<Button variant="action" onClick={handleSave} disabled={isAfter(startDate, endDate)}>
|
<Button variant="action" onClick={handleSave} disabled={disabled}>
|
||||||
<FormattedMessage id="button.save" defaultMessage="Save" />
|
<FormattedMessage id="button.save" defaultMessage="Save" />
|
||||||
</Button>
|
</Button>
|
||||||
<Button onClick={onClose}>
|
<Button onClick={onClose}>
|
||||||
|
@ -1,25 +1,40 @@
|
|||||||
.container {
|
.container {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
width: 800px;
|
|
||||||
max-width: 100vw;
|
max-width: 100vw;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendars {
|
.calendars {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendars > div:first-child {
|
.calendars > div {
|
||||||
padding-right: 20px;
|
width: 380px;
|
||||||
border-right: 1px solid var(--gray300);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendars > div:last-child {
|
.calendars > div + div {
|
||||||
|
margin-left: 20px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
|
border-left: 1px solid var(--gray300);
|
||||||
|
}
|
||||||
|
|
||||||
|
.filter {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 768px) {
|
@media only screen and (max-width: 768px) {
|
||||||
.calendars {
|
.calendars {
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendars > div + div {
|
||||||
|
padding: 0;
|
||||||
|
margin-left: 0;
|
||||||
|
margin-top: 20px;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@ import React, { useRef } from 'react';
|
|||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
import FormLayout, { FormButtons, FormRow } from 'components/layout/FormLayout';
|
||||||
import CopyButton from '../common/CopyButton';
|
import CopyButton from 'components/common/CopyButton';
|
||||||
|
|
||||||
export default function TrackingCodeForm({ values, onClose }) {
|
export default function TrackingCodeForm({ values, onClose }) {
|
||||||
const ref = useRef();
|
const ref = useRef();
|
||||||
|
@ -2,6 +2,16 @@ import React from 'react';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import styles from './ButtonLayout.module.css';
|
import styles from './ButtonLayout.module.css';
|
||||||
|
|
||||||
export default function ButtonLayout({ className, children }) {
|
export default function ButtonLayout({ className, children, align = 'center' }) {
|
||||||
return <div className={classNames(styles.buttons, className)}>{children}</div>;
|
return (
|
||||||
|
<div
|
||||||
|
className={classNames(styles.buttons, className, {
|
||||||
|
[styles.left]: align === 'left',
|
||||||
|
[styles.center]: align === 'center',
|
||||||
|
[styles.right]: align === 'right',
|
||||||
|
})}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
.buttons {
|
.buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.buttons button + button {
|
.buttons button + * {
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.center {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.left {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
|
||||||
|
.right {
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
@ -1,21 +1,27 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import classNames from 'classnames';
|
import Link from 'components/common/Link';
|
||||||
import Button from 'components/common/Button';
|
|
||||||
import Logo from 'assets/logo.svg';
|
|
||||||
import styles from './Footer.module.css';
|
import styles from './Footer.module.css';
|
||||||
|
|
||||||
export default function Footer() {
|
export default function Footer() {
|
||||||
const version = process.env.VERSION;
|
const version = process.env.VERSION;
|
||||||
return (
|
return (
|
||||||
<footer className="container">
|
<footer className="container">
|
||||||
<div className={classNames(styles.footer, 'row justify-content-center')}>
|
<div className={styles.footer}>
|
||||||
<FormattedMessage id="footer.powered-by" defaultMessage="Powered by" />
|
<div />
|
||||||
<a href="https://umami.is">
|
<div>
|
||||||
<Button className={styles.button} icon={<Logo />} size="small">
|
<FormattedMessage
|
||||||
|
id="message.powered-by"
|
||||||
|
defaultMessage="Powered by {name}"
|
||||||
|
values={{
|
||||||
|
name: (
|
||||||
|
<Link href="https://umami.is">
|
||||||
<b>umami</b>
|
<b>umami</b>
|
||||||
</Button>
|
</Link>
|
||||||
</a>
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<div>{`v${version}`}</div>
|
<div>{`v${version}`}</div>
|
||||||
</div>
|
</div>
|
||||||
</footer>
|
</footer>
|
||||||
|
@ -5,11 +5,3 @@
|
|||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
min-height: 100px;
|
min-height: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.footer a {
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
margin: 0 5px;
|
|
||||||
}
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.msg {
|
.msg {
|
||||||
color: var(--gray50);
|
color: var(--msgColor);
|
||||||
background: var(--red400);
|
background: var(--red400);
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
padding: 4px 8px;
|
padding: 4px 8px;
|
||||||
|
@ -3,11 +3,12 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Link from 'components/common/Link';
|
import Link from 'components/common/Link';
|
||||||
import UserButton from '../common/UserButton';
|
import Icon from 'components/common/Icon';
|
||||||
import Icon from '../common/Icon';
|
import LanguageButton from 'components/settings/LanguageButton';
|
||||||
|
import ThemeButton from 'components/settings/ThemeButton';
|
||||||
|
import UserButton from 'components/settings/UserButton';
|
||||||
import Logo from 'assets/logo.svg';
|
import Logo from 'assets/logo.svg';
|
||||||
import styles from './Header.module.css';
|
import styles from './Header.module.css';
|
||||||
import LanguageButton from '../common/LanguageButton';
|
|
||||||
|
|
||||||
export default function Header() {
|
export default function Header() {
|
||||||
const user = useSelector(state => state.user);
|
const user = useSelector(state => state.user);
|
||||||
@ -15,29 +16,30 @@ export default function Header() {
|
|||||||
return (
|
return (
|
||||||
<header className="container">
|
<header className="container">
|
||||||
<div className={classNames(styles.header, 'row align-items-center')}>
|
<div className={classNames(styles.header, 'row align-items-center')}>
|
||||||
<div className="col-12 col-md-3">
|
<div className="col-12 col-md-12 col-lg-3">
|
||||||
<div className={styles.title}>
|
<div className={styles.title}>
|
||||||
<Icon icon={<Logo />} size="large" className={styles.logo} />
|
<Icon icon={<Logo />} size="large" className={styles.logo} />
|
||||||
<Link href={user ? '/' : 'https://umami.is'}>umami</Link>
|
<Link href={user ? '/' : 'https://umami.is'}>umami</Link>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-12 col-md-9">
|
<div className="col-12 col-md-12 col-lg-6">
|
||||||
|
{user && (
|
||||||
<div className={styles.nav}>
|
<div className={styles.nav}>
|
||||||
{user ? (
|
|
||||||
<>
|
|
||||||
<Link href="/dashboard">
|
<Link href="/dashboard">
|
||||||
<FormattedMessage id="header.nav.dashboard" defaultMessage="Dashboard" />
|
<FormattedMessage id="label.dashboard" defaultMessage="Dashboard" />
|
||||||
</Link>
|
</Link>
|
||||||
<Link href="/settings">
|
<Link href="/settings">
|
||||||
<FormattedMessage id="header.nav.settings" defaultMessage="Settings" />
|
<FormattedMessage id="label.settings" defaultMessage="Settings" />
|
||||||
</Link>
|
</Link>
|
||||||
<LanguageButton menuAlign="right" />
|
</div>
|
||||||
<UserButton />
|
|
||||||
</>
|
|
||||||
) : (
|
|
||||||
<LanguageButton menuAlign="right" />
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
<div className="col-12 col-md-12 col-lg-3">
|
||||||
|
<div className={styles.buttons}>
|
||||||
|
<ThemeButton />
|
||||||
|
<LanguageButton menuAlign="right" />
|
||||||
|
{user && <UserButton />}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
|
@ -13,18 +13,33 @@
|
|||||||
|
|
||||||
.nav {
|
.nav {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: var(--font-size-normal);
|
font-size: var(--font-size-normal);
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav > * {
|
.nav a + a {
|
||||||
margin-left: 40px;
|
margin-left: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 768px) {
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
justify-content: flex-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media only screen and (max-width: 992px) {
|
||||||
.title {
|
.title {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.nav {
|
||||||
|
font-size: var(--font-size-large);
|
||||||
|
justify-content: center;
|
||||||
|
padding: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,8 +16,8 @@ export default function Layout({ title, children, header = true, footer = true }
|
|||||||
</Head>
|
</Head>
|
||||||
{header && <Header />}
|
{header && <Header />}
|
||||||
<main className="container">{children}</main>
|
<main className="container">{children}</main>
|
||||||
<div id="__modals" />
|
|
||||||
{footer && <Footer />}
|
{footer && <Footer />}
|
||||||
|
<div id="__modals" />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
6
components/layout/Layout.module.css
Normal file
6
components/layout/Layout.module.css
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
.layout {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
@ -1,29 +1,37 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Menu from 'components/common/Menu';
|
import NavMenu from 'components/common/NavMenu';
|
||||||
import styles from './MenuLayout.module.css';
|
import styles from './MenuLayout.module.css';
|
||||||
|
|
||||||
export default function MenuLayout({
|
export default function MenuLayout({
|
||||||
menu,
|
menu,
|
||||||
selectedOption,
|
selectedOption,
|
||||||
onMenuSelect,
|
|
||||||
className,
|
className,
|
||||||
menuClassName,
|
menuClassName,
|
||||||
contentClassName,
|
contentClassName,
|
||||||
optionClassName,
|
|
||||||
children,
|
children,
|
||||||
|
replace = false,
|
||||||
}) {
|
}) {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
function handleSelect(url) {
|
||||||
|
if (replace) {
|
||||||
|
router.replace(url);
|
||||||
|
} else {
|
||||||
|
router.push(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classNames(styles.container, className, 'row')}>
|
<div className={classNames(styles.container, className, 'row')}>
|
||||||
<Menu
|
<NavMenu
|
||||||
options={menu}
|
options={menu}
|
||||||
selectedOption={selectedOption}
|
selectedOption={selectedOption}
|
||||||
className={classNames(styles.menu, menuClassName, 'col-12 col-lg-3')}
|
className={classNames(styles.menu, menuClassName, 'col-12 col-lg-2')}
|
||||||
selectedClassName={styles.selected}
|
onSelect={handleSelect}
|
||||||
optionClassName={classNames(styles.option, optionClassName)}
|
|
||||||
onSelect={onMenuSelect}
|
|
||||||
/>
|
/>
|
||||||
<div className={classNames(styles.content, contentClassName, 'col-12 col-lg-9')}>
|
<div className={classNames(styles.content, contentClassName, 'col-12 col-lg-10')}>
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -10,25 +10,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.container .content {
|
.container .content {
|
||||||
|
flex: 1;
|
||||||
position: relative;
|
position: relative;
|
||||||
border-left: 1px solid var(--gray300);
|
border-left: 1px solid var(--gray300);
|
||||||
padding-left: 30px;
|
padding-left: 30px;
|
||||||
}
|
margin-left: 30px;
|
||||||
|
|
||||||
.option {
|
|
||||||
font-size: var(--font-size-normal);
|
|
||||||
padding: 8px 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
margin-right: 30px;
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.option:hover {
|
|
||||||
background: var(--gray75);
|
|
||||||
}
|
|
||||||
|
|
||||||
.selected {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 992px) {
|
@media only screen and (max-width: 992px) {
|
||||||
@ -40,5 +26,6 @@
|
|||||||
border-top: 1px solid var(--gray300);
|
border-top: 1px solid var(--gray300);
|
||||||
border-left: 0;
|
border-left: 0;
|
||||||
padding-left: 0;
|
padding-left: 0;
|
||||||
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
.page {
|
.page {
|
||||||
|
flex: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
padding: 0 30px;
|
padding: 0 30px;
|
||||||
background: var(--gray50);
|
background: var(--gray50);
|
||||||
height: 100%;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import classNames from 'classnames';
|
||||||
import styles from './PageHeader.module.css';
|
import styles from './PageHeader.module.css';
|
||||||
|
|
||||||
export default function PageHeader({ children }) {
|
export default function PageHeader({ children, className }) {
|
||||||
return <div className={styles.header}>{children}</div>;
|
return <div className={classNames(styles.header, className)}>{children}</div>;
|
||||||
}
|
}
|
||||||
|
17
components/messages.js
Normal file
17
components/messages.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { defineMessages, FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
|
export const labels = defineMessages({
|
||||||
|
unknown: { id: 'label.unknown', defaultMessage: 'Unknown' },
|
||||||
|
});
|
||||||
|
|
||||||
|
export const devices = defineMessages({
|
||||||
|
desktop: { id: 'metrics.device.desktop', defaultMessage: 'Desktop' },
|
||||||
|
laptop: { id: 'metrics.device.laptop', defaultMessage: 'Laptop' },
|
||||||
|
tablet: { id: 'metrics.device.tablet', defaultMessage: 'Tablet' },
|
||||||
|
mobile: { id: 'metrics.device.mobile', defaultMessage: 'Mobile' },
|
||||||
|
});
|
||||||
|
|
||||||
|
export function getDeviceMessage(device) {
|
||||||
|
return <FormattedMessage {...(devices[device] || labels.unknown)} />;
|
||||||
|
}
|
@ -4,8 +4,8 @@ import useFetch from 'hooks/useFetch';
|
|||||||
import styles from './ActiveUsers.module.css';
|
import styles from './ActiveUsers.module.css';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
export default function ActiveUsers({ websiteId, className }) {
|
export default function ActiveUsers({ websiteId, token, className }) {
|
||||||
const { data } = useFetch(`/api/website/${websiteId}/active`, {}, { interval: 60000 });
|
const { data } = useFetch(`/api/website/${websiteId}/active`, { token }, { interval: 60000 });
|
||||||
const count = useMemo(() => {
|
const count = useMemo(() => {
|
||||||
return data?.[0]?.x || 0;
|
return data?.[0]?.x || 0;
|
||||||
}, [data]);
|
}, [data]);
|
||||||
@ -20,7 +20,7 @@ export default function ActiveUsers({ websiteId, className }) {
|
|||||||
<div className={styles.text}>
|
<div className={styles.text}>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="active-users.message"
|
id="message.active-users"
|
||||||
defaultMessage="{x} current {x, plural, one {visitor} other {visitors}}"
|
defaultMessage="{x} current {x, plural, one {visitor} other {visitors}}"
|
||||||
values={{ x: count }}
|
values={{ x: count }}
|
||||||
/>
|
/>
|
||||||
|
@ -6,6 +6,8 @@ import { formatLongNumber } from 'lib/format';
|
|||||||
import { dateFormat } from 'lib/lang';
|
import { dateFormat } from 'lib/lang';
|
||||||
import useLocale from 'hooks/useLocale';
|
import useLocale from 'hooks/useLocale';
|
||||||
import styles from './BarChart.module.css';
|
import styles from './BarChart.module.css';
|
||||||
|
import useTheme from 'hooks/useTheme';
|
||||||
|
import { THEME_COLORS } from 'lib/constants';
|
||||||
|
|
||||||
export default function BarChart({
|
export default function BarChart({
|
||||||
chartId,
|
chartId,
|
||||||
@ -16,15 +18,23 @@ export default function BarChart({
|
|||||||
animationDuration = 300,
|
animationDuration = 300,
|
||||||
className,
|
className,
|
||||||
stacked = false,
|
stacked = false,
|
||||||
|
loading = false,
|
||||||
onCreate = () => {},
|
onCreate = () => {},
|
||||||
onUpdate = () => {},
|
onUpdate = () => {},
|
||||||
}) {
|
}) {
|
||||||
const canvas = useRef();
|
const canvas = useRef();
|
||||||
const chart = useRef();
|
const chart = useRef();
|
||||||
const [tooltip, setTooltip] = useState({});
|
const [tooltip, setTooltip] = useState(null);
|
||||||
const [locale] = useLocale();
|
const [locale] = useLocale();
|
||||||
|
const [theme] = useTheme();
|
||||||
|
const colors = {
|
||||||
|
text: THEME_COLORS[theme].gray700,
|
||||||
|
line: THEME_COLORS[theme].gray200,
|
||||||
|
zeroLine: THEME_COLORS[theme].gray500,
|
||||||
|
};
|
||||||
|
|
||||||
function renderXLabel(label, index, values) {
|
function renderXLabel(label, index, values) {
|
||||||
|
if (loading) return '';
|
||||||
const d = new Date(values[index].value);
|
const d = new Date(values[index].value);
|
||||||
const w = canvas.current.width;
|
const w = canvas.current.width;
|
||||||
|
|
||||||
@ -59,9 +69,11 @@ export default function BarChart({
|
|||||||
function renderTooltip(model) {
|
function renderTooltip(model) {
|
||||||
const { opacity, title, body, labelColors } = model;
|
const { opacity, title, body, labelColors } = model;
|
||||||
|
|
||||||
if (!opacity) {
|
if (!opacity || !title) {
|
||||||
setTooltip(null);
|
setTooltip(null);
|
||||||
} else {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const [label, value] = body[0].lines[0].split(':');
|
const [label, value] = body[0].lines[0].split(':');
|
||||||
|
|
||||||
setTooltip({
|
setTooltip({
|
||||||
@ -71,7 +83,6 @@ export default function BarChart({
|
|||||||
labelColor: labelColors[0].backgroundColor,
|
labelColor: labelColors[0].backgroundColor,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
function getTooltipFormat(unit) {
|
function getTooltipFormat(unit) {
|
||||||
switch (unit) {
|
switch (unit) {
|
||||||
@ -97,6 +108,11 @@ export default function BarChart({
|
|||||||
responsive: true,
|
responsive: true,
|
||||||
responsiveAnimationDuration: 0,
|
responsiveAnimationDuration: 0,
|
||||||
maintainAspectRatio: false,
|
maintainAspectRatio: false,
|
||||||
|
legend: {
|
||||||
|
labels: {
|
||||||
|
fontColor: colors.text,
|
||||||
|
},
|
||||||
|
},
|
||||||
scales: {
|
scales: {
|
||||||
xAxes: [
|
xAxes: [
|
||||||
{
|
{
|
||||||
@ -110,6 +126,7 @@ export default function BarChart({
|
|||||||
callback: renderXLabel,
|
callback: renderXLabel,
|
||||||
minRotation: 0,
|
minRotation: 0,
|
||||||
maxRotation: 0,
|
maxRotation: 0,
|
||||||
|
fontColor: colors.text,
|
||||||
},
|
},
|
||||||
gridLines: {
|
gridLines: {
|
||||||
display: false,
|
display: false,
|
||||||
@ -123,6 +140,11 @@ export default function BarChart({
|
|||||||
ticks: {
|
ticks: {
|
||||||
callback: renderYLabel,
|
callback: renderYLabel,
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
|
fontColor: colors.text,
|
||||||
|
},
|
||||||
|
gridLines: {
|
||||||
|
color: colors.line,
|
||||||
|
zeroLineColor: colors.zeroLine,
|
||||||
},
|
},
|
||||||
stacked,
|
stacked,
|
||||||
},
|
},
|
||||||
@ -144,8 +166,13 @@ export default function BarChart({
|
|||||||
function updateChart() {
|
function updateChart() {
|
||||||
const { options } = chart.current;
|
const { options } = chart.current;
|
||||||
|
|
||||||
|
options.legend.labels.fontColor = colors.text;
|
||||||
options.scales.xAxes[0].time.unit = unit;
|
options.scales.xAxes[0].time.unit = unit;
|
||||||
options.scales.xAxes[0].ticks.callback = renderXLabel;
|
options.scales.xAxes[0].ticks.callback = renderXLabel;
|
||||||
|
options.scales.xAxes[0].ticks.fontColor = colors.text;
|
||||||
|
options.scales.yAxes[0].ticks.fontColor = colors.text;
|
||||||
|
options.scales.yAxes[0].gridLines.color = colors.line;
|
||||||
|
options.scales.yAxes[0].gridLines.zeroLineColor = colors.zeroLine;
|
||||||
options.animation.duration = animationDuration;
|
options.animation.duration = animationDuration;
|
||||||
options.tooltips.custom = renderTooltip;
|
options.tooltips.custom = renderTooltip;
|
||||||
|
|
||||||
@ -161,7 +188,7 @@ export default function BarChart({
|
|||||||
updateChart();
|
updateChart();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [datasets, unit, animationDuration, locale]);
|
}, [datasets, unit, animationDuration, locale, theme]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tooltip {
|
.tooltip {
|
||||||
|
color: var(--msgColor);
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
@ -12,7 +13,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
color: var(--gray50);
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,13 +3,14 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
import { browserFilter } from 'lib/filters';
|
import { browserFilter } from 'lib/filters';
|
||||||
|
|
||||||
export default function BrowsersTable({ websiteId, limit, onExpand }) {
|
export default function BrowsersTable({ websiteId, token, limit, onExpand }) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.browsers" defaultMessage="Browsers" />}
|
title={<FormattedMessage id="metrics.browsers" defaultMessage="Browsers" />}
|
||||||
type="browser"
|
type="browser"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={browserFilter}
|
dataFilter={browserFilter}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
|
@ -3,13 +3,20 @@ import MetricsTable from './MetricsTable';
|
|||||||
import { countryFilter, percentFilter } from 'lib/filters';
|
import { countryFilter, percentFilter } from 'lib/filters';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
export default function CountriesTable({ websiteId, limit, onDataLoad = () => {}, onExpand }) {
|
export default function CountriesTable({
|
||||||
|
websiteId,
|
||||||
|
token,
|
||||||
|
limit,
|
||||||
|
onDataLoad = () => {},
|
||||||
|
onExpand,
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.countries" defaultMessage="Countries" />}
|
title={<FormattedMessage id="metrics.countries" defaultMessage="Countries" />}
|
||||||
type="country"
|
type="country"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={countryFilter}
|
dataFilter={countryFilter}
|
||||||
onDataLoad={data => onDataLoad(percentFilter(data))}
|
onDataLoad={data => onDataLoad(percentFilter(data))}
|
||||||
|
@ -2,16 +2,19 @@ import React from 'react';
|
|||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
import { deviceFilter } from 'lib/filters';
|
import { deviceFilter } from 'lib/filters';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { getDeviceMessage } from 'components/messages';
|
||||||
|
|
||||||
export default function DevicesTable({ websiteId, limit, onExpand }) {
|
export default function DevicesTable({ websiteId, token, limit, onExpand }) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.devices" defaultMessage="Devices" />}
|
title={<FormattedMessage id="metrics.devices" defaultMessage="Devices" />}
|
||||||
type="device"
|
type="device"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={deviceFilter}
|
dataFilter={deviceFilter}
|
||||||
|
renderLabel={({ x }) => getDeviceMessage(x)}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
@ -1,31 +1,25 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
import BarChart from './BarChart';
|
import BarChart from './BarChart';
|
||||||
import { getTimezone, getDateArray, getDateLength } from 'lib/date';
|
import { getDateArray, getDateLength } from 'lib/date';
|
||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
import { useDateRange } from 'hooks/useDateRange';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
|
import useTimezone from 'hooks/useTimezone';
|
||||||
|
import { EVENT_COLORS } from 'lib/constants';
|
||||||
|
|
||||||
const COLORS = [
|
export default function EventsChart({ websiteId, token }) {
|
||||||
'#2680eb',
|
const [dateRange] = useDateRange(websiteId);
|
||||||
'#9256d9',
|
|
||||||
'#44b556',
|
|
||||||
'#e68619',
|
|
||||||
'#e34850',
|
|
||||||
'#1b959a',
|
|
||||||
'#d83790',
|
|
||||||
'#85d044',
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function EventsChart({ websiteId }) {
|
|
||||||
const dateRange = useDateRange(websiteId);
|
|
||||||
const { startDate, endDate, unit, modified } = dateRange;
|
const { startDate, endDate, unit, modified } = dateRange;
|
||||||
|
const [timezone] = useTimezone();
|
||||||
|
|
||||||
const { data } = useFetch(
|
const { data } = useFetch(
|
||||||
`/api/website/${websiteId}/events`,
|
`/api/website/${websiteId}/events`,
|
||||||
{
|
{
|
||||||
start_at: +startDate,
|
start_at: +startDate,
|
||||||
end_at: +endDate,
|
end_at: +endDate,
|
||||||
unit,
|
unit,
|
||||||
tz: getTimezone(),
|
tz: timezone,
|
||||||
|
token,
|
||||||
},
|
},
|
||||||
{ update: [modified] },
|
{ update: [modified] },
|
||||||
);
|
);
|
||||||
@ -47,13 +41,13 @@ export default function EventsChart({ websiteId }) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return Object.keys(map).map((key, index) => {
|
return Object.keys(map).map((key, index) => {
|
||||||
const color = tinycolor(COLORS[index]);
|
const color = tinycolor(EVENT_COLORS[index]);
|
||||||
return {
|
return {
|
||||||
label: key,
|
label: key,
|
||||||
data: map[key],
|
data: map[key],
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
backgroundColor: color.setAlpha(0.4).toRgbString(),
|
backgroundColor: color.setAlpha(0.6).toRgbString(),
|
||||||
borderColor: color.setAlpha(0.5).toRgbString(),
|
borderColor: color.setAlpha(0.7).toRgbString(),
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -3,13 +3,14 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
import styles from './EventsTable.module.css';
|
import styles from './EventsTable.module.css';
|
||||||
|
|
||||||
export default function EventsTable({ websiteId, limit, onExpand, onDataLoad }) {
|
export default function EventsTable({ websiteId, token, limit, onExpand, onDataLoad }) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.events" defaultMessage="Events" />}
|
title={<FormattedMessage id="metrics.events" defaultMessage="Events" />}
|
||||||
type="event"
|
type="event"
|
||||||
metric={<FormattedMessage id="metrics.actions" defaultMessage="Actions" />}
|
metric={<FormattedMessage id="metrics.actions" defaultMessage="Actions" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
renderLabel={({ x }) => <Label value={x} />}
|
renderLabel={({ x }) => <Label value={x} />}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
min-width: 140px;
|
min-width: 140px;
|
||||||
padding-right: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.value {
|
.value {
|
||||||
|
@ -3,19 +3,20 @@ import { FormattedMessage } from 'react-intl';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import Loading from 'components/common/Loading';
|
import Loading from 'components/common/Loading';
|
||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
import { useDateRange } from 'hooks/useDateRange';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
import { formatShortTime, formatNumber, formatLongNumber } from 'lib/format';
|
import { formatShortTime, formatNumber, formatLongNumber } from 'lib/format';
|
||||||
import MetricCard from './MetricCard';
|
import MetricCard from './MetricCard';
|
||||||
import styles from './MetricsBar.module.css';
|
import styles from './MetricsBar.module.css';
|
||||||
|
|
||||||
export default function MetricsBar({ websiteId, className }) {
|
export default function MetricsBar({ websiteId, token, className }) {
|
||||||
const dateRange = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
const { startDate, endDate, modified } = dateRange;
|
const { startDate, endDate, modified } = dateRange;
|
||||||
const { data } = useFetch(
|
const { data } = useFetch(
|
||||||
`/api/website/${websiteId}/metrics`,
|
`/api/website/${websiteId}/metrics`,
|
||||||
{
|
{
|
||||||
start_at: +startDate,
|
start_at: +startDate,
|
||||||
end_at: +endDate,
|
end_at: +endDate,
|
||||||
|
token,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
update: [modified],
|
update: [modified],
|
||||||
|
@ -3,11 +3,15 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bar > div + div {
|
||||||
|
padding-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 992px) {
|
@media only screen and (max-width: 992px) {
|
||||||
.bar {
|
.bar {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
.bar > div:last-child {
|
.bar > div:nth-child(n + 3) {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,13 @@ import useFetch from 'hooks/useFetch';
|
|||||||
import Arrow from 'assets/arrow-right.svg';
|
import Arrow from 'assets/arrow-right.svg';
|
||||||
import { percentFilter } from 'lib/filters';
|
import { percentFilter } from 'lib/filters';
|
||||||
import { formatNumber, formatLongNumber } from 'lib/format';
|
import { formatNumber, formatLongNumber } from 'lib/format';
|
||||||
import { useDateRange } from 'hooks/useDateRange';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
import styles from './MetricsTable.module.css';
|
import styles from './MetricsTable.module.css';
|
||||||
|
|
||||||
export default function MetricsTable({
|
export default function MetricsTable({
|
||||||
websiteId,
|
websiteId,
|
||||||
websiteDomain,
|
websiteDomain,
|
||||||
|
token,
|
||||||
title,
|
title,
|
||||||
metric,
|
metric,
|
||||||
type,
|
type,
|
||||||
@ -23,12 +24,11 @@ export default function MetricsTable({
|
|||||||
dataFilter,
|
dataFilter,
|
||||||
filterOptions,
|
filterOptions,
|
||||||
limit,
|
limit,
|
||||||
headerComponent,
|
|
||||||
renderLabel,
|
renderLabel,
|
||||||
onDataLoad = () => {},
|
onDataLoad = () => {},
|
||||||
onExpand = () => {},
|
onExpand = () => {},
|
||||||
}) {
|
}) {
|
||||||
const dateRange = useDateRange(websiteId);
|
const [dateRange] = useDateRange(websiteId);
|
||||||
const { startDate, endDate, modified } = dateRange;
|
const { startDate, endDate, modified } = dateRange;
|
||||||
const { data } = useFetch(
|
const { data } = useFetch(
|
||||||
`/api/website/${websiteId}/rankings`,
|
`/api/website/${websiteId}/rankings`,
|
||||||
@ -37,6 +37,7 @@ export default function MetricsTable({
|
|||||||
start_at: +startDate,
|
start_at: +startDate,
|
||||||
end_at: +endDate,
|
end_at: +endDate,
|
||||||
domain: websiteDomain,
|
domain: websiteDomain,
|
||||||
|
token,
|
||||||
},
|
},
|
||||||
{ onDataLoad, delay: 300, update: [modified] },
|
{ onDataLoad, delay: 300, update: [modified] },
|
||||||
);
|
);
|
||||||
@ -83,7 +84,6 @@ export default function MetricsTable({
|
|||||||
<>
|
<>
|
||||||
<div className={styles.header}>
|
<div className={styles.header}>
|
||||||
<div className={styles.title}>{title}</div>
|
<div className={styles.title}>{title}</div>
|
||||||
{headerComponent}
|
|
||||||
<div className={styles.metric} onClick={handleSetFormat}>
|
<div className={styles.metric} onClick={handleSetFormat}>
|
||||||
{metric}
|
{metric}
|
||||||
</div>
|
</div>
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
min-height: 460px;
|
min-height: 460px;
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
padding: 20px 0;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
@ -74,7 +73,7 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
width: 50px;
|
width: 50px;
|
||||||
color: #6e6e6e;
|
color: #6e6e6e;
|
||||||
border-left: 1px solid var(--gray600);
|
border-left: 1px solid var(--gray500);
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
@ -3,13 +3,14 @@ import MetricsTable from './MetricsTable';
|
|||||||
import { osFilter } from 'lib/filters';
|
import { osFilter } from 'lib/filters';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
export default function OSTable({ websiteId, limit, onExpand }) {
|
export default function OSTable({ websiteId, token, limit, onExpand }) {
|
||||||
return (
|
return (
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.operating-systems" defaultMessage="Operating system" />}
|
title={<FormattedMessage id="metrics.operating-systems" defaultMessage="Operating system" />}
|
||||||
type="os"
|
type="os"
|
||||||
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
metric={<FormattedMessage id="metrics.visitors" defaultMessage="Visitors" />}
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={osFilter}
|
dataFilter={osFilter}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
|
@ -4,8 +4,9 @@ import ButtonGroup from 'components/common/ButtonGroup';
|
|||||||
import { urlFilter } from 'lib/filters';
|
import { urlFilter } from 'lib/filters';
|
||||||
import { FILTER_COMBINED, FILTER_RAW } from 'lib/constants';
|
import { FILTER_COMBINED, FILTER_RAW } from 'lib/constants';
|
||||||
import MetricsTable from './MetricsTable';
|
import MetricsTable from './MetricsTable';
|
||||||
|
import ButtonLayout from '../layout/ButtonLayout';
|
||||||
|
|
||||||
export default function PagesTable({ websiteId, websiteDomain, limit, onExpand }) {
|
export default function PagesTable({ websiteId, token, websiteDomain, limit, onExpand }) {
|
||||||
const [filter, setFilter] = useState(FILTER_COMBINED);
|
const [filter, setFilter] = useState(FILTER_COMBINED);
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
@ -17,23 +18,28 @@ export default function PagesTable({ websiteId, websiteDomain, limit, onExpand }
|
|||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{!limit && <FilterButtons buttons={buttons} selected={filter} onClick={setFilter} />}
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.pages" defaultMessage="Pages" />}
|
title={<FormattedMessage id="metrics.pages" defaultMessage="Pages" />}
|
||||||
type="url"
|
type="url"
|
||||||
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
|
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
|
||||||
headerComponent={
|
|
||||||
limit ? null : <FilterButtons buttons={buttons} selected={filter} onClick={setFilter} />
|
|
||||||
}
|
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={urlFilter}
|
dataFilter={urlFilter}
|
||||||
filterOptions={{ domain: websiteDomain, raw: filter === FILTER_RAW }}
|
filterOptions={{ domain: websiteDomain, raw: filter === FILTER_RAW }}
|
||||||
renderLabel={({ x }) => decodeURI(x)}
|
renderLabel={({ x }) => decodeURI(x)}
|
||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FilterButtons = ({ buttons, selected, onClick }) => {
|
const FilterButtons = ({ buttons, selected, onClick }) => {
|
||||||
return <ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />;
|
return (
|
||||||
|
<ButtonLayout>
|
||||||
|
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
||||||
|
</ButtonLayout>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,10 +1,25 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useIntl } from 'react-intl';
|
import { useIntl } from 'react-intl';
|
||||||
|
import tinycolor from 'tinycolor2';
|
||||||
import CheckVisible from 'components/helpers/CheckVisible';
|
import CheckVisible from 'components/helpers/CheckVisible';
|
||||||
import BarChart from './BarChart';
|
import BarChart from './BarChart';
|
||||||
|
import useTheme from 'hooks/useTheme';
|
||||||
|
import { THEME_COLORS } from 'lib/constants';
|
||||||
|
|
||||||
export default function PageviewsChart({ websiteId, data, unit, records, className }) {
|
export default function PageviewsChart({ websiteId, data, unit, records, className, loading }) {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
const [theme] = useTheme();
|
||||||
|
const primaryColor = tinycolor(THEME_COLORS[theme].primary);
|
||||||
|
const colors = {
|
||||||
|
views: {
|
||||||
|
background: primaryColor.setAlpha(0.4).toRgbString(),
|
||||||
|
border: primaryColor.setAlpha(0.5).toRgbString(),
|
||||||
|
},
|
||||||
|
visitors: {
|
||||||
|
background: primaryColor.setAlpha(0.6).toRgbString(),
|
||||||
|
border: primaryColor.setAlpha(0.7).toRgbString(),
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
const handleUpdate = chart => {
|
const handleUpdate = chart => {
|
||||||
const {
|
const {
|
||||||
@ -43,8 +58,8 @@ export default function PageviewsChart({ websiteId, data, unit, records, classNa
|
|||||||
}),
|
}),
|
||||||
data: data.uniques,
|
data: data.uniques,
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
backgroundColor: 'rgb(38, 128, 235, 0.4)',
|
backgroundColor: colors.visitors.background,
|
||||||
borderColor: 'rgb(13, 102, 208, 0.4)',
|
borderColor: colors.visitors.border,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -54,8 +69,8 @@ export default function PageviewsChart({ websiteId, data, unit, records, classNa
|
|||||||
}),
|
}),
|
||||||
data: data.pageviews,
|
data: data.pageviews,
|
||||||
lineTension: 0,
|
lineTension: 0,
|
||||||
backgroundColor: 'rgb(38, 128, 235, 0.2)',
|
backgroundColor: colors.views.background,
|
||||||
borderColor: 'rgb(13, 102, 208, 0.2)',
|
borderColor: colors.views.border,
|
||||||
borderWidth: 1,
|
borderWidth: 1,
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@ -63,6 +78,7 @@ export default function PageviewsChart({ websiteId, data, unit, records, classNa
|
|||||||
records={records}
|
records={records}
|
||||||
animationDuration={visible ? 300 : 0}
|
animationDuration={visible ? 300 : 0}
|
||||||
onUpdate={handleUpdate}
|
onUpdate={handleUpdate}
|
||||||
|
loading={loading}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</CheckVisible>
|
</CheckVisible>
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import ButtonGroup from 'components/common/ButtonGroup';
|
|
||||||
import { getDateRange } from 'lib/date';
|
|
||||||
import styles from './QuickButtons.module.css';
|
|
||||||
|
|
||||||
const options = [
|
|
||||||
{ label: '24h', value: '24hour' },
|
|
||||||
{ label: '7d', value: '7day' },
|
|
||||||
{ label: '30d', value: '30day' },
|
|
||||||
];
|
|
||||||
|
|
||||||
export default function QuickButtons({ value, onChange }) {
|
|
||||||
const selectedItem = options.find(item => item.value === value)?.value;
|
|
||||||
|
|
||||||
function handleClick(selected) {
|
|
||||||
if (selected !== value) {
|
|
||||||
onChange(getDateRange(selected));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
|
||||||
<ButtonGroup
|
|
||||||
size="xsmall"
|
|
||||||
className={styles.buttons}
|
|
||||||
items={options}
|
|
||||||
selectedItem={selectedItem}
|
|
||||||
onClick={handleClick}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
.buttons {
|
|
||||||
display: flex;
|
|
||||||
align-content: center;
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
right: 0;
|
|
||||||
margin: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons button + button {
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttons .button {
|
|
||||||
font-size: var(--font-size-xsmall);
|
|
||||||
padding: 4px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.active {
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 768px) {
|
|
||||||
.buttons button:last-child {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media only screen and (max-width: 576px) {
|
|
||||||
.buttons {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
@ -4,8 +4,15 @@ import MetricsTable from './MetricsTable';
|
|||||||
import { refFilter } from 'lib/filters';
|
import { refFilter } from 'lib/filters';
|
||||||
import ButtonGroup from 'components/common/ButtonGroup';
|
import ButtonGroup from 'components/common/ButtonGroup';
|
||||||
import { FILTER_DOMAIN_ONLY, FILTER_COMBINED, FILTER_RAW } from 'lib/constants';
|
import { FILTER_DOMAIN_ONLY, FILTER_COMBINED, FILTER_RAW } from 'lib/constants';
|
||||||
|
import ButtonLayout from '../layout/ButtonLayout';
|
||||||
|
|
||||||
export default function ReferrersTable({ websiteId, websiteDomain, limit, onExpand = () => {} }) {
|
export default function ReferrersTable({
|
||||||
|
websiteId,
|
||||||
|
websiteDomain,
|
||||||
|
token,
|
||||||
|
limit,
|
||||||
|
onExpand = () => {},
|
||||||
|
}) {
|
||||||
const [filter, setFilter] = useState(FILTER_COMBINED);
|
const [filter, setFilter] = useState(FILTER_COMBINED);
|
||||||
|
|
||||||
const buttons = [
|
const buttons = [
|
||||||
@ -20,9 +27,9 @@ export default function ReferrersTable({ websiteId, websiteDomain, limit, onExpa
|
|||||||
{ label: <FormattedMessage id="metrics.filter.raw" defaultMessage="Raw" />, value: FILTER_RAW },
|
{ label: <FormattedMessage id="metrics.filter.raw" defaultMessage="Raw" />, value: FILTER_RAW },
|
||||||
];
|
];
|
||||||
|
|
||||||
const renderLink = ({ x: url }) => {
|
const renderLink = ({ w: href, x: url }) => {
|
||||||
return url.startsWith('http') ? (
|
return (href || url).startsWith('http') ? (
|
||||||
<a href={url} target="_blank" rel="noreferrer">
|
<a href={href || url} target="_blank" rel="noreferrer">
|
||||||
{decodeURI(url)}
|
{decodeURI(url)}
|
||||||
</a>
|
</a>
|
||||||
) : (
|
) : (
|
||||||
@ -31,15 +38,15 @@ export default function ReferrersTable({ websiteId, websiteDomain, limit, onExpa
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
<>
|
||||||
|
{!limit && <FilterButtons buttons={buttons} selected={filter} onClick={setFilter} />}
|
||||||
<MetricsTable
|
<MetricsTable
|
||||||
title={<FormattedMessage id="metrics.referrers" defaultMessage="Referrers" />}
|
title={<FormattedMessage id="metrics.referrers" defaultMessage="Referrers" />}
|
||||||
type="referrer"
|
type="referrer"
|
||||||
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
|
metric={<FormattedMessage id="metrics.views" defaultMessage="Views" />}
|
||||||
headerComponent={
|
|
||||||
limit ? null : <FilterButtons buttons={buttons} selected={filter} onClick={setFilter} />
|
|
||||||
}
|
|
||||||
websiteId={websiteId}
|
websiteId={websiteId}
|
||||||
websiteDomain={websiteDomain}
|
websiteDomain={websiteDomain}
|
||||||
|
token={token}
|
||||||
limit={limit}
|
limit={limit}
|
||||||
dataFilter={refFilter}
|
dataFilter={refFilter}
|
||||||
filterOptions={{
|
filterOptions={{
|
||||||
@ -50,9 +57,14 @@ export default function ReferrersTable({ websiteId, websiteDomain, limit, onExpa
|
|||||||
onExpand={onExpand}
|
onExpand={onExpand}
|
||||||
renderLabel={renderLink}
|
renderLabel={renderLink}
|
||||||
/>
|
/>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const FilterButtons = ({ buttons, selected, onClick }) => {
|
const FilterButtons = ({ buttons, selected, onClick }) => {
|
||||||
return <ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />;
|
return (
|
||||||
|
<ButtonLayout>
|
||||||
|
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
||||||
|
</ButtonLayout>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
@ -1,35 +1,36 @@
|
|||||||
import React, { useMemo } from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { useDispatch } from 'react-redux';
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import PageviewsChart from './PageviewsChart';
|
import PageviewsChart from './PageviewsChart';
|
||||||
import MetricsBar from './MetricsBar';
|
import MetricsBar from './MetricsBar';
|
||||||
|
import WebsiteHeader from './WebsiteHeader';
|
||||||
import DateFilter from 'components/common/DateFilter';
|
import DateFilter from 'components/common/DateFilter';
|
||||||
import StickyHeader from 'components/helpers/StickyHeader';
|
import StickyHeader from 'components/helpers/StickyHeader';
|
||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
import { getDateArray, getDateLength, getTimezone } from 'lib/date';
|
import useDateRange from 'hooks/useDateRange';
|
||||||
import { setDateRange } from 'redux/actions/websites';
|
import useTimezone from 'hooks/useTimezone';
|
||||||
|
import { getDateArray, getDateLength } from 'lib/date';
|
||||||
import styles from './WebsiteChart.module.css';
|
import styles from './WebsiteChart.module.css';
|
||||||
import WebsiteHeader from './WebsiteHeader';
|
|
||||||
import { useDateRange } from '../../hooks/useDateRange';
|
|
||||||
|
|
||||||
export default function WebsiteChart({
|
export default function WebsiteChart({
|
||||||
websiteId,
|
websiteId,
|
||||||
|
token,
|
||||||
title,
|
title,
|
||||||
stickyHeader = false,
|
stickyHeader = false,
|
||||||
showLink = false,
|
showLink = false,
|
||||||
onDataLoad = () => {},
|
onDataLoad = () => {},
|
||||||
}) {
|
}) {
|
||||||
const dispatch = useDispatch();
|
const [dateRange, setDateRange] = useDateRange(websiteId);
|
||||||
const dateRange = useDateRange(websiteId);
|
|
||||||
const { startDate, endDate, unit, value, modified } = dateRange;
|
const { startDate, endDate, unit, value, modified } = dateRange;
|
||||||
|
const [timezone] = useTimezone();
|
||||||
|
|
||||||
const { data } = useFetch(
|
const { data, loading } = useFetch(
|
||||||
`/api/website/${websiteId}/pageviews`,
|
`/api/website/${websiteId}/pageviews`,
|
||||||
{
|
{
|
||||||
start_at: +startDate,
|
start_at: +startDate,
|
||||||
end_at: +endDate,
|
end_at: +endDate,
|
||||||
unit,
|
unit,
|
||||||
tz: getTimezone(),
|
tz: timezone,
|
||||||
|
token,
|
||||||
},
|
},
|
||||||
{ onDataLoad, update: [modified] },
|
{ onDataLoad, update: [modified] },
|
||||||
);
|
);
|
||||||
@ -44,13 +45,9 @@ export default function WebsiteChart({
|
|||||||
return [[], []];
|
return [[], []];
|
||||||
}, [data]);
|
}, [data]);
|
||||||
|
|
||||||
function handleDateChange(values) {
|
|
||||||
dispatch(setDateRange(websiteId, values));
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<WebsiteHeader websiteId={websiteId} title={title} showLink={showLink} />
|
<WebsiteHeader websiteId={websiteId} token={token} title={title} showLink={showLink} />
|
||||||
<div className={classNames(styles.header, 'row')}>
|
<div className={classNames(styles.header, 'row')}>
|
||||||
<StickyHeader
|
<StickyHeader
|
||||||
className={classNames(styles.metrics, 'col row')}
|
className={classNames(styles.metrics, 'col row')}
|
||||||
@ -58,14 +55,14 @@ export default function WebsiteChart({
|
|||||||
enabled={stickyHeader}
|
enabled={stickyHeader}
|
||||||
>
|
>
|
||||||
<div className="col-12 col-lg-9">
|
<div className="col-12 col-lg-9">
|
||||||
<MetricsBar websiteId={websiteId} />
|
<MetricsBar websiteId={websiteId} token={token} />
|
||||||
</div>
|
</div>
|
||||||
<div className={classNames(styles.filter, 'col-12 col-lg-3')}>
|
<div className={classNames(styles.filter, 'col-12 col-lg-3')}>
|
||||||
<DateFilter
|
<DateFilter
|
||||||
value={value}
|
value={value}
|
||||||
startDate={startDate}
|
startDate={startDate}
|
||||||
endDate={endDate}
|
endDate={endDate}
|
||||||
onChange={handleDateChange}
|
onChange={setDateRange}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</StickyHeader>
|
</StickyHeader>
|
||||||
@ -77,6 +74,7 @@ export default function WebsiteChart({
|
|||||||
data={{ pageviews, uniques }}
|
data={{ pageviews, uniques }}
|
||||||
unit={unit}
|
unit={unit}
|
||||||
records={getDateLength(startDate, endDate, unit)}
|
records={getDateLength(startDate, endDate, unit)}
|
||||||
|
loading={loading}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,37 +1,30 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { useRouter } from 'next/router';
|
import Link from 'components/common/Link';
|
||||||
import PageHeader from 'components/layout/PageHeader';
|
import PageHeader from 'components/layout/PageHeader';
|
||||||
import Button from 'components/common/Button';
|
import RefreshButton from 'components/common/RefreshButton';
|
||||||
|
import ButtonLayout from 'components/layout/ButtonLayout';
|
||||||
|
import Icon from 'components/common/Icon';
|
||||||
import ActiveUsers from './ActiveUsers';
|
import ActiveUsers from './ActiveUsers';
|
||||||
import Arrow from 'assets/arrow-right.svg';
|
import Arrow from 'assets/arrow-right.svg';
|
||||||
import styles from './WebsiteHeader.module.css';
|
import styles from './WebsiteHeader.module.css';
|
||||||
import RefreshButton from '../common/RefreshButton';
|
|
||||||
import ButtonLayout from '../layout/ButtonLayout';
|
|
||||||
|
|
||||||
export default function WebsiteHeader({ websiteId, title, showLink = false }) {
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
|
export default function WebsiteHeader({ websiteId, token, title, showLink = false }) {
|
||||||
return (
|
return (
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<div className={styles.title}>{title}</div>
|
<div className={styles.title}>{title}</div>
|
||||||
<ActiveUsers className={styles.active} websiteId={websiteId} />
|
<ActiveUsers className={styles.active} websiteId={websiteId} token={token} />
|
||||||
<ButtonLayout>
|
<ButtonLayout align="right">
|
||||||
<RefreshButton websiteId={websiteId} />
|
<RefreshButton websiteId={websiteId} />
|
||||||
{showLink && (
|
{showLink && (
|
||||||
<Button
|
<Link
|
||||||
icon={<Arrow />}
|
href="/website/[...id]"
|
||||||
onClick={() =>
|
as={`/website/${websiteId}/${title}`}
|
||||||
router.push('/website/[...id]', `/website/${websiteId}/${title}`, {
|
className={styles.link}
|
||||||
shallow: true,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
size="small"
|
|
||||||
>
|
>
|
||||||
<div>
|
|
||||||
<FormattedMessage id="button.view-details" defaultMessage="View details" />
|
<FormattedMessage id="button.view-details" defaultMessage="View details" />
|
||||||
</div>
|
<Icon icon={<Arrow />} size="small" />
|
||||||
</Button>
|
</Link>
|
||||||
)}
|
)}
|
||||||
</ButtonLayout>
|
</ButtonLayout>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
|
@ -4,8 +4,13 @@
|
|||||||
line-height: var(--font-size-large);
|
line-height: var(--font-size-large);
|
||||||
}
|
}
|
||||||
|
|
||||||
.button {
|
.link {
|
||||||
font-size: var(--font-size-small);
|
font-size: var(--font-size-small);
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.link svg {
|
||||||
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 576px) {
|
@media only screen and (max-width: 576px) {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { useRouter } from 'next/router';
|
import Link from 'next/link';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import PageHeader from 'components/layout/PageHeader';
|
import PageHeader from 'components/layout/PageHeader';
|
||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
@ -16,11 +16,10 @@ import Pen from 'assets/pen.svg';
|
|||||||
import Plus from 'assets/plus.svg';
|
import Plus from 'assets/plus.svg';
|
||||||
import Trash from 'assets/trash.svg';
|
import Trash from 'assets/trash.svg';
|
||||||
import Check from 'assets/check.svg';
|
import Check from 'assets/check.svg';
|
||||||
import List from 'assets/list-ul.svg';
|
import LinkIcon from 'assets/external-link.svg';
|
||||||
import styles from './AccountSettings.module.css';
|
import styles from './AccountSettings.module.css';
|
||||||
|
|
||||||
export default function AccountSettings() {
|
export default function AccountSettings() {
|
||||||
const router = useRouter();
|
|
||||||
const [addAccount, setAddAccount] = useState();
|
const [addAccount, setAddAccount] = useState();
|
||||||
const [editAccount, setEditAccount] = useState();
|
const [editAccount, setEditAccount] = useState();
|
||||||
const [deleteAccount, setDeleteAccount] = useState();
|
const [deleteAccount, setDeleteAccount] = useState();
|
||||||
@ -30,16 +29,18 @@ export default function AccountSettings() {
|
|||||||
|
|
||||||
const Checkmark = ({ is_admin }) => (is_admin ? <Icon icon={<Check />} size="medium" /> : null);
|
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 Buttons = row =>
|
const Buttons = row =>
|
||||||
row.username !== 'admin' ? (
|
row.username !== 'admin' ? (
|
||||||
<ButtonLayout>
|
<ButtonLayout align="right">
|
||||||
<Button
|
|
||||||
icon={<List />}
|
|
||||||
size="small"
|
|
||||||
tooltip={<FormattedMessage id="button.websites" defaultMessage="Websites" />}
|
|
||||||
tooltipId={`button-websites-${row.username}`}
|
|
||||||
onClick={() => router.push(`/dashboard/${row.user_id}/${row.username}`)}
|
|
||||||
/>
|
|
||||||
<Button icon={<Pen />} size="small" onClick={() => setEditAccount(row)}>
|
<Button icon={<Pen />} size="small" onClick={() => setEditAccount(row)}>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="button.edit" defaultMessage="Edit" />
|
<FormattedMessage id="button.edit" defaultMessage="Edit" />
|
||||||
@ -57,17 +58,23 @@ export default function AccountSettings() {
|
|||||||
{
|
{
|
||||||
key: 'username',
|
key: 'username',
|
||||||
label: <FormattedMessage id="label.username" defaultMessage="Username" />,
|
label: <FormattedMessage id="label.username" defaultMessage="Username" />,
|
||||||
className: 'col-6 col-md-4',
|
className: 'col-4 col-md-3',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'is_admin',
|
key: 'is_admin',
|
||||||
label: <FormattedMessage id="label.administrator" defaultMessage="Administrator" />,
|
label: <FormattedMessage id="label.administrator" defaultMessage="Administrator" />,
|
||||||
className: 'col-6 col-md-4',
|
className: 'col-4 col-md-3',
|
||||||
render: Checkmark,
|
render: Checkmark,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'dashboard',
|
||||||
|
label: <FormattedMessage id="label.dashboard" defaultMessage="Dashboard" />,
|
||||||
|
className: 'col-4 col-md-3',
|
||||||
|
render: DashboardLink,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'actions',
|
key: 'actions',
|
||||||
className: classNames(styles.buttons, 'col-12 col-md-4 pt-2 pt-md-0'),
|
className: classNames(styles.buttons, 'col-12 col-md-3 pt-2 pt-md-0'),
|
||||||
render: Buttons,
|
render: Buttons,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
@ -92,7 +99,7 @@ export default function AccountSettings() {
|
|||||||
<>
|
<>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="settings.accounts" defaultMessage="Accounts" />
|
<FormattedMessage id="label.accounts" defaultMessage="Accounts" />
|
||||||
</div>
|
</div>
|
||||||
<Button icon={<Plus />} size="small" onClick={() => setAddAccount(true)}>
|
<Button icon={<Plus />} size="small" onClick={() => setAddAccount(true)}>
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
.buttons {
|
.buttons {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
26
components/settings/DateRangeSetting.js
Normal file
26
components/settings/DateRangeSetting.js
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import DateFilter from 'components/common/DateFilter';
|
||||||
|
import Button from 'components/common/Button';
|
||||||
|
import useDateRange from 'hooks/useDateRange';
|
||||||
|
import { DEFAULT_DATE_RANGE } from 'lib/constants';
|
||||||
|
import { getDateRange } from 'lib/date';
|
||||||
|
import styles from './DateRangeSetting.module.css';
|
||||||
|
|
||||||
|
export default function DateRangeSetting() {
|
||||||
|
const [dateRange, setDateRange] = useDateRange();
|
||||||
|
const { startDate, endDate, value } = dateRange;
|
||||||
|
|
||||||
|
function handleReset() {
|
||||||
|
setDateRange(getDateRange(DEFAULT_DATE_RANGE));
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<DateFilter value={value} startDate={startDate} endDate={endDate} onChange={setDateRange} />
|
||||||
|
<Button className={styles.button} size="small" onClick={handleReset}>
|
||||||
|
<FormattedMessage id="button.reset" defaultMessage="Reset" />
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
3
components/settings/DateRangeSetting.module.css
Normal file
3
components/settings/DateRangeSetting.module.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.button {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
40
components/settings/LanguageButton.js
Normal file
40
components/settings/LanguageButton.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import Head from 'next/head';
|
||||||
|
import { menuOptions } from 'lib/lang';
|
||||||
|
import useLocale from 'hooks/useLocale';
|
||||||
|
import MenuButton from 'components/common/MenuButton';
|
||||||
|
import Globe from 'assets/globe.svg';
|
||||||
|
|
||||||
|
export default function LanguageButton() {
|
||||||
|
const [locale, setLocale] = useLocale();
|
||||||
|
|
||||||
|
function handleSelect(value) {
|
||||||
|
setLocale(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Head>
|
||||||
|
{locale === 'zh-CN' && (
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
{locale === 'ja-JP' && (
|
||||||
|
<link
|
||||||
|
href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap"
|
||||||
|
rel="stylesheet"
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</Head>
|
||||||
|
<MenuButton
|
||||||
|
icon={<Globe />}
|
||||||
|
options={menuOptions}
|
||||||
|
value={locale}
|
||||||
|
renderValue={option => option?.display}
|
||||||
|
onSelect={handleSelect}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
@ -6,7 +6,10 @@ import Button from 'components/common/Button';
|
|||||||
import Modal from 'components/common/Modal';
|
import Modal from 'components/common/Modal';
|
||||||
import Toast from 'components/common/Toast';
|
import Toast from 'components/common/Toast';
|
||||||
import ChangePasswordForm from 'components/forms/ChangePasswordForm';
|
import ChangePasswordForm from 'components/forms/ChangePasswordForm';
|
||||||
|
import TimezoneSetting from 'components/settings/TimezoneSetting';
|
||||||
import Dots from 'assets/ellipsis-h.svg';
|
import Dots from 'assets/ellipsis-h.svg';
|
||||||
|
import styles from './ProfileSettings.module.css';
|
||||||
|
import DateRangeSetting from './DateRangeSetting';
|
||||||
|
|
||||||
export default function ProfileSettings() {
|
export default function ProfileSettings() {
|
||||||
const user = useSelector(state => state.user);
|
const user = useSelector(state => state.user);
|
||||||
@ -23,7 +26,7 @@ export default function ProfileSettings() {
|
|||||||
<>
|
<>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="settings.profile" defaultMessage="Profile" />
|
<FormattedMessage id="label.profile" defaultMessage="Profile" />
|
||||||
</div>
|
</div>
|
||||||
<Button icon={<Dots />} size="small" onClick={() => setChangePassword(true)}>
|
<Button icon={<Dots />} size="small" onClick={() => setChangePassword(true)}>
|
||||||
<div>
|
<div>
|
||||||
@ -31,11 +34,23 @@ export default function ProfileSettings() {
|
|||||||
</div>
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</PageHeader>
|
</PageHeader>
|
||||||
<dl>
|
<dl className={styles.list}>
|
||||||
<dt>
|
<dt>
|
||||||
<FormattedMessage id="label.username" defaultMessage="Username" />
|
<FormattedMessage id="label.username" defaultMessage="Username" />
|
||||||
</dt>
|
</dt>
|
||||||
<dd>{user.username}</dd>
|
<dd>{user.username}</dd>
|
||||||
|
<dt>
|
||||||
|
<FormattedMessage id="label.timezone" defaultMessage="Timezone" />
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<TimezoneSetting />
|
||||||
|
</dd>
|
||||||
|
<dt>
|
||||||
|
<FormattedMessage id="label.default-date-range" defaultMessage="Default date range" />
|
||||||
|
</dt>
|
||||||
|
<dd>
|
||||||
|
<DateRangeSetting />
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
{changePassword && (
|
{changePassword && (
|
||||||
<Modal
|
<Modal
|
||||||
|
3
components/settings/ProfileSettings.module.css
Normal file
3
components/settings/ProfileSettings.module.css
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.list dd {
|
||||||
|
display: flex;
|
||||||
|
}
|
@ -1,4 +1,5 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
import { useRouter } from 'next/router';
|
||||||
import Page from 'components/layout/Page';
|
import Page from 'components/layout/Page';
|
||||||
import MenuLayout from 'components/layout/MenuLayout';
|
import MenuLayout from 'components/layout/MenuLayout';
|
||||||
import WebsiteSettings from './WebsiteSettings';
|
import WebsiteSettings from './WebsiteSettings';
|
||||||
@ -7,33 +8,38 @@ import ProfileSettings from './ProfileSettings';
|
|||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
|
||||||
const WEBSITES = 1;
|
const WEBSITES = '/settings';
|
||||||
const ACCOUNTS = 2;
|
const ACCOUNTS = '/settings/accounts';
|
||||||
const PROFILE = 3;
|
const PROFILE = '/settings/profile';
|
||||||
|
|
||||||
export default function Settings() {
|
export default function Settings() {
|
||||||
const user = useSelector(state => state.user);
|
const user = useSelector(state => state.user);
|
||||||
const [option, setOption] = useState(WEBSITES);
|
const [option, setOption] = useState(WEBSITES);
|
||||||
|
const router = useRouter();
|
||||||
|
const { pathname } = router;
|
||||||
|
|
||||||
const menuOptions = [
|
const menuOptions = [
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="settings.websites" defaultMessage="Websites" />,
|
label: <FormattedMessage id="label.websites" defaultMessage="Websites" />,
|
||||||
value: WEBSITES,
|
value: WEBSITES,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: <FormattedMessage id="settings.accounts" defaultMessage="Accounts" />,
|
label: <FormattedMessage id="label.accounts" defaultMessage="Accounts" />,
|
||||||
value: ACCOUNTS,
|
value: ACCOUNTS,
|
||||||
hidden: !user.is_admin,
|
hidden: !user.is_admin,
|
||||||
},
|
},
|
||||||
{ label: <FormattedMessage id="settings.profile" defaultMessage="Profile" />, value: PROFILE },
|
{
|
||||||
|
label: <FormattedMessage id="label.profile" defaultMessage="Profile" />,
|
||||||
|
value: PROFILE,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Page>
|
<Page>
|
||||||
<MenuLayout menu={menuOptions} selectedOption={option} onMenuSelect={setOption}>
|
<MenuLayout menu={menuOptions} selectedOption={option} onMenuSelect={setOption}>
|
||||||
{option === WEBSITES && <WebsiteSettings />}
|
{pathname === WEBSITES && <WebsiteSettings />}
|
||||||
{option === ACCOUNTS && <AccountSettings />}
|
{pathname === ACCOUNTS && <AccountSettings />}
|
||||||
{option === PROFILE && <ProfileSettings />}
|
{pathname === PROFILE && <ProfileSettings />}
|
||||||
</MenuLayout>
|
</MenuLayout>
|
||||||
</Page>
|
</Page>
|
||||||
);
|
);
|
||||||
|
44
components/settings/ThemeButton.js
Normal file
44
components/settings/ThemeButton.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useTransition, animated } from 'react-spring';
|
||||||
|
import Button from 'components/common/Button';
|
||||||
|
import useTheme from 'hooks/useTheme';
|
||||||
|
import Sun from 'assets/sun.svg';
|
||||||
|
import Moon from 'assets/moon.svg';
|
||||||
|
import styles from './ThemeButton.module.css';
|
||||||
|
import Icon from '../common/Icon';
|
||||||
|
|
||||||
|
export default function ThemeButton() {
|
||||||
|
const [theme, setTheme] = useTheme();
|
||||||
|
|
||||||
|
const transitions = useTransition(theme, theme => theme, {
|
||||||
|
from: {
|
||||||
|
opacity: 0,
|
||||||
|
transform: `translateY(${theme === 'light' ? '20px' : '-20px'}) scale(0.5)`,
|
||||||
|
},
|
||||||
|
enter: { opacity: 1, transform: 'translateY(0px) scale(1)' },
|
||||||
|
leave: {
|
||||||
|
opacity: 0,
|
||||||
|
transform: `translateY(${theme === 'light' ? '-20px' : '20px'}) scale(0.5)`,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleClick() {
|
||||||
|
setTheme(theme === 'light' ? 'dark' : 'light');
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Button className={styles.button} variant="light" onClick={handleClick}>
|
||||||
|
{transitions.map(({ item, key, props }) =>
|
||||||
|
item === 'light' ? (
|
||||||
|
<animated.div key={key} style={props}>
|
||||||
|
<Icon icon={<Sun />} />
|
||||||
|
</animated.div>
|
||||||
|
) : (
|
||||||
|
<animated.div key={key} style={props}>
|
||||||
|
<Icon icon={<Moon />} />
|
||||||
|
</animated.div>
|
||||||
|
),
|
||||||
|
)}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
7
components/settings/ThemeButton.module.css
Normal file
7
components/settings/ThemeButton.module.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.button {
|
||||||
|
width: 50px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button svg {
|
||||||
|
position: absolute;
|
||||||
|
}
|
31
components/settings/TimezoneSetting.js
Normal file
31
components/settings/TimezoneSetting.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { FormattedMessage } from 'react-intl';
|
||||||
|
import { listTimeZones } from 'timezone-support';
|
||||||
|
import DropDown from 'components/common/DropDown';
|
||||||
|
import Button from 'components/common/Button';
|
||||||
|
import useTimezone from 'hooks/useTimezone';
|
||||||
|
import { getTimezone } from 'lib/date';
|
||||||
|
import styles from './TimezoneSetting.module.css';
|
||||||
|
|
||||||
|
export default function TimezoneSetting() {
|
||||||
|
const [timezone, saveTimezone] = useTimezone();
|
||||||
|
const options = listTimeZones().map(n => ({ label: n, value: n }));
|
||||||
|
|
||||||
|
function handleReset() {
|
||||||
|
saveTimezone(getTimezone());
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<DropDown
|
||||||
|
menuClassName={styles.menu}
|
||||||
|
value={timezone}
|
||||||
|
options={options}
|
||||||
|
onChange={saveTimezone}
|
||||||
|
/>
|
||||||
|
<Button className={styles.button} size="small" onClick={handleReset}>
|
||||||
|
<FormattedMessage id="button.reset" defaultMessage="Reset" />
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
8
components/settings/TimezoneSetting.module.css
Normal file
8
components/settings/TimezoneSetting.module.css
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
.menu {
|
||||||
|
max-height: 300px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
@ -1,18 +1,15 @@
|
|||||||
import React, { useState, useRef } from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import { useSelector } from 'react-redux';
|
import { useSelector } from 'react-redux';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import Menu from './Menu';
|
import MenuButton from 'components/common/MenuButton';
|
||||||
import Icon from './Icon';
|
import Icon from 'components/common/Icon';
|
||||||
import useDocumentClick from 'hooks/useDocumentClick';
|
|
||||||
import User from 'assets/user.svg';
|
import User from 'assets/user.svg';
|
||||||
import Chevron from 'assets/chevron-down.svg';
|
import Chevron from 'assets/chevron-down.svg';
|
||||||
import styles from './UserButton.module.css';
|
import styles from './UserButton.module.css';
|
||||||
|
|
||||||
export default function UserButton() {
|
export default function UserButton() {
|
||||||
const [showMenu, setShowMenu] = useState(false);
|
|
||||||
const user = useSelector(state => state.user);
|
const user = useSelector(state => state.user);
|
||||||
const ref = useRef();
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const menuOptions = [
|
const menuOptions = [
|
||||||
@ -27,38 +24,24 @@ export default function UserButton() {
|
|||||||
value: 'username',
|
value: 'username',
|
||||||
className: styles.username,
|
className: styles.username,
|
||||||
},
|
},
|
||||||
|
{ label: <FormattedMessage id="label.profile" defaultMessage="Profile" />, value: 'profile' },
|
||||||
{ label: <FormattedMessage id="label.logout" defaultMessage="Logout" />, value: 'logout' },
|
{ label: <FormattedMessage id="label.logout" defaultMessage="Logout" />, value: 'logout' },
|
||||||
];
|
];
|
||||||
|
|
||||||
function handleSelect(value) {
|
function handleSelect(value) {
|
||||||
setShowMenu(false);
|
|
||||||
|
|
||||||
if (value === 'logout') {
|
if (value === 'logout') {
|
||||||
router.push('/logout');
|
router.push('/logout');
|
||||||
|
} else if (value === 'profile') {
|
||||||
|
router.push('/settings/profile');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useDocumentClick(e => {
|
|
||||||
if (!ref.current.contains(e.target)) {
|
|
||||||
setShowMenu(false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={ref} className={styles.container}>
|
<MenuButton
|
||||||
<div className={styles.button} onClick={() => setShowMenu(state => !state)}>
|
icon={<Icon icon={<User />} size="large" />}
|
||||||
<Icon icon={<User />} size="large" />
|
value={<Icon icon={<Chevron />} size="small" />}
|
||||||
<Icon icon={<Chevron />} size="small" />
|
|
||||||
</div>
|
|
||||||
{showMenu && (
|
|
||||||
<Menu
|
|
||||||
className={styles.menu}
|
|
||||||
options={menuOptions}
|
options={menuOptions}
|
||||||
onSelect={handleSelect}
|
onSelect={handleSelect}
|
||||||
float="bottom"
|
|
||||||
align="right"
|
|
||||||
/>
|
/>
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
7
components/settings/UserButton.module.css
Normal file
7
components/settings/UserButton.module.css
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
.username {
|
||||||
|
border-bottom: 1px solid var(--gray500);
|
||||||
|
}
|
||||||
|
|
||||||
|
.username:hover {
|
||||||
|
background: var(--gray50);
|
||||||
|
}
|
@ -1,6 +1,7 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import { FormattedMessage } from 'react-intl';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import Link from 'components/common/Link';
|
||||||
import Table from 'components/common/Table';
|
import Table from 'components/common/Table';
|
||||||
import Button from 'components/common/Button';
|
import Button from 'components/common/Button';
|
||||||
import PageHeader from 'components/layout/PageHeader';
|
import PageHeader from 'components/layout/PageHeader';
|
||||||
@ -16,7 +17,7 @@ import Pen from 'assets/pen.svg';
|
|||||||
import Trash from 'assets/trash.svg';
|
import Trash from 'assets/trash.svg';
|
||||||
import Plus from 'assets/plus.svg';
|
import Plus from 'assets/plus.svg';
|
||||||
import Code from 'assets/code.svg';
|
import Code from 'assets/code.svg';
|
||||||
import Link from 'assets/link.svg';
|
import LinkIcon from 'assets/link.svg';
|
||||||
import useFetch from 'hooks/useFetch';
|
import useFetch from 'hooks/useFetch';
|
||||||
import styles from './WebsiteSettings.module.css';
|
import styles from './WebsiteSettings.module.css';
|
||||||
|
|
||||||
@ -31,12 +32,12 @@ export default function WebsiteSettings() {
|
|||||||
const { data } = useFetch(`/api/websites`, {}, { update: [saved] });
|
const { data } = useFetch(`/api/websites`, {}, { update: [saved] });
|
||||||
|
|
||||||
const Buttons = row => (
|
const Buttons = row => (
|
||||||
<ButtonLayout>
|
<ButtonLayout align="right">
|
||||||
{row.share_id && (
|
{row.share_id && (
|
||||||
<Button
|
<Button
|
||||||
icon={<Link />}
|
icon={<LinkIcon />}
|
||||||
size="small"
|
size="small"
|
||||||
tooltip={<FormattedMessage id="tooltip.get-share-url" defaultMessage="Get share URL" />}
|
tooltip={<FormattedMessage id="message.get-share-url" defaultMessage="Get share URL" />}
|
||||||
tooltipId={`button-share-${row.website_id}`}
|
tooltipId={`button-share-${row.website_id}`}
|
||||||
onClick={() => setShowUrl(row)}
|
onClick={() => setShowUrl(row)}
|
||||||
/>
|
/>
|
||||||
@ -45,7 +46,7 @@ export default function WebsiteSettings() {
|
|||||||
icon={<Code />}
|
icon={<Code />}
|
||||||
size="small"
|
size="small"
|
||||||
tooltip={
|
tooltip={
|
||||||
<FormattedMessage id="tooltip.get-tracking-code" defaultMessage="Get tracking code" />
|
<FormattedMessage id="message.get-tracking-code" defaultMessage="Get tracking code" />
|
||||||
}
|
}
|
||||||
tooltipId={`button-code-${row.website_id}`}
|
tooltipId={`button-code-${row.website_id}`}
|
||||||
onClick={() => setShowCode(row)}
|
onClick={() => setShowCode(row)}
|
||||||
@ -63,11 +64,18 @@ export default function WebsiteSettings() {
|
|||||||
</ButtonLayout>
|
</ButtonLayout>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const DetailsLink = ({ website_id, name }) => (
|
||||||
|
<Link href="/website/[...id]" as={`/website/${website_id}/${name}`}>
|
||||||
|
{name}
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
label: <FormattedMessage id="label.name" defaultMessage="Name" />,
|
label: <FormattedMessage id="label.name" defaultMessage="Name" />,
|
||||||
className: 'col-6 col-xl-4',
|
className: 'col-6 col-xl-4',
|
||||||
|
render: DetailsLink,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'domain',
|
key: 'domain',
|
||||||
@ -103,7 +111,7 @@ export default function WebsiteSettings() {
|
|||||||
<EmptyPlaceholder
|
<EmptyPlaceholder
|
||||||
msg={
|
msg={
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id="placeholder.message.no-websites-configured"
|
id="message.no-websites-configured"
|
||||||
defaultMessage="You don't have any websites configured."
|
defaultMessage="You don't have any websites configured."
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
@ -120,7 +128,7 @@ export default function WebsiteSettings() {
|
|||||||
<>
|
<>
|
||||||
<PageHeader>
|
<PageHeader>
|
||||||
<div>
|
<div>
|
||||||
<FormattedMessage id="settings.websites" defaultMessage="Websites" />
|
<FormattedMessage id="label.websites" defaultMessage="Websites" />
|
||||||
</div>
|
</div>
|
||||||
<Button icon={<Plus />} size="small" onClick={() => setAddWebsite(true)}>
|
<Button icon={<Plus />} size="small" onClick={() => setAddWebsite(true)}>
|
||||||
<div>
|
<div>
|
||||||
|
@ -1,8 +1,41 @@
|
|||||||
import { useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { parseISO } from 'date-fns';
|
||||||
import { getDateRange } from 'lib/date';
|
import { getDateRange } from 'lib/date';
|
||||||
|
import { getItem, setItem } from 'lib/web';
|
||||||
|
import { setDateRange } from '../redux/actions/websites';
|
||||||
|
import { DATE_RANGE_CONFIG, DEFAULT_DATE_RANGE } from 'lib/constants';
|
||||||
|
import useForceUpdate from './useForceUpdate';
|
||||||
|
|
||||||
export function useDateRange(websiteId, defaultDateRange = '7day') {
|
export default function useDateRange(websiteId, defaultDateRange = DEFAULT_DATE_RANGE) {
|
||||||
return useSelector(
|
const dispatch = useDispatch();
|
||||||
state => state.websites[websiteId]?.dateRange || getDateRange(defaultDateRange),
|
const dateRange = useSelector(state => state.websites[websiteId]?.dateRange);
|
||||||
);
|
const forceUpdate = useForceUpdate();
|
||||||
|
|
||||||
|
const globalDefault = getItem(DATE_RANGE_CONFIG);
|
||||||
|
let globalDateRange;
|
||||||
|
|
||||||
|
if (globalDefault) {
|
||||||
|
if (typeof globalDefault === 'string') {
|
||||||
|
globalDateRange = getDateRange(globalDefault);
|
||||||
|
} else if (typeof globalDefault === 'object') {
|
||||||
|
globalDateRange = {
|
||||||
|
...globalDefault,
|
||||||
|
startDate: parseISO(globalDefault.startDate),
|
||||||
|
endDate: parseISO(globalDefault.endDate),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveDateRange(values) {
|
||||||
|
const { value } = values;
|
||||||
|
|
||||||
|
if (websiteId) {
|
||||||
|
dispatch(setDateRange(websiteId, values));
|
||||||
|
} else {
|
||||||
|
setItem(DATE_RANGE_CONFIG, value === 'custom' ? values : value);
|
||||||
|
forceUpdate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return [dateRange || globalDateRange || getDateRange(defaultDateRange), saveDateRange];
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@ export default function useFetch(url, params = {}, options = {}) {
|
|||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const [data, setData] = useState();
|
const [data, setData] = useState();
|
||||||
const [error, setError] = useState();
|
const [error, setError] = useState();
|
||||||
|
const [loading, setLoadiing] = useState(false);
|
||||||
const keys = Object.keys(params)
|
const keys = Object.keys(params)
|
||||||
.sort()
|
.sort()
|
||||||
.map(key => params[key]);
|
.map(key => params[key]);
|
||||||
@ -14,6 +15,7 @@ export default function useFetch(url, params = {}, options = {}) {
|
|||||||
|
|
||||||
async function loadData() {
|
async function loadData() {
|
||||||
try {
|
try {
|
||||||
|
setLoadiing(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
const time = performance.now();
|
const time = performance.now();
|
||||||
const data = await get(url, params);
|
const data = await get(url, params);
|
||||||
@ -25,6 +27,8 @@ export default function useFetch(url, params = {}, options = {}) {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
setError(e);
|
setError(e);
|
||||||
|
} finally {
|
||||||
|
setLoadiing(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,5 +46,5 @@ export default function useFetch(url, params = {}, options = {}) {
|
|||||||
}
|
}
|
||||||
}, [url, ...keys, ...update]);
|
}, [url, ...keys, ...update]);
|
||||||
|
|
||||||
return { data, error, loadData };
|
return { data, error, loading, loadData };
|
||||||
}
|
}
|
||||||
|
9
hooks/useForceUpdate.js
Normal file
9
hooks/useForceUpdate.js
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import { useCallback, useState } from 'react';
|
||||||
|
|
||||||
|
export default function useForceUpdate() {
|
||||||
|
const [, update] = useState(Object.create(null));
|
||||||
|
|
||||||
|
return useCallback(() => {
|
||||||
|
update(Object.create(null));
|
||||||
|
}, [update]);
|
||||||
|
}
|
@ -1,13 +1,16 @@
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { updateApp } from 'redux/actions/app';
|
import { setLocale } from 'redux/actions/app';
|
||||||
|
import { setItem } from 'lib/web';
|
||||||
|
import { LOCALE_CONFIG } from 'lib/constants';
|
||||||
|
|
||||||
export default function useLocale() {
|
export default function useLocale() {
|
||||||
const locale = useSelector(state => state.app.locale);
|
const locale = useSelector(state => state.app.locale);
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
function setLocale(value) {
|
function saveLocale(value) {
|
||||||
dispatch(updateApp({ locale: value }));
|
setItem(LOCALE_CONFIG, value);
|
||||||
|
dispatch(setLocale(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
return [locale, setLocale];
|
return [locale, saveLocale];
|
||||||
}
|
}
|
||||||
|
21
hooks/useTheme.js
Normal file
21
hooks/useTheme.js
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
|
import { setTheme } from 'redux/actions/app';
|
||||||
|
import { getItem, setItem } from 'lib/web';
|
||||||
|
import { THEME_CONFIG } from 'lib/constants';
|
||||||
|
import { useEffect } from 'react';
|
||||||
|
|
||||||
|
export default function useLocale() {
|
||||||
|
const theme = useSelector(state => state.app.theme || getItem(THEME_CONFIG) || 'light');
|
||||||
|
const dispatch = useDispatch();
|
||||||
|
|
||||||
|
function saveTheme(value) {
|
||||||
|
setItem(THEME_CONFIG, value);
|
||||||
|
dispatch(setTheme(value));
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
document.body.setAttribute('data-theme', theme);
|
||||||
|
}, [theme]);
|
||||||
|
|
||||||
|
return [theme, saveTheme];
|
||||||
|
}
|
17
hooks/useTimezone.js
Normal file
17
hooks/useTimezone.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
import { useState, useCallback } from 'react';
|
||||||
|
import { getTimezone } from 'lib/date';
|
||||||
|
import { getItem, setItem } from 'lib/web';
|
||||||
|
|
||||||
|
export default function useTimezone() {
|
||||||
|
const [timezone, setTimezone] = useState(getItem('umami.timezone') || getTimezone());
|
||||||
|
|
||||||
|
const saveTimezone = useCallback(
|
||||||
|
value => {
|
||||||
|
setItem('umami.timezone', value);
|
||||||
|
setTimezone(value);
|
||||||
|
},
|
||||||
|
[setTimezone],
|
||||||
|
);
|
||||||
|
|
||||||
|
return [timezone, saveTimezone];
|
||||||
|
}
|
95
lang/da-DK.json
Normal file
95
lang/da-DK.json
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"button.add-account": "Tilføj konto",
|
||||||
|
"button.add-website": "Tilføj hjemmeside",
|
||||||
|
"button.back": "Tilbage",
|
||||||
|
"button.cancel": "Afvis",
|
||||||
|
"button.change-password": "Skift adgangskode",
|
||||||
|
"button.copy-to-clipboard": "Kopier til udklipsholder",
|
||||||
|
"button.date-range": "Datointerval",
|
||||||
|
"button.delete": "Slet",
|
||||||
|
"button.edit": "Rediger",
|
||||||
|
"button.login": "Log ind",
|
||||||
|
"button.more": "Mere",
|
||||||
|
"button.refresh": "Opdater",
|
||||||
|
"button.reset": "Reset",
|
||||||
|
"button.save": "Gem",
|
||||||
|
"button.single-day": "Enkelt dag",
|
||||||
|
"button.view-details": "Vis detajler",
|
||||||
|
"label.accounts": "Kontoer",
|
||||||
|
"label.administrator": "Administrator",
|
||||||
|
"label.confirm-password": "Godkendt adgangskode",
|
||||||
|
"label.current-password": "Nuværende adgangskode",
|
||||||
|
"label.custom-range": "Tilpasset interval",
|
||||||
|
"label.dashboard": "Betjeningspanel",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
|
"label.domain": "Domæne",
|
||||||
|
"label.enable-share-url": "Aktivér delings-URL",
|
||||||
|
"label.invalid": "Ugyldig",
|
||||||
|
"label.invalid-domain": "Ugyldigt domæne",
|
||||||
|
"label.last-days": "Sidste {x} dage",
|
||||||
|
"label.last-hours": "Sidste {x} timer",
|
||||||
|
"label.logged-in-as": "Loggede ind som {username}",
|
||||||
|
"label.logout": "Log ud",
|
||||||
|
"label.name": "Navn",
|
||||||
|
"label.new-password": "Ny adgangskode",
|
||||||
|
"label.password": "Adgangskode",
|
||||||
|
"label.passwords-dont-match": "Adgangskoder matcher ikke",
|
||||||
|
"label.profile": "Profil",
|
||||||
|
"label.required": "Påkrævet",
|
||||||
|
"label.settings": "Indstillinger",
|
||||||
|
"label.this-month": "Denne måned",
|
||||||
|
"label.this-week": "Denne uge",
|
||||||
|
"label.this-year": "Dette år",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
|
"label.today": "Idag",
|
||||||
|
"label.unknown": "Ukendt",
|
||||||
|
"label.username": "Brugernavn",
|
||||||
|
"label.websites": "Hjemmesider",
|
||||||
|
"message.active-users": "{x} Nuværende brugere {x, plural, one {visitor} other {visitors}}",
|
||||||
|
"message.confirm-delete": "Er du sikker på at du vil slette {target}?",
|
||||||
|
"message.copied": "Kopieret!",
|
||||||
|
"message.delete-warning": "Alle tilknyttede data slettes også.",
|
||||||
|
"message.failure": "Noget gik galt.",
|
||||||
|
"message.get-share-url": "Få delings-URL",
|
||||||
|
"message.get-tracking-code": "Få sporingskode",
|
||||||
|
"message.go-to-settings": "Gå til betjeningspanel",
|
||||||
|
"message.incorrect-username-password": "Ugyldigt brugernavn/adgangskode.",
|
||||||
|
"message.no-data-available": "Ingen data tilgængelig.",
|
||||||
|
"message.no-websites-configured": "Du har ikke konfigureret nogen websteder.",
|
||||||
|
"message.page-not-found": "Side ikke fundet.",
|
||||||
|
"message.powered-by": "Drevet af {name}",
|
||||||
|
"message.save-success": "Gemt.",
|
||||||
|
"message.share-url": "Dette er den offentligt delings-URL til {target}.",
|
||||||
|
"message.track-stats": "For at spore statistik for {target} skal du placere følgende kode i {head} sektionen på dit websted.",
|
||||||
|
"message.type-delete": "Skriv {delete} i boksen nedenfor, for at bekræfte.",
|
||||||
|
"metrics.actions": "Handlinger",
|
||||||
|
"metrics.average-visit-time": "Gennemsnitlig besøgstid",
|
||||||
|
"metrics.bounce-rate": "Afvisningsprocent",
|
||||||
|
"metrics.browsers": "Browsere",
|
||||||
|
"metrics.countries": "Lande",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobil",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
|
"metrics.devices": "Enheder",
|
||||||
|
"metrics.events": "Hændelser",
|
||||||
|
"metrics.filter.combined": "Kombineret",
|
||||||
|
"metrics.filter.domain-only": "Kun domæne",
|
||||||
|
"metrics.filter.raw": "Rå",
|
||||||
|
"metrics.operating-systems": "Operativsystemer",
|
||||||
|
"metrics.page-views": "Sidevisninger",
|
||||||
|
"metrics.pages": "Sider",
|
||||||
|
"metrics.referrers": "Henvisninger",
|
||||||
|
"metrics.unique-visitors": "Unikke besøgende",
|
||||||
|
"metrics.views": "Visninger",
|
||||||
|
"metrics.visitors": "Besøgende",
|
||||||
|
"title.add-account": "Tilføj konto",
|
||||||
|
"title.add-website": "Tilføj hjemmeside",
|
||||||
|
"title.change-password": "Skift adgangskode",
|
||||||
|
"title.delete-account": "Slet konto",
|
||||||
|
"title.delete-website": "Slet hjemmeside",
|
||||||
|
"title.edit-account": "Rediger konto",
|
||||||
|
"title.edit-website": "Rediger hjemmeside",
|
||||||
|
"title.share-url": "Del URL",
|
||||||
|
"title.tracking-code": "Sporingskode"
|
||||||
|
}
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x} {x, plural, one {aktiver Besucher} other {aktive Besucher}}",
|
|
||||||
"button.add-account": "Konto hinzufügen",
|
"button.add-account": "Konto hinzufügen",
|
||||||
"button.add-website": "Webseite hinzufügen",
|
"button.add-website": "Webseite hinzufügen",
|
||||||
"button.back": "Zurück",
|
"button.back": "Zurück",
|
||||||
"button.cancel": "Abbrechen",
|
"button.cancel": "Abbrechen",
|
||||||
"button.change-password": "Passwort ändern",
|
"button.change-password": "Passwort ändern",
|
||||||
"button.copy-to-clipboard": "In die Zwischenablage kopieren",
|
"button.copy-to-clipboard": "In die Zwischenablage kopieren",
|
||||||
|
"button.date-range": "Datumsbereich",
|
||||||
"button.delete": "Löschen",
|
"button.delete": "Löschen",
|
||||||
"button.edit": "Bearbeiten",
|
"button.edit": "Bearbeiten",
|
||||||
"button.login": "Anmelden",
|
"button.login": "Anmelden",
|
||||||
"button.more": "Mehr",
|
"button.more": "Mehr",
|
||||||
|
"button.refresh": "Aktualisieren",
|
||||||
|
"button.reset": "Zurücksetzen",
|
||||||
"button.save": "Speichern",
|
"button.save": "Speichern",
|
||||||
|
"button.single-day": "Ein Tag",
|
||||||
"button.view-details": "Details anzeigen",
|
"button.view-details": "Details anzeigen",
|
||||||
"button.websites": "Webseiten",
|
"label.accounts": "Konten",
|
||||||
"footer.powered-by": "Powered by",
|
|
||||||
"header.nav.dashboard": "Übersicht",
|
|
||||||
"header.nav.settings": "Einstellungen",
|
|
||||||
"label.administrator": "Administrator",
|
"label.administrator": "Administrator",
|
||||||
"label.confirm-password": "Passwort wiederholen",
|
"label.confirm-password": "Passwort wiederholen",
|
||||||
"label.current-password": "Derzeitiges Passwort",
|
"label.current-password": "Derzeitiges Passwort",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "Benutzerdefinierter Bereich",
|
||||||
|
"label.dashboard": "Übersicht",
|
||||||
|
"label.default-date-range": "Voreingestellter Datumsbereich",
|
||||||
"label.domain": "Domain",
|
"label.domain": "Domain",
|
||||||
"label.enable-share-url": "Freigabe-URL aktivieren",
|
"label.enable-share-url": "Freigabe-URL aktivieren",
|
||||||
"label.invalid": "Ungültig",
|
"label.invalid": "Ungültig",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "Neues Passwort",
|
"label.new-password": "Neues Passwort",
|
||||||
"label.password": "Passwort",
|
"label.password": "Passwort",
|
||||||
"label.passwords-dont-match": "Passwörter stimmen nicht überein",
|
"label.passwords-dont-match": "Passwörter stimmen nicht überein",
|
||||||
|
"label.profile": "Profil",
|
||||||
"label.required": "Erforderlich",
|
"label.required": "Erforderlich",
|
||||||
|
"label.settings": "Einstellungen",
|
||||||
"label.this-month": "Diesen Monat",
|
"label.this-month": "Diesen Monat",
|
||||||
"label.this-week": "Diese Woche",
|
"label.this-week": "Diese Woche",
|
||||||
"label.this-year": "Dieses Jahr",
|
"label.this-year": "Dieses Jahr",
|
||||||
|
"label.timezone": "Zeitzone",
|
||||||
"label.today": "Heute",
|
"label.today": "Heute",
|
||||||
|
"label.unknown": "Unbekannt",
|
||||||
"label.username": "Benutzername",
|
"label.username": "Benutzername",
|
||||||
|
"label.websites": "Webseiten",
|
||||||
|
"message.active-users": "{x} {x, plural, one {aktiver Besucher} other {aktive Besucher}}",
|
||||||
"message.confirm-delete": "Sind sie sich sicher {target} zu löschen?",
|
"message.confirm-delete": "Sind sie sich sicher {target} zu löschen?",
|
||||||
"message.copied": "In Zwischenablage kopiert!",
|
"message.copied": "In Zwischenablage kopiert!",
|
||||||
"message.delete-warning": "Alle zugehörigen Daten werden auch gelöscht.",
|
"message.delete-warning": "Alle zugehörigen Daten werden auch gelöscht.",
|
||||||
"message.failure": "Es it ein Fehler aufgetreten.",
|
"message.failure": "Es it ein Fehler aufgetreten.",
|
||||||
|
"message.get-share-url": "Freigabe-URL abrufen",
|
||||||
|
"message.get-tracking-code": "Erstelle Tracking Kennung",
|
||||||
|
"message.go-to-settings": "Zu den Einstellungen",
|
||||||
"message.incorrect-username-password": "Falsches Passwort oder Benutzername.",
|
"message.incorrect-username-password": "Falsches Passwort oder Benutzername.",
|
||||||
"message.no-data-available": "Keine Daten vorhanden.",
|
"message.no-data-available": "Keine Daten vorhanden.",
|
||||||
|
"message.no-websites-configured": "Es ist keine Webseite vorhanden.",
|
||||||
"message.page-not-found": "Seite nicht gefunden.",
|
"message.page-not-found": "Seite nicht gefunden.",
|
||||||
|
"message.powered-by": "Ermöglicht durch {name}",
|
||||||
"message.save-success": "Erfolgreich gespeichert.",
|
"message.save-success": "Erfolgreich gespeichert.",
|
||||||
"message.share-url": "Dies ist der öffentliche URL zum Teilen für {target}.",
|
"message.share-url": "Dies ist der öffentliche URL zum Teilen für {target}.",
|
||||||
"message.track-stats": "Um die Statistiken für {target} zu übermitteln, platzieren Sie bitte den folgenden Quelltext im {head} ihrer Homepage.",
|
"message.track-stats": "Um die Statistiken für {target} zu übermitteln, platzieren Sie bitte den folgenden Quelltext im {head} ihrer Homepage.",
|
||||||
@ -54,8 +67,12 @@
|
|||||||
"metrics.bounce-rate": "Absprungrate",
|
"metrics.bounce-rate": "Absprungrate",
|
||||||
"metrics.browsers": "Browsers",
|
"metrics.browsers": "Browsers",
|
||||||
"metrics.countries": "Länder",
|
"metrics.countries": "Länder",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobiltelefon",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
"metrics.devices": "Geräte",
|
"metrics.devices": "Geräte",
|
||||||
"metrics.events": "Events",
|
"metrics.events": "Ereignisse",
|
||||||
"metrics.filter.combined": "Kombiniert",
|
"metrics.filter.combined": "Kombiniert",
|
||||||
"metrics.filter.domain-only": "Nur diese Domain",
|
"metrics.filter.domain-only": "Nur diese Domain",
|
||||||
"metrics.filter.raw": "Rohdaten",
|
"metrics.filter.raw": "Rohdaten",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Eindeutige Besucher",
|
"metrics.unique-visitors": "Eindeutige Besucher",
|
||||||
"metrics.views": "Aufrufe",
|
"metrics.views": "Aufrufe",
|
||||||
"metrics.visitors": "Besucher",
|
"metrics.visitors": "Besucher",
|
||||||
"placeholder.message.go-to-settings": "Zu den Einstellungen",
|
|
||||||
"placeholder.message.no-websites-configured": "Es ist keine Webseite vorhanden.",
|
|
||||||
"settings.accounts": "Konten",
|
|
||||||
"settings.profile": "Profil",
|
|
||||||
"settings.websites": "Webseiten",
|
|
||||||
"title.add-account": "Konto hinzugfügen",
|
"title.add-account": "Konto hinzugfügen",
|
||||||
"title.add-website": "Webseite hinzufügen",
|
"title.add-website": "Webseite hinzufügen",
|
||||||
"title.change-password": "Passwort ändern",
|
"title.change-password": "Passwort ändern",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Konto bearbeiten",
|
"title.edit-account": "Konto bearbeiten",
|
||||||
"title.edit-website": "Webseite bearbeiten",
|
"title.edit-website": "Webseite bearbeiten",
|
||||||
"title.share-url": "Freigabe-URL",
|
"title.share-url": "Freigabe-URL",
|
||||||
"title.tracking-code": "Tracking Kennung",
|
"title.tracking-code": "Tracking Kennung"
|
||||||
"tooltip.get-share-url": "Freigabe-URL abrufen",
|
|
||||||
"tooltip.get-tracking-code": "Erstelle Tracking Kennung"
|
|
||||||
}
|
}
|
||||||
|
95
lang/el-GR.json
Normal file
95
lang/el-GR.json
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"button.add-account": "Προσθήκη λογαριασμού",
|
||||||
|
"button.add-website": "Προσθήκη ιστότοπου",
|
||||||
|
"button.back": "Πίσω",
|
||||||
|
"button.cancel": "Ακύρωση",
|
||||||
|
"button.change-password": "Αλλαγή κωδικού",
|
||||||
|
"button.copy-to-clipboard": "Αντιγραφή στο πρόχειρο",
|
||||||
|
"button.date-range": "Εύρος ημερομηνιών",
|
||||||
|
"button.delete": "Διαγραφή",
|
||||||
|
"button.edit": "Επεξεργασία",
|
||||||
|
"button.login": "Είσοδος",
|
||||||
|
"button.more": "Περισσότερα",
|
||||||
|
"button.refresh": "Ανανέωση",
|
||||||
|
"button.reset": "Επαναφορά",
|
||||||
|
"button.save": "Αποθήκευση",
|
||||||
|
"button.single-day": "Ημερήσια",
|
||||||
|
"button.view-details": "Λεπτομέρειες",
|
||||||
|
"label.accounts": "Λογαριασμοί",
|
||||||
|
"label.administrator": "Διαχειριστής",
|
||||||
|
"label.confirm-password": "Επιβεβαίωση κωδικού",
|
||||||
|
"label.current-password": "Τωρινός κωδικός πρόσβασης",
|
||||||
|
"label.custom-range": "Προσαρμοσμένο εύρος",
|
||||||
|
"label.dashboard": "Πίνακας",
|
||||||
|
"label.default-date-range": "Προεπιλεγμένο εύρος ημερομηνιών",
|
||||||
|
"label.domain": "Τομέας",
|
||||||
|
"label.enable-share-url": "Ενεργοποίηση κοινής χρήσης URL",
|
||||||
|
"label.invalid": "Μη έγκυρο",
|
||||||
|
"label.invalid-domain": "Μη έγκυρος τομέας",
|
||||||
|
"label.last-days": "Τελευταίες {x} ημέρες",
|
||||||
|
"label.last-hours": "Τελευταίες {x} ώρες",
|
||||||
|
"label.logged-in-as": "Συνδεθήκατε ως {username}",
|
||||||
|
"label.logout": "Αποσύνδεση",
|
||||||
|
"label.name": "Όνομα",
|
||||||
|
"label.new-password": "Νέος κωδικός",
|
||||||
|
"label.password": "Κωδικός",
|
||||||
|
"label.passwords-dont-match": "Οι κωδικοί πρόσβασης δεν ταιριάζουν",
|
||||||
|
"label.profile": "Προφίλ",
|
||||||
|
"label.required": "Απαιτείται",
|
||||||
|
"label.settings": "Ρυθμίσεις",
|
||||||
|
"label.this-month": "Αυτο το μήνα",
|
||||||
|
"label.this-week": "Αυτή την εβδομάδα",
|
||||||
|
"label.this-year": "Αυτή την χρονιά",
|
||||||
|
"label.timezone": "Ζώνη ώρας",
|
||||||
|
"label.today": "Σήμερα",
|
||||||
|
"label.unknown": "Άγνωστο",
|
||||||
|
"label.username": "Όνομα χρήστη",
|
||||||
|
"label.websites": "Ιστότοποι",
|
||||||
|
"message.active-users": "{x} ενεργοί {x, plural, one {επισκέπτης} other {επισκέπτες}}",
|
||||||
|
"message.confirm-delete": "Είστε βέβαιοι ότι θέλετε να διαγράψετε το {target};",
|
||||||
|
"message.copied": "Αντιγράφηκε!",
|
||||||
|
"message.delete-warning": "Όλα τα σχετικά δεδομένα θα διαγραφούν επίσης.",
|
||||||
|
"message.failure": "Κάτι πήγε στραβά.",
|
||||||
|
"message.get-share-url": "Λήψη URL κοινής χρήσης",
|
||||||
|
"message.get-tracking-code": "Λήψη κώδικα παρακολούθησης",
|
||||||
|
"message.go-to-settings": "Μεταβείτε στις ρυθμίσεις",
|
||||||
|
"message.incorrect-username-password": "Εσφαλμένο όνομα χρήστη / κωδικός πρόσβασης.",
|
||||||
|
"message.no-data-available": "Δεν υπάρχουν διαθέσιμα δεδομένα.",
|
||||||
|
"message.no-websites-configured": "Δεν έχετε ρυθμίσει κανένα ιστότοπο.",
|
||||||
|
"message.page-not-found": "Η σελίδα δεν βρέθηκε.",
|
||||||
|
"message.powered-by": "Με την υποστήριξη του {name}",
|
||||||
|
"message.save-success": "Αποθηκεύτηκε επιτυχώς.",
|
||||||
|
"message.share-url": "Αυτό είναι το κοινόχρηστο URL για το {target}.",
|
||||||
|
"message.track-stats": "Για να παρακολουθείτε στατιστικά στοιχεία για {target}, τοποθετήστε τον ακόλουθο κώδικα στην ενότητα {head} του ιστότοπού σας.",
|
||||||
|
"message.type-delete": "Πληκτρολογήστε {delete} στο παρακάτω πλαίσιο για επιβεβαίωση.",
|
||||||
|
"metrics.actions": "Ενέργειες",
|
||||||
|
"metrics.average-visit-time": "Μέσος χρόνος επίσκεψης",
|
||||||
|
"metrics.bounce-rate": "Ποσοστό αναπήδησης",
|
||||||
|
"metrics.browsers": "Προγράμματα περιήγησης",
|
||||||
|
"metrics.countries": "Χώρες",
|
||||||
|
"metrics.device.desktop": "Σταθερός υπολογιστής",
|
||||||
|
"metrics.device.laptop": "Λάπτοπ",
|
||||||
|
"metrics.device.mobile": "Κινητό",
|
||||||
|
"metrics.device.tablet": "Τάμπλετ",
|
||||||
|
"metrics.devices": "Συσκευές",
|
||||||
|
"metrics.events": "Γεγονότα",
|
||||||
|
"metrics.filter.combined": "Σε συνδυασμό",
|
||||||
|
"metrics.filter.domain-only": "Μόνο τομέας",
|
||||||
|
"metrics.filter.raw": "Ακατέργαστο",
|
||||||
|
"metrics.operating-systems": "Λειτουργικά συστήματα",
|
||||||
|
"metrics.page-views": "Προβολές σελίδας",
|
||||||
|
"metrics.pages": "Σελίδες",
|
||||||
|
"metrics.referrers": "Παραπομπές",
|
||||||
|
"metrics.unique-visitors": "Μοναδικοί επισκέπτες",
|
||||||
|
"metrics.views": "Προβολές",
|
||||||
|
"metrics.visitors": "Επισκέπτες",
|
||||||
|
"title.add-account": "Προσθήκη λογαριασμού",
|
||||||
|
"title.add-website": "Προσθήκη ιστότοπου",
|
||||||
|
"title.change-password": "Αλλαγή κωδικού",
|
||||||
|
"title.delete-account": "Διαγραφή λογαριασμού",
|
||||||
|
"title.delete-website": "Διαγραφή ιστότοπου",
|
||||||
|
"title.edit-account": "Επεξεργασία λογαριασμού",
|
||||||
|
"title.edit-website": "Επεξεργασία ιστότοπου",
|
||||||
|
"title.share-url": "Κοινοποίηση διεύθυνσης URL",
|
||||||
|
"title.tracking-code": "Κωδικός παρακολούθησης"
|
||||||
|
}
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x} current {x, plural, one {visitor} other {visitors}}",
|
|
||||||
"button.add-account": "Add account",
|
"button.add-account": "Add account",
|
||||||
"button.add-website": "Add website",
|
"button.add-website": "Add website",
|
||||||
"button.back": "Back",
|
"button.back": "Back",
|
||||||
"button.cancel": "Cancel",
|
"button.cancel": "Cancel",
|
||||||
"button.change-password": "Change password",
|
"button.change-password": "Change password",
|
||||||
"button.copy-to-clipboard": "Copy to clipboard",
|
"button.copy-to-clipboard": "Copy to clipboard",
|
||||||
|
"button.date-range": "Date range",
|
||||||
"button.delete": "Delete",
|
"button.delete": "Delete",
|
||||||
"button.edit": "Edit",
|
"button.edit": "Edit",
|
||||||
"button.login": "Login",
|
"button.login": "Login",
|
||||||
"button.more": "More",
|
"button.more": "More",
|
||||||
|
"button.refresh": "Refresh",
|
||||||
|
"button.reset": "Reset",
|
||||||
"button.save": "Save",
|
"button.save": "Save",
|
||||||
|
"button.single-day": "Single day",
|
||||||
"button.view-details": "View details",
|
"button.view-details": "View details",
|
||||||
"button.websites": "Websites",
|
"label.accounts": "Accounts",
|
||||||
"footer.powered-by": "Powered by",
|
|
||||||
"header.nav.dashboard": "Dashboard",
|
|
||||||
"header.nav.settings": "Settings",
|
|
||||||
"label.administrator": "Administrator",
|
"label.administrator": "Administrator",
|
||||||
"label.confirm-password": "Confirm password",
|
"label.confirm-password": "Confirm password",
|
||||||
"label.current-password": "Current password",
|
"label.current-password": "Current password",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "Custom range",
|
||||||
|
"label.dashboard": "Dashboard",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
"label.domain": "Domain",
|
"label.domain": "Domain",
|
||||||
"label.enable-share-url": "Enable share URL",
|
"label.enable-share-url": "Enable share URL",
|
||||||
"label.invalid": "Invalid",
|
"label.invalid": "Invalid",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "New password",
|
"label.new-password": "New password",
|
||||||
"label.password": "Password",
|
"label.password": "Password",
|
||||||
"label.passwords-dont-match": "Passwords don't match",
|
"label.passwords-dont-match": "Passwords don't match",
|
||||||
|
"label.profile": "Profile",
|
||||||
"label.required": "Required",
|
"label.required": "Required",
|
||||||
|
"label.settings": "Settings",
|
||||||
"label.this-month": "This month",
|
"label.this-month": "This month",
|
||||||
"label.this-week": "This week",
|
"label.this-week": "This week",
|
||||||
"label.this-year": "This year",
|
"label.this-year": "This year",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
"label.today": "Today",
|
"label.today": "Today",
|
||||||
|
"label.unknown": "Unknown",
|
||||||
"label.username": "Username",
|
"label.username": "Username",
|
||||||
|
"label.websites": "Websites",
|
||||||
|
"message.active-users": "{x} current {x, plural, one {visitor} other {visitors}}",
|
||||||
"message.confirm-delete": "Are your sure you want to delete {target}?",
|
"message.confirm-delete": "Are your sure you want to delete {target}?",
|
||||||
"message.copied": "Copied!",
|
"message.copied": "Copied!",
|
||||||
"message.delete-warning": "All associated data will be deleted as well.",
|
"message.delete-warning": "All associated data will be deleted as well.",
|
||||||
"message.failure": "Something went wrong.",
|
"message.failure": "Something went wrong.",
|
||||||
|
"message.get-share-url": "Get share URL",
|
||||||
|
"message.get-tracking-code": "Get tracking code",
|
||||||
|
"message.go-to-settings": "Go to settings",
|
||||||
"message.incorrect-username-password": "Incorrect username/password.",
|
"message.incorrect-username-password": "Incorrect username/password.",
|
||||||
"message.no-data-available": "No data available.",
|
"message.no-data-available": "No data available.",
|
||||||
|
"message.no-websites-configured": "You don't have any websites configured.",
|
||||||
"message.page-not-found": "Page not found.",
|
"message.page-not-found": "Page not found.",
|
||||||
|
"message.powered-by": "Powered by {name}",
|
||||||
"message.save-success": "Saved successfully.",
|
"message.save-success": "Saved successfully.",
|
||||||
"message.share-url": "This is the publicly shared URL for {target}.",
|
"message.share-url": "This is the publicly shared URL for {target}.",
|
||||||
"message.track-stats": "To track stats for {target}, place the following code in the {head} section of your website.",
|
"message.track-stats": "To track stats for {target}, place the following code in the {head} section of your website.",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "Bounce rate",
|
"metrics.bounce-rate": "Bounce rate",
|
||||||
"metrics.browsers": "Browsers",
|
"metrics.browsers": "Browsers",
|
||||||
"metrics.countries": "Countries",
|
"metrics.countries": "Countries",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobile",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
"metrics.devices": "Devices",
|
"metrics.devices": "Devices",
|
||||||
"metrics.events": "Events",
|
"metrics.events": "Events",
|
||||||
"metrics.filter.combined": "Combined",
|
"metrics.filter.combined": "Combined",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Unique visitors",
|
"metrics.unique-visitors": "Unique visitors",
|
||||||
"metrics.views": "Views",
|
"metrics.views": "Views",
|
||||||
"metrics.visitors": "Visitors",
|
"metrics.visitors": "Visitors",
|
||||||
"placeholder.message.go-to-settings": "Go to settings",
|
|
||||||
"placeholder.message.no-websites-configured": "You don't have any websites configured.",
|
|
||||||
"settings.accounts": "Accounts",
|
|
||||||
"settings.profile": "Profile",
|
|
||||||
"settings.websites": "Websites",
|
|
||||||
"title.add-account": "Add account",
|
"title.add-account": "Add account",
|
||||||
"title.add-website": "Add website",
|
"title.add-website": "Add website",
|
||||||
"title.change-password": "Change password",
|
"title.change-password": "Change password",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Edit account",
|
"title.edit-account": "Edit account",
|
||||||
"title.edit-website": "Edit website",
|
"title.edit-website": "Edit website",
|
||||||
"title.share-url": "Share URL",
|
"title.share-url": "Share URL",
|
||||||
"title.tracking-code": "Tracking code",
|
"title.tracking-code": "Tracking code"
|
||||||
"tooltip.get-share-url": "Get share URL",
|
|
||||||
"tooltip.get-tracking-code": "Get tracking code"
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x} {x, plural, one {activo} other {activos}}",
|
|
||||||
"button.add-account": "Agregar usuario",
|
"button.add-account": "Agregar usuario",
|
||||||
"button.add-website": "Agregar sitio",
|
"button.add-website": "Agregar sitio",
|
||||||
"button.back": "Atrás",
|
"button.back": "Atrás",
|
||||||
"button.cancel": "Cancelar",
|
"button.cancel": "Cancelar",
|
||||||
"button.change-password": "Cambiar contraseña",
|
"button.change-password": "Cambiar contraseña",
|
||||||
"button.copy-to-clipboard": "Copiar al portapapeles",
|
"button.copy-to-clipboard": "Copiar al portapapeles",
|
||||||
|
"button.date-range": "Date range",
|
||||||
"button.delete": "Eliminar",
|
"button.delete": "Eliminar",
|
||||||
"button.edit": "Editar",
|
"button.edit": "Editar",
|
||||||
"button.login": "Iniciar sesión",
|
"button.login": "Iniciar sesión",
|
||||||
"button.more": "Más",
|
"button.more": "Más",
|
||||||
|
"button.refresh": "Refresh",
|
||||||
|
"button.reset": "Reset",
|
||||||
"button.save": "Guardar",
|
"button.save": "Guardar",
|
||||||
|
"button.single-day": "Single day",
|
||||||
"button.view-details": "Ver detalles",
|
"button.view-details": "Ver detalles",
|
||||||
"button.websites": "Sitios",
|
"label.accounts": "Usuarios",
|
||||||
"footer.powered-by": "Desarrollado con",
|
|
||||||
"header.nav.dashboard": "Panel de control",
|
|
||||||
"header.nav.settings": "Configuraciones",
|
|
||||||
"label.administrator": "Administrador",
|
"label.administrator": "Administrador",
|
||||||
"label.confirm-password": "Confirmar contraseña",
|
"label.confirm-password": "Confirmar contraseña",
|
||||||
"label.current-password": "Contraseña actual",
|
"label.current-password": "Contraseña actual",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "Custom range",
|
||||||
|
"label.dashboard": "Panel de control",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
"label.domain": "Dominio",
|
"label.domain": "Dominio",
|
||||||
"label.enable-share-url": "Habilitar compartir URL",
|
"label.enable-share-url": "Habilitar compartir URL",
|
||||||
"label.invalid": "Inválido",
|
"label.invalid": "Inválido",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "Nueva contraseña",
|
"label.new-password": "Nueva contraseña",
|
||||||
"label.password": "Contraseña",
|
"label.password": "Contraseña",
|
||||||
"label.passwords-dont-match": "Las contraseñas no coinciden",
|
"label.passwords-dont-match": "Las contraseñas no coinciden",
|
||||||
|
"label.profile": "Perfil",
|
||||||
"label.required": "Requerido",
|
"label.required": "Requerido",
|
||||||
|
"label.settings": "Configuraciones",
|
||||||
"label.this-month": "Este mes",
|
"label.this-month": "Este mes",
|
||||||
"label.this-week": "Esta semana",
|
"label.this-week": "Esta semana",
|
||||||
"label.this-year": "Este año",
|
"label.this-year": "Este año",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
"label.today": "Hoy",
|
"label.today": "Hoy",
|
||||||
|
"label.unknown": "Unknown",
|
||||||
"label.username": "Nombre de usuario",
|
"label.username": "Nombre de usuario",
|
||||||
|
"label.websites": "Sitios",
|
||||||
|
"message.active-users": "{x} {x, plural, one {activo} other {activos}}",
|
||||||
"message.confirm-delete": "¿Estás seguro(a) de querer eliminar {target}?",
|
"message.confirm-delete": "¿Estás seguro(a) de querer eliminar {target}?",
|
||||||
"message.copied": "Copiado!",
|
"message.copied": "Copiado!",
|
||||||
"message.delete-warning": "Toda la información relacionada será eliminada.",
|
"message.delete-warning": "Toda la información relacionada será eliminada.",
|
||||||
"message.failure": "Algo falló.",
|
"message.failure": "Algo falló.",
|
||||||
|
"message.get-share-url": "Obtener URL para compartir",
|
||||||
|
"message.get-tracking-code": "Obtener código de rastreo",
|
||||||
|
"message.go-to-settings": "Ir a la configuración",
|
||||||
"message.incorrect-username-password": "Nombre de usuario o contraseña incorrectos.",
|
"message.incorrect-username-password": "Nombre de usuario o contraseña incorrectos.",
|
||||||
"message.no-data-available": "Sin información disponible.",
|
"message.no-data-available": "Sin información disponible.",
|
||||||
|
"message.no-websites-configured": "No tienes ningún sitio configurado.",
|
||||||
"message.page-not-found": "Page not found",
|
"message.page-not-found": "Page not found",
|
||||||
|
"message.powered-by": "Desarrollado con {name}",
|
||||||
"message.save-success": "Guardado exitosamente.",
|
"message.save-success": "Guardado exitosamente.",
|
||||||
"message.share-url": "Esta es la URL compartida públicamente para {target}.",
|
"message.share-url": "Esta es la URL compartida públicamente para {target}.",
|
||||||
"message.track-stats": "Para registrar estadísticas para {target}, copia el siguiente código dentro de la etiqueta {head} de tu sitio.",
|
"message.track-stats": "Para registrar estadísticas para {target}, copia el siguiente código dentro de la etiqueta {head} de tu sitio.",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "Porcentaje de rebote",
|
"metrics.bounce-rate": "Porcentaje de rebote",
|
||||||
"metrics.browsers": "Navegadores",
|
"metrics.browsers": "Navegadores",
|
||||||
"metrics.countries": "Países",
|
"metrics.countries": "Países",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobile",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
"metrics.devices": "Dispositivos",
|
"metrics.devices": "Dispositivos",
|
||||||
"metrics.events": "Eventos",
|
"metrics.events": "Eventos",
|
||||||
"metrics.filter.combined": "Combinado",
|
"metrics.filter.combined": "Combinado",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Visitantes únicos",
|
"metrics.unique-visitors": "Visitantes únicos",
|
||||||
"metrics.views": "Vistas",
|
"metrics.views": "Vistas",
|
||||||
"metrics.visitors": "Visitantes",
|
"metrics.visitors": "Visitantes",
|
||||||
"placeholder.message.go-to-settings": "Ir a la configuración",
|
|
||||||
"placeholder.message.no-websites-configured": "No tienes ningún sitio configurado.",
|
|
||||||
"settings.accounts": "Usuarios",
|
|
||||||
"settings.profile": "Perfil",
|
|
||||||
"settings.websites": "Sitios",
|
|
||||||
"title.add-account": "Agregar usuario",
|
"title.add-account": "Agregar usuario",
|
||||||
"title.add-website": "Agregar sitio",
|
"title.add-website": "Agregar sitio",
|
||||||
"title.change-password": "Cambiar contraseña",
|
"title.change-password": "Cambiar contraseña",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Editar usuario",
|
"title.edit-account": "Editar usuario",
|
||||||
"title.edit-website": "Editar sitio",
|
"title.edit-website": "Editar sitio",
|
||||||
"title.share-url": "Compartir URL",
|
"title.share-url": "Compartir URL",
|
||||||
"title.tracking-code": "Código de rastreo",
|
"title.tracking-code": "Código de rastreo"
|
||||||
"tooltip.get-share-url": "Obtener URL para compartir",
|
|
||||||
"tooltip.get-tracking-code": "Obtener código de rastreo"
|
|
||||||
}
|
}
|
||||||
|
95
lang/fr-FR.json
Normal file
95
lang/fr-FR.json
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
{
|
||||||
|
"button.add-account": "Ajouter un compte",
|
||||||
|
"button.add-website": "Ajouter un site",
|
||||||
|
"button.back": "Retour",
|
||||||
|
"button.cancel": "Annuler",
|
||||||
|
"button.change-password": "Changer de mot de passse",
|
||||||
|
"button.copy-to-clipboard": "Copier dans le presse papier",
|
||||||
|
"button.date-range": "Date range",
|
||||||
|
"button.delete": "Supprimer",
|
||||||
|
"button.edit": "Modifier",
|
||||||
|
"button.login": "Connexion",
|
||||||
|
"button.more": "Plus",
|
||||||
|
"button.refresh": "Refresh",
|
||||||
|
"button.reset": "Reset",
|
||||||
|
"button.save": "Sauvegarder",
|
||||||
|
"button.single-day": "Single day",
|
||||||
|
"button.view-details": "Voir les details",
|
||||||
|
"label.accounts": "Comptes",
|
||||||
|
"label.administrator": "Administrateur",
|
||||||
|
"label.confirm-password": "Confirmation du mot de passe",
|
||||||
|
"label.current-password": "Mot de passe actuel",
|
||||||
|
"label.custom-range": "Plage personnalisée",
|
||||||
|
"label.dashboard": "Tableau de bord",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
|
"label.domain": "Domaine",
|
||||||
|
"label.enable-share-url": "Activer le partage d'URL",
|
||||||
|
"label.invalid": "Invalide",
|
||||||
|
"label.invalid-domain": "Domaine invalide",
|
||||||
|
"label.last-days": "{x} derniers jours",
|
||||||
|
"label.last-hours": "{x} dernières heures",
|
||||||
|
"label.logged-in-as": "Connecté en tant que {username}",
|
||||||
|
"label.logout": "Déconnexion",
|
||||||
|
"label.name": "Nom",
|
||||||
|
"label.new-password": "Nouveau mot de passe",
|
||||||
|
"label.password": "Mot de passe",
|
||||||
|
"label.passwords-dont-match": "Les mots de passe ne correspondent pas",
|
||||||
|
"label.profile": "Profile",
|
||||||
|
"label.required": "Requis",
|
||||||
|
"label.settings": "Paramètres",
|
||||||
|
"label.this-month": "Ce mois ci",
|
||||||
|
"label.this-week": "Cette semaine",
|
||||||
|
"label.this-year": "Cette année",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
|
"label.today": "Aujourd'hui",
|
||||||
|
"label.unknown": "Unknown",
|
||||||
|
"label.username": "Nom d'utilisateur",
|
||||||
|
"label.websites": "Sites",
|
||||||
|
"message.active-users": "{x} {x, plural, one {visiteur} other {visiteurs}} actuellement",
|
||||||
|
"message.confirm-delete": "Êtes-vous sur de vouloir supprimer {target}?",
|
||||||
|
"message.copied": "Copié !",
|
||||||
|
"message.delete-warning": "Toutes les données associées seront également supprimées.",
|
||||||
|
"message.failure": "Un problème est survenu.",
|
||||||
|
"message.get-share-url": "Obtenez l'URL de partage",
|
||||||
|
"message.get-tracking-code": "Obtenez le code de suivi",
|
||||||
|
"message.go-to-settings": "Aller aux paramètres",
|
||||||
|
"message.incorrect-username-password": "nom d'utilisateurs/mot de passe incorrect.",
|
||||||
|
"message.no-data-available": "Pas de données disponibles.",
|
||||||
|
"message.no-websites-configured": "Vous n'avez configuré aucun site Web.",
|
||||||
|
"message.page-not-found": "Page non trouvée.",
|
||||||
|
"message.powered-by": "Propulsé par {name}",
|
||||||
|
"message.save-success": "Enregistré avec succès.",
|
||||||
|
"message.share-url": "Ceci est l'URL partagée pour {target}.",
|
||||||
|
"message.track-stats": "Pour suivre les statistiques de {target}, placez le code suivant dans la section {head} de votre site Web.",
|
||||||
|
"message.type-delete": "Tapez {delete} dans la case ci-dessous pour confirmer.",
|
||||||
|
"metrics.actions": "Actions",
|
||||||
|
"metrics.average-visit-time": "Temps de visite moyen",
|
||||||
|
"metrics.bounce-rate": "Taux de rebond",
|
||||||
|
"metrics.browsers": "Navigateurs",
|
||||||
|
"metrics.countries": "Pays",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobile",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
|
"metrics.devices": "Appareils",
|
||||||
|
"metrics.events": "Événements",
|
||||||
|
"metrics.filter.combined": "Combiné",
|
||||||
|
"metrics.filter.domain-only": "Domaine uniquement",
|
||||||
|
"metrics.filter.raw": "Brute",
|
||||||
|
"metrics.operating-systems": "Systèmes d'exploitation",
|
||||||
|
"metrics.page-views": "Pages vues",
|
||||||
|
"metrics.pages": "Pages",
|
||||||
|
"metrics.referrers": "URL Référentes",
|
||||||
|
"metrics.unique-visitors": "Visiteurs uniques",
|
||||||
|
"metrics.views": "Vues",
|
||||||
|
"metrics.visitors": "Visiteurs",
|
||||||
|
"title.add-account": "Ajouter un compte",
|
||||||
|
"title.add-website": "Ajouter un site",
|
||||||
|
"title.change-password": "Changer le mot de passe",
|
||||||
|
"title.delete-account": "Supprimer le compte",
|
||||||
|
"title.delete-website": "Suprimer le site",
|
||||||
|
"title.edit-account": "Modifier le compte",
|
||||||
|
"title.edit-website": "Modifier le site",
|
||||||
|
"title.share-url": "Partager l'URL",
|
||||||
|
"title.tracking-code": "Code de suivi"
|
||||||
|
}
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x}人が閲覧中です。",
|
|
||||||
"button.add-account": "アカウントを追加する",
|
"button.add-account": "アカウントを追加する",
|
||||||
"button.add-website": "Webサイトを追加する",
|
"button.add-website": "Webサイトを追加する",
|
||||||
"button.back": "戻る",
|
"button.back": "戻る",
|
||||||
"button.cancel": "キャンセル",
|
"button.cancel": "キャンセル",
|
||||||
"button.change-password": "パスワード変更",
|
"button.change-password": "パスワード変更",
|
||||||
"button.copy-to-clipboard": "クリップボードにコピー",
|
"button.copy-to-clipboard": "クリップボードにコピー",
|
||||||
|
"button.date-range": "期間",
|
||||||
"button.delete": "削除",
|
"button.delete": "削除",
|
||||||
"button.edit": "編集",
|
"button.edit": "編集",
|
||||||
"button.login": "ログイン",
|
"button.login": "ログイン",
|
||||||
"button.more": "さらに表示",
|
"button.more": "さらに表示",
|
||||||
|
"button.refresh": "更新",
|
||||||
|
"button.reset": "リセット",
|
||||||
"button.save": "保存",
|
"button.save": "保存",
|
||||||
|
"button.single-day": "一日のみ",
|
||||||
"button.view-details": "詳細表示",
|
"button.view-details": "詳細表示",
|
||||||
"button.websites": "Webサイト",
|
"label.accounts": "アカウント",
|
||||||
"footer.powered-by": "Powered by",
|
|
||||||
"header.nav.dashboard": "ダッシュボード",
|
|
||||||
"header.nav.settings": "設定",
|
|
||||||
"label.administrator": "管理者",
|
"label.administrator": "管理者",
|
||||||
"label.confirm-password": "パスワード(確認)",
|
"label.confirm-password": "パスワード(確認)",
|
||||||
"label.current-password": "現在のパスワード",
|
"label.current-password": "現在のパスワード",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "期間を指定する",
|
||||||
|
"label.dashboard": "ダッシュボード",
|
||||||
|
"label.default-date-range": "最初に表示する期間",
|
||||||
"label.domain": "ドメイン",
|
"label.domain": "ドメイン",
|
||||||
"label.enable-share-url": "共有リンクを有効にする",
|
"label.enable-share-url": "共有リンクを有効にする",
|
||||||
"label.invalid": "無効",
|
"label.invalid": "無効",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "新しいパスワード",
|
"label.new-password": "新しいパスワード",
|
||||||
"label.password": "パスワード",
|
"label.password": "パスワード",
|
||||||
"label.passwords-dont-match": "パスワードが一致しません",
|
"label.passwords-dont-match": "パスワードが一致しません",
|
||||||
|
"label.profile": "プロファイル",
|
||||||
"label.required": "必須",
|
"label.required": "必須",
|
||||||
|
"label.settings": "設定",
|
||||||
"label.this-month": "今月",
|
"label.this-month": "今月",
|
||||||
"label.this-week": "今週",
|
"label.this-week": "今週",
|
||||||
"label.this-year": "今年",
|
"label.this-year": "今年",
|
||||||
|
"label.timezone": "タイムゾーン",
|
||||||
"label.today": "今日",
|
"label.today": "今日",
|
||||||
|
"label.unknown": "不明",
|
||||||
"label.username": "ユーザー名",
|
"label.username": "ユーザー名",
|
||||||
|
"label.websites": "Webサイト",
|
||||||
|
"message.active-users": "{x}人が閲覧中です。",
|
||||||
"message.confirm-delete": "{target}を削除してもよろしいですか?",
|
"message.confirm-delete": "{target}を削除してもよろしいですか?",
|
||||||
"message.copied": "コピーしました!",
|
"message.copied": "コピーしました!",
|
||||||
"message.delete-warning": "関連するすべてのデータも削除されます。",
|
"message.delete-warning": "関連するすべてのデータも削除されます。",
|
||||||
"message.failure": "問題が発生しました。",
|
"message.failure": "問題が発生しました。",
|
||||||
|
"message.get-share-url": "共有リンクを取得",
|
||||||
|
"message.get-tracking-code": "トラッキングコードを取得",
|
||||||
|
"message.go-to-settings": "設定する",
|
||||||
"message.incorrect-username-password": "ユーザー名/パスワードが正しくありません。",
|
"message.incorrect-username-password": "ユーザー名/パスワードが正しくありません。",
|
||||||
"message.no-data-available": "データがありません。",
|
"message.no-data-available": "データがありません。",
|
||||||
|
"message.no-websites-configured": "Webサイトが設定されていません。",
|
||||||
"message.page-not-found": "ページが見つかりません。",
|
"message.page-not-found": "ページが見つかりません。",
|
||||||
|
"message.powered-by": "Powered by {name}",
|
||||||
"message.save-success": "正常に保存されました。",
|
"message.save-success": "正常に保存されました。",
|
||||||
"message.share-url": "これは {target} の共有リンクです。",
|
"message.share-url": "これは {target} の共有リンクです。",
|
||||||
"message.track-stats": "{target}のアクセス解析を開始するには、次のコードをWebサイトの{head}セクションへ追加してください。",
|
"message.track-stats": "{target}のアクセス解析を開始するには、次のコードをWebサイトの{head}セクションへ追加してください。",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "直帰率",
|
"metrics.bounce-rate": "直帰率",
|
||||||
"metrics.browsers": "ブラウザ",
|
"metrics.browsers": "ブラウザ",
|
||||||
"metrics.countries": "国",
|
"metrics.countries": "国",
|
||||||
|
"metrics.device.desktop": "デスクトップ",
|
||||||
|
"metrics.device.laptop": "ノートPC",
|
||||||
|
"metrics.device.mobile": "携帯電話",
|
||||||
|
"metrics.device.tablet": "タブレット",
|
||||||
"metrics.devices": "デバイス",
|
"metrics.devices": "デバイス",
|
||||||
"metrics.events": "イベント",
|
"metrics.events": "イベント",
|
||||||
"metrics.filter.combined": "パスまで",
|
"metrics.filter.combined": "パスまで",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "ユニーク訪問者数",
|
"metrics.unique-visitors": "ユニーク訪問者数",
|
||||||
"metrics.views": "閲覧数",
|
"metrics.views": "閲覧数",
|
||||||
"metrics.visitors": "訪問者数",
|
"metrics.visitors": "訪問者数",
|
||||||
"placeholder.message.go-to-settings": "設定する",
|
|
||||||
"placeholder.message.no-websites-configured": "Webサイトが設定されていません。",
|
|
||||||
"settings.accounts": "アカウント",
|
|
||||||
"settings.profile": "プロファイル",
|
|
||||||
"settings.websites": "Webサイト",
|
|
||||||
"title.add-account": "アカウントの追加",
|
"title.add-account": "アカウントの追加",
|
||||||
"title.add-website": "Webサイトの追加",
|
"title.add-website": "Webサイトの追加",
|
||||||
"title.change-password": "パスワード変更",
|
"title.change-password": "パスワード変更",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "アカウントの編集",
|
"title.edit-account": "アカウントの編集",
|
||||||
"title.edit-website": "Webサイトの編集",
|
"title.edit-website": "Webサイトの編集",
|
||||||
"title.share-url": "共有リンク",
|
"title.share-url": "共有リンク",
|
||||||
"title.tracking-code": "トラッキングコード",
|
"title.tracking-code": "トラッキングコード"
|
||||||
"tooltip.get-share-url": "共有リンクを取得",
|
|
||||||
"tooltip.get-tracking-code": "トラッキングコードを取得"
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "одоо {x} {x, plural, one {зочин} other {зочин}} байна",
|
|
||||||
"button.add-account": "Хэрэглэгч нэмэх",
|
"button.add-account": "Хэрэглэгч нэмэх",
|
||||||
"button.add-website": "Веб нэмэх",
|
"button.add-website": "Веб нэмэх",
|
||||||
"button.back": "Буцах",
|
"button.back": "Буцах",
|
||||||
"button.cancel": "Цуцлах",
|
"button.cancel": "Цуцлах",
|
||||||
"button.change-password": "Нууц үг солих",
|
"button.change-password": "Нууц үг солих",
|
||||||
"button.copy-to-clipboard": "Хуулах",
|
"button.copy-to-clipboard": "Хуулах",
|
||||||
|
"button.date-range": "Date range",
|
||||||
"button.delete": "Устгах",
|
"button.delete": "Устгах",
|
||||||
"button.edit": "Засах",
|
"button.edit": "Засах",
|
||||||
"button.login": "Нэвтрэх",
|
"button.login": "Нэвтрэх",
|
||||||
"button.more": "Цааш",
|
"button.more": "Цааш",
|
||||||
|
"button.refresh": "Refresh",
|
||||||
|
"button.reset": "Reset",
|
||||||
"button.save": "Хадгалах",
|
"button.save": "Хадгалах",
|
||||||
|
"button.single-day": "Single day",
|
||||||
"button.view-details": "Дэлгэрүүлж харах",
|
"button.view-details": "Дэлгэрүүлж харах",
|
||||||
"button.websites": "Вебүүд",
|
"label.accounts": "Хэрэглэгчид",
|
||||||
"footer.powered-by": "Powered by",
|
|
||||||
"header.nav.dashboard": "Хянах самбар",
|
|
||||||
"header.nav.settings": "Тохиргоо",
|
|
||||||
"label.administrator": "Админ",
|
"label.administrator": "Админ",
|
||||||
"label.confirm-password": "Шинэ нууц үгээ давтах",
|
"label.confirm-password": "Шинэ нууц үгээ давтах",
|
||||||
"label.current-password": "Ашиглаж буй нууц үг",
|
"label.current-password": "Ашиглаж буй нууц үг",
|
||||||
"label.custom-range": "Дурын хугацаа",
|
"label.custom-range": "Дурын хугацаа",
|
||||||
|
"label.dashboard": "Хянах самбар",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
"label.domain": "Домэйн",
|
"label.domain": "Домэйн",
|
||||||
"label.enable-share-url": "Хуваалцах холбоос идэвхжүүлэх",
|
"label.enable-share-url": "Хуваалцах холбоос идэвхжүүлэх",
|
||||||
"label.invalid": "Буруу",
|
"label.invalid": "Буруу",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "Шинэ нууц үг",
|
"label.new-password": "Шинэ нууц үг",
|
||||||
"label.password": "Нууц үг",
|
"label.password": "Нууц үг",
|
||||||
"label.passwords-dont-match": "Нууц үг тохирохгүй байна",
|
"label.passwords-dont-match": "Нууц үг тохирохгүй байна",
|
||||||
|
"label.profile": "Бүртгэл",
|
||||||
"label.required": "Шаардлагатай",
|
"label.required": "Шаардлагатай",
|
||||||
|
"label.settings": "Тохиргоо",
|
||||||
"label.this-month": "Энэ сар",
|
"label.this-month": "Энэ сар",
|
||||||
"label.this-week": "Энэ долоо хоног",
|
"label.this-week": "Энэ долоо хоног",
|
||||||
"label.this-year": "Энэ жил",
|
"label.this-year": "Энэ жил",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
"label.today": "Өнөөдөр",
|
"label.today": "Өнөөдөр",
|
||||||
|
"label.unknown": "Unknown",
|
||||||
"label.username": "Хэрэглэгчийн нэр",
|
"label.username": "Хэрэглэгчийн нэр",
|
||||||
|
"label.websites": "Вебүүд",
|
||||||
|
"message.active-users": "одоо {x} {x, plural, one {зочин} other {зочин}} байна",
|
||||||
"message.confirm-delete": "Та {target}-г устгахдаа итгэлтэй байна уу?",
|
"message.confirm-delete": "Та {target}-г устгахдаа итгэлтэй байна уу?",
|
||||||
"message.copied": "Хуулсан!",
|
"message.copied": "Хуулсан!",
|
||||||
"message.delete-warning": "Үүнтэй холбоотой бүх өгөгдөл устах болно.",
|
"message.delete-warning": "Үүнтэй холбоотой бүх өгөгдөл устах болно.",
|
||||||
"message.failure": "Ямар нэг зүйл буруу боллоо.",
|
"message.failure": "Ямар нэг зүйл буруу боллоо.",
|
||||||
|
"message.get-share-url": "Хуваалцах холбоос авах",
|
||||||
|
"message.get-tracking-code": "Мөрдөх код авах",
|
||||||
|
"message.go-to-settings": "Тохиргоо руу очих",
|
||||||
"message.incorrect-username-password": "Буруу хэрэглэгчийн нэр/нууц үг.",
|
"message.incorrect-username-password": "Буруу хэрэглэгчийн нэр/нууц үг.",
|
||||||
"message.no-data-available": "Өгөгдөл алга.",
|
"message.no-data-available": "Өгөгдөл алга.",
|
||||||
|
"message.no-websites-configured": "Та ямар нэгэн веб тохируулаагүй байна.",
|
||||||
"message.page-not-found": "Хуудас олдсонгүй.",
|
"message.page-not-found": "Хуудас олдсонгүй.",
|
||||||
|
"message.powered-by": "Powered by {name}",
|
||||||
"message.save-success": "Амжилттай хадгаллаа.",
|
"message.save-success": "Амжилттай хадгаллаа.",
|
||||||
"message.share-url": "{target}-г нийтэд хуваалцах холбоос.",
|
"message.share-url": "{target}-г нийтэд хуваалцах холбоос.",
|
||||||
"message.track-stats": "{target} вебийн статистикийг бүртгэхийн тулд доорх кодыг вебийнхээ {head} хэсэгт байрлуулна уу.",
|
"message.track-stats": "{target} вебийн статистикийг бүртгэхийн тулд доорх кодыг вебийнхээ {head} хэсэгт байрлуулна уу.",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "Нэг хуудас үзээд гарсан",
|
"metrics.bounce-rate": "Нэг хуудас үзээд гарсан",
|
||||||
"metrics.browsers": "Хөтөч",
|
"metrics.browsers": "Хөтөч",
|
||||||
"metrics.countries": "Улс",
|
"metrics.countries": "Улс",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobile",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
"metrics.devices": "Төхөөрөмж",
|
"metrics.devices": "Төхөөрөмж",
|
||||||
"metrics.events": "Үйлдэл",
|
"metrics.events": "Үйлдэл",
|
||||||
"metrics.filter.combined": "Нэгтгэсэн",
|
"metrics.filter.combined": "Нэгтгэсэн",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Зочид",
|
"metrics.unique-visitors": "Зочид",
|
||||||
"metrics.views": "Үзсэн",
|
"metrics.views": "Үзсэн",
|
||||||
"metrics.visitors": "Зочид",
|
"metrics.visitors": "Зочид",
|
||||||
"placeholder.message.go-to-settings": "Тохиргоо руу очих",
|
|
||||||
"placeholder.message.no-websites-configured": "Та ямар нэгэн веб тохируулаагүй байна.",
|
|
||||||
"settings.accounts": "Хэрэглэгчид",
|
|
||||||
"settings.profile": "Бүртгэл",
|
|
||||||
"settings.websites": "Вебүүд",
|
|
||||||
"title.add-account": "Хэрэглэгч нэмэх",
|
"title.add-account": "Хэрэглэгч нэмэх",
|
||||||
"title.add-website": "Веб нэмэх",
|
"title.add-website": "Веб нэмэх",
|
||||||
"title.change-password": "Нууц үг солих",
|
"title.change-password": "Нууц үг солих",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Хэрэглэгч засах",
|
"title.edit-account": "Хэрэглэгч засах",
|
||||||
"title.edit-website": "Веб засах",
|
"title.edit-website": "Веб засах",
|
||||||
"title.share-url": "Хуваалцах холбоос",
|
"title.share-url": "Хуваалцах холбоос",
|
||||||
"title.tracking-code": "Мөрдөх код",
|
"title.tracking-code": "Мөрдөх код"
|
||||||
"tooltip.get-share-url": "Хуваалцах холбоос авах",
|
|
||||||
"tooltip.get-tracking-code": "Мөрдөх код авах"
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x} actieve {x, plural, one {bezoeker} other {bezoekers}}",
|
|
||||||
"button.add-account": "Account toevoegen",
|
"button.add-account": "Account toevoegen",
|
||||||
"button.add-website": "Website toevoegen",
|
"button.add-website": "Website toevoegen",
|
||||||
"button.back": "Terug",
|
"button.back": "Terug",
|
||||||
"button.cancel": "Annuleren",
|
"button.cancel": "Annuleren",
|
||||||
"button.change-password": "Wachtwoord wijzigen",
|
"button.change-password": "Wachtwoord wijzigen",
|
||||||
"button.copy-to-clipboard": "Kopiëer naar klembord",
|
"button.copy-to-clipboard": "Kopiëer naar klembord",
|
||||||
|
"button.date-range": "Datumbereik",
|
||||||
"button.delete": "Verwijderen",
|
"button.delete": "Verwijderen",
|
||||||
"button.edit": "Bewerken",
|
"button.edit": "Bewerken",
|
||||||
"button.login": "Inloggen",
|
"button.login": "Inloggen",
|
||||||
"button.more": "Toon meer",
|
"button.more": "Toon meer",
|
||||||
|
"button.refresh": "Vernieuwen",
|
||||||
|
"button.reset": "Reset",
|
||||||
"button.save": "Opslaan",
|
"button.save": "Opslaan",
|
||||||
|
"button.single-day": "Enkele dag",
|
||||||
"button.view-details": "Meer details",
|
"button.view-details": "Meer details",
|
||||||
"button.websites": "Websites",
|
"label.accounts": "Accounts",
|
||||||
"footer.powered-by": "mogelijk gemaakt door",
|
|
||||||
"header.nav.dashboard": "Dashboard",
|
|
||||||
"header.nav.settings": "Instellingen",
|
|
||||||
"label.administrator": "Administrator",
|
"label.administrator": "Administrator",
|
||||||
"label.confirm-password": "Wachtwoord bevestigen",
|
"label.confirm-password": "Wachtwoord bevestigen",
|
||||||
"label.current-password": "Huidig wachtwoord",
|
"label.current-password": "Huidig wachtwoord",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "Aangepast bereik",
|
||||||
|
"label.dashboard": "Dashboard",
|
||||||
|
"label.default-date-range": "Default date range",
|
||||||
"label.domain": "Domein",
|
"label.domain": "Domein",
|
||||||
"label.enable-share-url": "Sta delen via openbare URL toe",
|
"label.enable-share-url": "Sta delen via openbare URL toe",
|
||||||
"label.invalid": "Ongeldig",
|
"label.invalid": "Ongeldig",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "Nieuw wachtwoord",
|
"label.new-password": "Nieuw wachtwoord",
|
||||||
"label.password": "Wachtwoord",
|
"label.password": "Wachtwoord",
|
||||||
"label.passwords-dont-match": "Wachtwoorden komen niet overeen",
|
"label.passwords-dont-match": "Wachtwoorden komen niet overeen",
|
||||||
|
"label.profile": "Profiel",
|
||||||
"label.required": "Verplicht",
|
"label.required": "Verplicht",
|
||||||
|
"label.settings": "Instellingen",
|
||||||
"label.this-month": "Deze maand",
|
"label.this-month": "Deze maand",
|
||||||
"label.this-week": "Deze week",
|
"label.this-week": "Deze week",
|
||||||
"label.this-year": "Dit jaar",
|
"label.this-year": "Dit jaar",
|
||||||
|
"label.timezone": "Timezone",
|
||||||
"label.today": "Vandaag",
|
"label.today": "Vandaag",
|
||||||
|
"label.unknown": "Onbekend",
|
||||||
"label.username": "Gebruikersnaam",
|
"label.username": "Gebruikersnaam",
|
||||||
|
"label.websites": "Websites",
|
||||||
|
"message.active-users": "{x} actieve {x, plural, one {bezoeker} other {bezoekers}}",
|
||||||
"message.confirm-delete": "Weet je zeker dat je {target} wilt verwijderen?",
|
"message.confirm-delete": "Weet je zeker dat je {target} wilt verwijderen?",
|
||||||
"message.copied": "Gekopiëerd!",
|
"message.copied": "Gekopiëerd!",
|
||||||
"message.delete-warning": "Alle verwante gegezens zullen ook verwijderd worden.",
|
"message.delete-warning": "Alle verwante gegezens zullen ook verwijderd worden.",
|
||||||
"message.failure": "Er is iets misgegaan.",
|
"message.failure": "Er is iets misgegaan.",
|
||||||
|
"message.get-share-url": "Openbare URL",
|
||||||
|
"message.get-tracking-code": "Tracking code",
|
||||||
|
"message.go-to-settings": "Naar instellingen",
|
||||||
"message.incorrect-username-password": "Incorrecte gebruikersnaam/wachtwoord.",
|
"message.incorrect-username-password": "Incorrecte gebruikersnaam/wachtwoord.",
|
||||||
"message.no-data-available": "Geen gegevens beschikbaar.",
|
"message.no-data-available": "Geen gegevens beschikbaar.",
|
||||||
|
"message.no-websites-configured": "Je hebt geen websites ingesteld.",
|
||||||
"message.page-not-found": "Pagina niet gevonden.",
|
"message.page-not-found": "Pagina niet gevonden.",
|
||||||
|
"message.powered-by": "mogelijk gemaakt door {name}",
|
||||||
"message.save-success": "Opslaan succesvol.",
|
"message.save-success": "Opslaan succesvol.",
|
||||||
"message.share-url": "Met deze URL kan {target} openbaar gedeeld worden.",
|
"message.share-url": "Met deze URL kan {target} openbaar gedeeld worden.",
|
||||||
"message.track-stats": "Om statistieken voor {target} bij te houden, plaats je de volgende code in het {head} gedeelte van je website.",
|
"message.track-stats": "Om statistieken voor {target} bij te houden, plaats je de volgende code in het {head} gedeelte van je website.",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "Bouncepercentage",
|
"metrics.bounce-rate": "Bouncepercentage",
|
||||||
"metrics.browsers": "Browsers",
|
"metrics.browsers": "Browsers",
|
||||||
"metrics.countries": "Landen",
|
"metrics.countries": "Landen",
|
||||||
|
"metrics.device.desktop": "Desktop",
|
||||||
|
"metrics.device.laptop": "Laptop",
|
||||||
|
"metrics.device.mobile": "Mobiel",
|
||||||
|
"metrics.device.tablet": "Tablet",
|
||||||
"metrics.devices": "Apparaten",
|
"metrics.devices": "Apparaten",
|
||||||
"metrics.events": "Gebeurtenissen",
|
"metrics.events": "Gebeurtenissen",
|
||||||
"metrics.filter.combined": "Gecombineerd",
|
"metrics.filter.combined": "Gecombineerd",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Unieke bezoekers",
|
"metrics.unique-visitors": "Unieke bezoekers",
|
||||||
"metrics.views": "Weergaven",
|
"metrics.views": "Weergaven",
|
||||||
"metrics.visitors": "Bezoekers",
|
"metrics.visitors": "Bezoekers",
|
||||||
"placeholder.message.go-to-settings": "Naar instellingen",
|
|
||||||
"placeholder.message.no-websites-configured": "Je hebt geen websites ingesteld.",
|
|
||||||
"settings.accounts": "Accounts",
|
|
||||||
"settings.profile": "Profiel",
|
|
||||||
"settings.websites": "Websites",
|
|
||||||
"title.add-account": "Account toevoegen",
|
"title.add-account": "Account toevoegen",
|
||||||
"title.add-website": "Website toevoegen",
|
"title.add-website": "Website toevoegen",
|
||||||
"title.change-password": "Wachtwoord wijzigen",
|
"title.change-password": "Wachtwoord wijzigen",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Account bewerken",
|
"title.edit-account": "Account bewerken",
|
||||||
"title.edit-website": "Website bewerken",
|
"title.edit-website": "Website bewerken",
|
||||||
"title.share-url": "URL delen",
|
"title.share-url": "URL delen",
|
||||||
"title.tracking-code": "Tracking code",
|
"title.tracking-code": "Tracking code"
|
||||||
"tooltip.get-share-url": "Openbare URL",
|
|
||||||
"tooltip.get-tracking-code": "Tracking code"
|
|
||||||
}
|
}
|
||||||
|
@ -1,25 +1,27 @@
|
|||||||
{
|
{
|
||||||
"active-users.message": "{x} текущих посетителей",
|
|
||||||
"button.add-account": "Добавить аккаунт",
|
"button.add-account": "Добавить аккаунт",
|
||||||
"button.add-website": "Добавить сайт",
|
"button.add-website": "Добавить сайт",
|
||||||
"button.back": "Назад",
|
"button.back": "Назад",
|
||||||
"button.cancel": "Отменить",
|
"button.cancel": "Отменить",
|
||||||
"button.change-password": "Изменить пароль",
|
"button.change-password": "Изменить пароль",
|
||||||
"button.copy-to-clipboard": "Скопировать в буфер обмена",
|
"button.copy-to-clipboard": "Скопировать в буфер обмена",
|
||||||
|
"button.date-range": "Диапазон дат",
|
||||||
"button.delete": "Удалить",
|
"button.delete": "Удалить",
|
||||||
"button.edit": "Редактировать",
|
"button.edit": "Редактировать",
|
||||||
"button.login": "Войти",
|
"button.login": "Войти",
|
||||||
"button.more": "Больше",
|
"button.more": "Больше",
|
||||||
|
"button.refresh": "Обновить",
|
||||||
|
"button.reset": "Сбросить",
|
||||||
"button.save": "Сохранить",
|
"button.save": "Сохранить",
|
||||||
|
"button.single-day": "Один день",
|
||||||
"button.view-details": "Посмотреть детали",
|
"button.view-details": "Посмотреть детали",
|
||||||
"button.websites": "Сайты",
|
"label.accounts": "Аккаунты",
|
||||||
"footer.powered-by": "на движке",
|
|
||||||
"header.nav.dashboard": "Информационная панель",
|
|
||||||
"header.nav.settings": "Настройки",
|
|
||||||
"label.administrator": "Администратор",
|
"label.administrator": "Администратор",
|
||||||
"label.confirm-password": "Подтвердить пароль",
|
"label.confirm-password": "Подтвердить пароль",
|
||||||
"label.current-password": "Текущий пароль",
|
"label.current-password": "Текущий пароль",
|
||||||
"label.custom-range": "Custom range",
|
"label.custom-range": "Другой период",
|
||||||
|
"label.dashboard": "Информационная панель",
|
||||||
|
"label.default-date-range": "Диапазон дат по-умолчанию",
|
||||||
"label.domain": "Домен",
|
"label.domain": "Домен",
|
||||||
"label.enable-share-url": "Разрешить делиться ссылкой",
|
"label.enable-share-url": "Разрешить делиться ссылкой",
|
||||||
"label.invalid": "Некорректный",
|
"label.invalid": "Некорректный",
|
||||||
@ -32,19 +34,30 @@
|
|||||||
"label.new-password": "Новый пароль",
|
"label.new-password": "Новый пароль",
|
||||||
"label.password": "Пароль",
|
"label.password": "Пароль",
|
||||||
"label.passwords-dont-match": "Пароли не совпадают",
|
"label.passwords-dont-match": "Пароли не совпадают",
|
||||||
|
"label.profile": "Профиль",
|
||||||
"label.required": "Обязательное",
|
"label.required": "Обязательное",
|
||||||
|
"label.settings": "Настройки",
|
||||||
"label.this-month": "Этот месяц",
|
"label.this-month": "Этот месяц",
|
||||||
"label.this-week": "Эта неделя",
|
"label.this-week": "Эта неделя",
|
||||||
"label.this-year": "Этот год",
|
"label.this-year": "Этот год",
|
||||||
|
"label.timezone": "Часовой пояс",
|
||||||
"label.today": "Сегодня",
|
"label.today": "Сегодня",
|
||||||
|
"label.unknown": "Неизвестно",
|
||||||
"label.username": "Имя пользователя",
|
"label.username": "Имя пользователя",
|
||||||
|
"label.websites": "Сайты",
|
||||||
|
"message.active-users": "{x} текущих посетителей",
|
||||||
"message.confirm-delete": "Вы уверены, что хотите удалить {target}?",
|
"message.confirm-delete": "Вы уверены, что хотите удалить {target}?",
|
||||||
"message.copied": "Скопировано!",
|
"message.copied": "Скопировано!",
|
||||||
"message.delete-warning": "Все связанные данные будут также удалены.",
|
"message.delete-warning": "Все связанные данные будут также удалены.",
|
||||||
"message.failure": "Что-то пошло не так.",
|
"message.failure": "Что-то пошло не так.",
|
||||||
|
"message.get-share-url": "Получить публичную ссылку",
|
||||||
|
"message.get-tracking-code": "Получить код отслеживания",
|
||||||
|
"message.go-to-settings": "Перейти к настройкам",
|
||||||
"message.incorrect-username-password": "Неверное имя пользователя/пароль.",
|
"message.incorrect-username-password": "Неверное имя пользователя/пароль.",
|
||||||
"message.no-data-available": "Нет данных.",
|
"message.no-data-available": "Нет данных.",
|
||||||
|
"message.no-websites-configured": "У вас нет настроенных сайтов.",
|
||||||
"message.page-not-found": "Страница не найдена.",
|
"message.page-not-found": "Страница не найдена.",
|
||||||
|
"message.powered-by": "На движке {name}",
|
||||||
"message.save-success": "Успешно сохранено.",
|
"message.save-success": "Успешно сохранено.",
|
||||||
"message.share-url": "Это публичная ссылка для {target}.",
|
"message.share-url": "Это публичная ссылка для {target}.",
|
||||||
"message.track-stats": "Чтобы отслеживать статистику для {target}, поместите следующий код в раздел {head} вашего сайта.",
|
"message.track-stats": "Чтобы отслеживать статистику для {target}, поместите следующий код в раздел {head} вашего сайта.",
|
||||||
@ -54,6 +67,10 @@
|
|||||||
"metrics.bounce-rate": "Отказы",
|
"metrics.bounce-rate": "Отказы",
|
||||||
"metrics.browsers": "Браузеры",
|
"metrics.browsers": "Браузеры",
|
||||||
"metrics.countries": "Страны",
|
"metrics.countries": "Страны",
|
||||||
|
"metrics.device.desktop": "Настольный компьютер",
|
||||||
|
"metrics.device.laptop": "Ноутбук",
|
||||||
|
"metrics.device.mobile": "Смартфон",
|
||||||
|
"metrics.device.tablet": "Планшет",
|
||||||
"metrics.devices": "Устройства",
|
"metrics.devices": "Устройства",
|
||||||
"metrics.events": "События",
|
"metrics.events": "События",
|
||||||
"metrics.filter.combined": "Объединенные",
|
"metrics.filter.combined": "Объединенные",
|
||||||
@ -66,11 +83,6 @@
|
|||||||
"metrics.unique-visitors": "Уникальные посетители",
|
"metrics.unique-visitors": "Уникальные посетители",
|
||||||
"metrics.views": "Просмотры",
|
"metrics.views": "Просмотры",
|
||||||
"metrics.visitors": "Посетители",
|
"metrics.visitors": "Посетители",
|
||||||
"placeholder.message.go-to-settings": "Перейти к настройкам",
|
|
||||||
"placeholder.message.no-websites-configured": "У вас нет настроенных сайтов.",
|
|
||||||
"settings.accounts": "Аккаунты",
|
|
||||||
"settings.profile": "Профиль",
|
|
||||||
"settings.websites": "Сайты",
|
|
||||||
"title.add-account": "Добавить аккаунт",
|
"title.add-account": "Добавить аккаунт",
|
||||||
"title.add-website": "Добавить сайт",
|
"title.add-website": "Добавить сайт",
|
||||||
"title.change-password": "Изменить пароль",
|
"title.change-password": "Изменить пароль",
|
||||||
@ -79,7 +91,5 @@
|
|||||||
"title.edit-account": "Редактировать аккаунт",
|
"title.edit-account": "Редактировать аккаунт",
|
||||||
"title.edit-website": "Редактировать сайт",
|
"title.edit-website": "Редактировать сайт",
|
||||||
"title.share-url": "Поделиться ссылкой",
|
"title.share-url": "Поделиться ссылкой",
|
||||||
"title.tracking-code": "Код отслеживания",
|
"title.tracking-code": "Код отслеживания"
|
||||||
"tooltip.get-share-url": "Получить публичную ссылку",
|
|
||||||
"tooltip.get-tracking-code": "Получить код отслеживания"
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user