mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 22:27:16 +01:00
Updated metrics components for compare mode.
This commit is contained in:
parent
6b03935fca
commit
df66acaacf
117 changed files with 602 additions and 513 deletions
|
|
@ -22,6 +22,7 @@ export interface WebsiteStatsRequestQuery {
|
|||
country?: string;
|
||||
region?: string;
|
||||
city?: string;
|
||||
compare?: string;
|
||||
}
|
||||
|
||||
import * as yup from 'yup';
|
||||
|
|
@ -41,6 +42,7 @@ const schema = {
|
|||
country: yup.string(),
|
||||
region: yup.string(),
|
||||
city: yup.string(),
|
||||
compare: yup.string(),
|
||||
}),
|
||||
};
|
||||
|
||||
|
|
@ -77,7 +79,7 @@ export default async (
|
|||
const stats = Object.keys(metrics[0]).reduce((obj, key) => {
|
||||
obj[key] = {
|
||||
value: Number(metrics[0][key]) || 0,
|
||||
change: Number(metrics[0][key]) - Number(prevPeriod[0][key]) || 0,
|
||||
prev: Number(prevPeriod[0][key]) || 0,
|
||||
};
|
||||
return obj;
|
||||
}, {});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue