From 619ac7cabb754f51113451825927f32b0ac321a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=8B=E4=BF=8A=E7=86=99?= Date: Thu, 14 Nov 2024 16:39:33 +0800 Subject: [PATCH] refact --- app/(protected)/admin/line-chart-multiple.tsx | 20 +- .../dashboard/records/record-list.tsx | 1 - app/(protected)/dashboard/scrape/charts.tsx | 42 ++ .../dashboard/scrape/daily-chart.tsx | 284 ++++++++++ app/(protected)/dashboard/scrape/loading.tsx | 2 +- app/(protected)/dashboard/scrape/logs.tsx | 181 +++++++ .../dashboard/scrape/markdown/loading.tsx | 11 + .../dashboard/scrape/markdown/page.tsx | 32 ++ .../dashboard/scrape/meta-info/loading.tsx | 11 + .../dashboard/scrape/meta-info/page.tsx | 31 ++ .../dashboard/scrape/meta-scraping.tsx | 237 --------- app/(protected)/dashboard/scrape/meta.tsx | 0 app/(protected)/dashboard/scrape/page.tsx | 44 +- app/(protected)/dashboard/scrape/scrapes.tsx | 487 ++++++++++++++++++ .../dashboard/scrape/screenshot/loading.tsx | 11 + .../dashboard/scrape/screenshot/page.tsx | 32 ++ app/(protected)/dashboard/urls/meta-chart.tsx | 2 +- app/api/scraping/logs/route.ts | 133 +++++ components/dashboard/dashboard-info-card.tsx | 34 ++ components/shared/icons.tsx | 8 + config/dashboard.ts | 31 +- lib/dto/scrape.ts | 67 +++ 22 files changed, 1451 insertions(+), 250 deletions(-) create mode 100644 app/(protected)/dashboard/scrape/charts.tsx create mode 100644 app/(protected)/dashboard/scrape/daily-chart.tsx create mode 100644 app/(protected)/dashboard/scrape/logs.tsx create mode 100644 app/(protected)/dashboard/scrape/markdown/loading.tsx create mode 100644 app/(protected)/dashboard/scrape/markdown/page.tsx create mode 100644 app/(protected)/dashboard/scrape/meta-info/loading.tsx create mode 100644 app/(protected)/dashboard/scrape/meta-info/page.tsx delete mode 100644 app/(protected)/dashboard/scrape/meta-scraping.tsx delete mode 100644 app/(protected)/dashboard/scrape/meta.tsx create mode 100644 app/(protected)/dashboard/scrape/scrapes.tsx create mode 100644 app/(protected)/dashboard/scrape/screenshot/loading.tsx create mode 100644 app/(protected)/dashboard/scrape/screenshot/page.tsx create mode 100644 app/api/scraping/logs/route.ts diff --git a/app/(protected)/admin/line-chart-multiple.tsx b/app/(protected)/admin/line-chart-multiple.tsx index 61f8b15..c545efb 100644 --- a/app/(protected)/admin/line-chart-multiple.tsx +++ b/app/(protected)/admin/line-chart-multiple.tsx @@ -73,6 +73,11 @@ export function LineChartMultiple({ return ( + + + Total requests of {type1} and {type2}. + + value.slice(5, -1)} + tickFormatter={(value) => { + const date = new Date(value); + return date.toLocaleDateString("en-US", { + month: "short", + day: "numeric", + }); + }} /> - + } /> - -
- Showing total requests of {type1} and {type2}. -
-
); } diff --git a/app/(protected)/dashboard/records/record-list.tsx b/app/(protected)/dashboard/records/record-list.tsx index 8dfe658..9302cc0 100644 --- a/app/(protected)/dashboard/records/record-list.tsx +++ b/app/(protected)/dashboard/records/record-list.tsx @@ -288,7 +288,6 @@ export default function UserRecordsList({ user, action }: RecordListProps) {