From 8f739d2d4a336cd1dcd63203568853b8f6e4e726 Mon Sep 17 00:00:00 2001 From: oiov Date: Sat, 3 Aug 2024 10:45:39 +0800 Subject: [PATCH] chore --- app/(protected)/admin/users/user-list.tsx | 13 +--------- .../dashboard/records/record-list.tsx | 14 +--------- app/(protected)/dashboard/urls/meta-chart.tsx | 26 ++++++++++++------- app/(protected)/dashboard/urls/url-list.tsx | 14 +--------- components/forms/record-form.tsx | 2 +- components/forms/url-form.tsx | 2 +- components/forms/user-form.tsx | 2 +- components/forms/user-name-form.tsx | 2 +- components/forms/user-role-form.tsx | 2 +- components/shared/icons.tsx | 2 ++ components/ui/button.tsx | 1 + config/dashboard.ts | 4 +-- middleware.ts | 7 +---- package.json | 1 + pnpm-lock.yaml | 8 ++++++ styles/globals.css | 2 ++ tailwind.config.ts | 1 + 17 files changed, 43 insertions(+), 60 deletions(-) diff --git a/app/(protected)/admin/users/user-list.tsx b/app/(protected)/admin/users/user-list.tsx index f69f37a..850ee90 100644 --- a/app/(protected)/admin/users/user-list.tsx +++ b/app/(protected)/admin/users/user-list.tsx @@ -205,22 +205,11 @@ export default function UsersList({ user }: UrlListProps) { )) ) : ( - + No users Here don't have any user yet. - {/* */} )} diff --git a/app/(protected)/dashboard/records/record-list.tsx b/app/(protected)/dashboard/records/record-list.tsx index 7e7e3d5..b2d8284 100644 --- a/app/(protected)/dashboard/records/record-list.tsx +++ b/app/(protected)/dashboard/records/record-list.tsx @@ -245,23 +245,11 @@ export default function UserRecordsList({ user, action }: RecordListProps) { )) ) : ( - {/* */} + No records You don't have any record yet. Start creating record. - )} diff --git a/app/(protected)/dashboard/urls/meta-chart.tsx b/app/(protected)/dashboard/urls/meta-chart.tsx index f1c30d5..952668d 100644 --- a/app/(protected)/dashboard/urls/meta-chart.tsx +++ b/app/(protected)/dashboard/urls/meta-chart.tsx @@ -140,7 +140,9 @@ export function DailyPVUVChart({ data }: { data: UrlMeta[] }) { const triggers = { [TopoJSONMap.selectors.feature]: (d) => d.id }; const refererStats = generateStatsList(data, "referer"); - const countryStats = generateStatsList(data, "region"); + const cityStats = generateStatsList(data, "city"); + const deviceStats = generateStatsList(data, "device"); + const browserStats = generateStatsList(data, "browser"); return ( @@ -232,8 +234,14 @@ export function DailyPVUVChart({ data }: { data: UrlMeta[] }) { {refererStats.length > 0 && ( )} - {countryStats.length > 0 && ( - + {cityStats.length > 0 && ( + + )} + {browserStats.length > 0 && ( + + )} + {deviceStats.length > 0 && ( + )} @@ -255,10 +263,12 @@ export function StatsList({ data, title }: { data: Stat[]; title: string }) {
{isLink(ref.dimension) ? ( - {ref.dimension} + {ref.dimension.startsWith("http") + ? ref.dimension.split("//")[1] + : ref.dimension} ) : (

{ref.dimension}

@@ -269,11 +279,9 @@ export function StatsList({ data, title }: { data: Stat[]; title: string }) {
- {ref.percentage} -
+ >
))} diff --git a/app/(protected)/dashboard/urls/url-list.tsx b/app/(protected)/dashboard/urls/url-list.tsx index d362fda..67b8562 100644 --- a/app/(protected)/dashboard/urls/url-list.tsx +++ b/app/(protected)/dashboard/urls/url-list.tsx @@ -263,23 +263,11 @@ export default function UserUrlsList({ user, action }: UrlListProps) { )) ) : ( - {/* */} + No urls You don't have any url yet. Start creating url. - )} diff --git a/components/forms/record-form.tsx b/components/forms/record-form.tsx index 0d88d91..b8b24ef 100644 --- a/components/forms/record-form.tsx +++ b/components/forms/record-form.tsx @@ -327,7 +327,7 @@ export function RecordForm({