feat: #62 add title section in website
This commit is contained in:
parent
ab03eddfa1
commit
d5895dc4a9
@ -16,6 +16,7 @@ interface MetricsTableProps {
|
||||
| 'url'
|
||||
| 'language'
|
||||
| 'referrer'
|
||||
| 'title'
|
||||
| 'browser'
|
||||
| 'os'
|
||||
| 'device'
|
||||
|
@ -128,7 +128,16 @@ function WebsiteDetailComponent() {
|
||||
endAt={endAt}
|
||||
/>
|
||||
</Card.Grid>
|
||||
<Card.Grid hoverable={false} className="min-h-[470px] !w-1/2">
|
||||
<Card.Grid hoverable={false} className="min-h-[470px] !w-1/3">
|
||||
<WebsiteMetricsTable
|
||||
websiteId={websiteId}
|
||||
type="title"
|
||||
title={[t('Title'), t('Views')]}
|
||||
startAt={startAt}
|
||||
endAt={endAt}
|
||||
/>
|
||||
</Card.Grid>
|
||||
<Card.Grid hoverable={false} className="min-h-[470px] !w-1/3">
|
||||
<WebsiteMetricsTable
|
||||
websiteId={websiteId}
|
||||
type="country"
|
||||
@ -141,7 +150,7 @@ function WebsiteDetailComponent() {
|
||||
<WebsiteVisitorMapBtn websiteId={websiteId} />
|
||||
</div>
|
||||
</Card.Grid>
|
||||
<Card.Grid hoverable={false} className="min-h-[470px] !w-1/2">
|
||||
<Card.Grid hoverable={false} className="min-h-[470px] !w-1/3">
|
||||
<WebsiteMetricsTable
|
||||
websiteId={websiteId}
|
||||
type="event"
|
||||
|
@ -36,6 +36,9 @@ export default defineConfig({
|
||||
'/api/workspace': {
|
||||
target: 'http://localhost:12345',
|
||||
},
|
||||
'/api/website/send': {
|
||||
target: 'http://localhost:12345',
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
@ -184,15 +184,18 @@ export const websiteRouter = router({
|
||||
}),
|
||||
]);
|
||||
|
||||
const stats = Object.keys(metrics[0]).reduce((obj, key) => {
|
||||
const current = Number(metrics[0][key]) || 0;
|
||||
const prev = Number(prevPeriod[0][key]) || 0;
|
||||
obj[key] = {
|
||||
value: current,
|
||||
prev,
|
||||
};
|
||||
return obj;
|
||||
}, {} as Record<string, { value: number; prev: number }>);
|
||||
const stats = Object.keys(metrics[0]).reduce(
|
||||
(obj, key) => {
|
||||
const current = Number(metrics[0][key]) || 0;
|
||||
const prev = Number(prevPeriod[0][key]) || 0;
|
||||
obj[key] = {
|
||||
value: current,
|
||||
prev,
|
||||
};
|
||||
return obj;
|
||||
},
|
||||
{} as Record<string, { value: number; prev: number }>
|
||||
);
|
||||
|
||||
return websiteStatsSchema.parse(stats);
|
||||
}),
|
||||
@ -330,6 +333,7 @@ export const websiteRouter = router({
|
||||
'url',
|
||||
'language',
|
||||
'referrer',
|
||||
'title',
|
||||
'browser',
|
||||
'os',
|
||||
'device',
|
||||
|
Loading…
Reference in New Issue
Block a user